From 87b36b00dfbe9c11f3f386dd39e2152e4d8b0db4 Mon Sep 17 00:00:00 2001 From: John Sully Date: Sun, 1 Mar 2020 22:16:25 -0500 Subject: [PATCH] Add option to build pro without license checks Former-commit-id: 0713518d2f34559a06db31a9023228b91ce60af3 --- src/Makefile | 5 +++++ src/server.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/Makefile b/src/Makefile index 45c70f6d6..cef895987 100644 --- a/src/Makefile +++ b/src/Makefile @@ -108,6 +108,11 @@ ifeq ($(USE_JEMALLOC),no) MALLOC=libc endif + +ifeq ($(NO_LICENSE_CHECK),yes) + CXXFLAGS+=-DNO_LICENSE_CHECK=1 +endif + # Override default settings if possible -include .make-settings diff --git a/src/server.cpp b/src/server.cpp index 53a16e54d..82f334fda 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1103,6 +1103,7 @@ void serverLog(int level, const char *fmt, ...) { static void checkTrialTimeout() { +#ifndef NO_LICENSE_CHECK if (cserver.license_key != nullptr && FValidKey(cserver.license_key, strlen(cserver.license_key))) return; time_t curtime = time(NULL); @@ -1118,6 +1119,7 @@ static void checkTrialTimeout() { serverLog(LL_WARNING, "Trial timeout in %ld:%02ld minutes", remaining/60, remaining % 60); } +#endif } /* Log a fixed message without printf-alike capabilities, in a way that is