renamed setup option for using score server
authorHolger Schemel <info@artsoft.org>
Mon, 6 Sep 2021 22:22:21 +0000 (00:22 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 6 Sep 2021 22:22:21 +0000 (00:22 +0200)
src/files.c
src/libgame/http.c
src/libgame/system.c
src/libgame/system.h
src/screens.c

index e13641b9dddb8051d5afa7704bd8a8a60bd9a630..1ff0a4d5d2aad6497a197dca087460d5f610dda4 100644 (file)
@@ -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])
index 592aeb17c0a4220a7688527a0a01293ae92e93b5..f677d71c795ffcb66815eba52ecd4a8dd7335878 100644 (file)
@@ -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;
 }
index 28d8ebae635b09027136b57abed0035f377ec8c9..64aaf0f822210821d3ba5925808d310db6d027e0 100644 (file)
@@ -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)
index b512d1cf513eaf211b86d654f5b0632dda74ed1b..ecc5f69855079f578ce6e1ba4f9b3878a6c308b0 100644 (file)
@@ -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;
index 553b24109c939556ad4be8ddfca81ab8bac02e3e..dfc08900a8ddc82ea290cc69df41ea07be223741 100644 (file)
@@ -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)