From: Holger Schemel Date: Mon, 6 Sep 2021 22:22:21 +0000 (+0200) Subject: renamed setup option for using score server X-Git-Tag: 4.3.0.0~65 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c1d626add6662c6ffa9ca5c00be53b11684195cf;p=rocksndiamonds.git renamed setup option for using score server --- diff --git a/src/files.c b/src/files.c index e13641b9..1ff0a4d5 100644 --- a/src/files.c +++ b/src/files.c @@ -9245,7 +9245,7 @@ static void LoadServerScoreFromCache(int nr) void LoadServerScore(int nr, boolean download_score) { - if (!setup.api_server) + if (!setup.use_api_server) return; // always start with reliable default values @@ -9255,7 +9255,7 @@ void LoadServerScore(int nr, boolean download_score) // (this should prevent reading it while the thread is writing to it) LoadServerScoreFromCache(nr); - if (download_score && runtime.api_server) + if (download_score && runtime.use_api_server) { // 2nd step: download server scores from score server to cache file // (as thread, as it might time out if the server is not reachable) @@ -9477,7 +9477,7 @@ static void UploadScoreToServerAsThread(int nr, char *score_tape_filename) void SaveServerScore(int nr) { - if (!runtime.api_server) + if (!runtime.use_api_server) return; UploadScoreToServerAsThread(nr, NULL); @@ -9485,7 +9485,7 @@ void SaveServerScore(int nr) void SaveServerScoreFromFile(int nr, char *score_tape_filename) { - if (!runtime.api_server) + if (!runtime.use_api_server) return; UploadScoreToServerAsThread(nr, score_tape_filename); @@ -9500,7 +9500,7 @@ void LoadLocalAndServerScore(int nr, boolean download_score) // restore last added local score entry (before merging server scores) scores.last_added = scores.last_added_local = last_added_local; - if (setup.api_server && !setup.only_show_local_scores) + if (setup.use_api_server && !setup.only_show_local_scores) { // load server scores from cache file and trigger update from server LoadServerScore(nr, download_score); @@ -9758,7 +9758,7 @@ static struct TokenInfo global_setup_tokens[] = }, { TYPE_SWITCH, - &setup.api_server, "api_server" + &setup.use_api_server, "use_api_server" }, { TYPE_STRING, @@ -10412,7 +10412,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->network_player_nr = 0; // first player si->network_server_hostname = getStringCopy(STR_NETWORK_AUTO_DETECT); - si->api_server = TRUE; + si->use_api_server = TRUE; si->api_server_hostname = getStringCopy(API_SERVER_HOSTNAME); si->api_server_password = getStringCopy(UNDEFINED_PASSWORD); si->ask_for_uploading_tapes = TRUE; @@ -11041,7 +11041,7 @@ void SaveSetup(void) global_setup_tokens[i].value == &setup.graphics_set || global_setup_tokens[i].value == &setup.volume_simple || global_setup_tokens[i].value == &setup.network_mode || - global_setup_tokens[i].value == &setup.api_server || + global_setup_tokens[i].value == &setup.use_api_server || global_setup_tokens[i].value == &setup.touch.control_type || global_setup_tokens[i].value == &setup.touch.grid_xsize[0] || global_setup_tokens[i].value == &setup.touch.grid_xsize[1]) diff --git a/src/libgame/http.c b/src/libgame/http.c index 592aeb17..f677d71c 100644 --- a/src/libgame/http.c +++ b/src/libgame/http.c @@ -290,7 +290,7 @@ boolean DoHttpRequest(struct HttpRequest *request, checked_free(send_buffer); checked_free(recv_buffer); - runtime.api_server = success; + runtime.use_api_server = success; return success; } diff --git a/src/libgame/system.c b/src/libgame/system.c index 28d8ebae..64aaf0f8 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -128,7 +128,7 @@ void InitRuntimeInfo() runtime.uses_touch_device = FALSE; #endif - runtime.api_server = setup.api_server; + runtime.use_api_server = setup.use_api_server; } void SetWindowTitle(void) diff --git a/src/libgame/system.h b/src/libgame/system.h index b512d1cf..ecc5f698 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1034,7 +1034,7 @@ struct RuntimeInfo { boolean uses_touch_device; - boolean api_server; + boolean use_api_server; }; struct OptionInfo @@ -1497,7 +1497,7 @@ struct SetupInfo int network_player_nr; char *network_server_hostname; - boolean api_server; + boolean use_api_server; char *api_server_hostname; char *api_server_password; boolean ask_for_uploading_tapes; diff --git a/src/screens.c b/src/screens.c index 553b2410..dfc08900 100644 --- a/src/screens.c +++ b/src/screens.c @@ -6875,7 +6875,7 @@ static struct TokenInfo setup_info_game[] = { TYPE_PLAYER, &setup.network_player_nr,"Preferred Network Player:" }, { TYPE_TEXT_INPUT, execGadgetNetworkServer, "Network Server Hostname:" }, { TYPE_STRING, &network_server_text, "" }, - { TYPE_SWITCH, &setup.api_server, "Use Highscore Server:" }, + { TYPE_SWITCH, &setup.use_api_server, "Use Highscore Server:" }, { TYPE_SWITCH, &setup.only_show_local_scores, "Only Show Local Scores:" }, { TYPE_ENTER_LIST, execOfferUploadTapes, "Upload All Tapes to Server" }, { TYPE_SWITCH, &setup.multiple_users, "Multiple Users/Teams:" }, @@ -7481,8 +7481,8 @@ static void changeSetupValue(int screen_pos, int setup_info_pos_raw, int dx) ToggleNetworkModeIfNeeded(); // API server mode may have changed at this point - if (si->value == &setup.api_server) - runtime.api_server = setup.api_server; + if (si->value == &setup.use_api_server) + runtime.use_api_server = setup.use_api_server; // game speed list may have changed at this point if (si->value == &setup.game_speed_extended)