From: Holger Schemel Date: Sun, 12 Sep 2021 11:27:07 +0000 (+0200) Subject: added definitions for using test score server X-Git-Tag: 4.3.0.0~62 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=76334a7dc0e0bffe01ee32c31a5522d35341a7dd;p=rocksndiamonds.git added definitions for using test score server --- diff --git a/src/Makefile b/src/Makefile index 21ca5f95..5cbc559e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -133,6 +133,10 @@ OPTIONS = $(DEBUG) -Wall -Wstrict-prototypes -Wmissing-prototypes # OPTIONS = -O2 -Wall # OPTIONS = -O2 +ifdef BUILD_TEST # test build +OPTIONS := $(OPTIONS) -DTESTING +endif + ifdef BUILD_DIST # distribution build SYS_LDFLAGS := $(shell echo $(SYS_LDFLAGS) | \ sed -e "s%-rpath,[^ ]*%-rpath,'\$$ORIGIN/lib'%") diff --git a/src/files.c b/src/files.c index c14d8396..e73ce9c5 100644 --- a/src/files.c +++ b/src/files.c @@ -9760,23 +9760,23 @@ static struct TokenInfo global_setup_tokens[] = }, { TYPE_SWITCH, - &setup.use_api_server, "use_api_server" + &setup.use_api_server, TEST_PREFIX "use_api_server" }, { TYPE_STRING, - &setup.api_server_hostname, "api_server_hostname" + &setup.api_server_hostname, TEST_PREFIX "api_server_hostname" }, { TYPE_STRING, - &setup.api_server_password, "api_server_password" + &setup.api_server_password, TEST_PREFIX "api_server_password" }, { TYPE_SWITCH, - &setup.ask_for_uploading_tapes, "ask_for_uploading_tapes" + &setup.ask_for_uploading_tapes, TEST_PREFIX "ask_for_uploading_tapes" }, { TYPE_SWITCH, - &setup.provide_uploading_tapes, "provide_uploading_tapes" + &setup.provide_uploading_tapes, TEST_PREFIX "provide_uploading_tapes" }, { TYPE_STRING, diff --git a/src/libgame/system.h b/src/libgame/system.h index ecc5f698..2943e645 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -113,6 +113,14 @@ #define API_SERVER_URI_GET "/api/scores/get" #define API_SERVER_URI_RENAME "/api/players/rename" +#if defined(TESTING) +#undef API_SERVER_HOSTNAME +#define API_SERVER_HOSTNAME "api-test.artsoft.org" +#define TEST_PREFIX "test." +#else +#define TEST_PREFIX "" +#endif + // values for touch control #define TOUCH_CONTROL_OFF "off" #define TOUCH_CONTROL_VIRTUAL_BUTTONS "virtual_buttons"