// (this should prevent reading it while the thread is writing to it)
LoadServerScoreFromCache(nr);
- if (download_score)
+ if (download_score && runtime.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)
void SaveServerScore(int nr)
{
- if (!setup.api_server)
+ if (!runtime.api_server)
return;
UploadScoreToServerAsThread(nr);
checked_free(send_buffer);
checked_free(recv_buffer);
+ runtime.api_server = success;
+
return success;
}
#else
runtime.uses_touch_device = FALSE;
#endif
+
+ runtime.api_server = setup.api_server;
}
void InitScoresInfo(void)
struct RuntimeInfo
{
boolean uses_touch_device;
+
+ boolean api_server;
};
struct OptionInfo
if (si->value == &setup.network_mode)
ToggleNetworkModeIfNeeded();
+ // API server mode may have changed at this point
+ if (si->value == &setup.api_server)
+ runtime.api_server = setup.api_server;
+
// game speed list may have changed at this point
if (si->value == &setup.game_speed_extended)
ToggleGameSpeedsListIfNeeded();