X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ffiles.c;h=442a0b674b915681014f63d50075ac4cf2928c50;hb=de5791c86b3c80e18b1871d39b9ec207c96c7cbf;hp=0b5ff039a98f385270e469ca2bd459eae6c64fa8;hpb=4cc589984c70d83f67e61fcfa6e7d9cf0e03347c;p=rocksndiamonds.git diff --git a/src/files.c b/src/files.c index 0b5ff039..442a0b67 100644 --- a/src/files.c +++ b/src/files.c @@ -9251,6 +9251,10 @@ static void ApiGetScore_HttpRequestExt(struct HttpRequest *request, if (!HTTP_SUCCESS(response->status_code)) { + // do not show error message if no scores found for this level set + if (response->status_code == 404) + return; + Error("server failed to handle request: %d %s", response->status_code, response->status_text); @@ -9717,12 +9721,17 @@ void LoadLocalAndServerScore(int nr, boolean download_score) { int last_added_local = scores.last_added_local; - LoadScore(nr); + // needed if only showing server scores + setScoreInfoToDefaults(); + + if (!strEqual(setup.scores_in_highscore_list, STR_SCORES_TYPE_SERVER_ONLY)) + LoadScore(nr); // restore last added local score entry (before merging server scores) scores.last_added = scores.last_added_local = last_added_local; - if (setup.use_api_server && !setup.only_show_local_scores) + if (setup.use_api_server && + !strEqual(setup.scores_in_highscore_list, STR_SCORES_TYPE_LOCAL_ONLY)) { // load server scores from cache file and trigger update from server LoadServerScore(nr, download_score); @@ -9923,8 +9932,8 @@ static struct TokenInfo global_setup_tokens[] = &setup.show_undo_redo_buttons, "show_undo_redo_buttons" }, { - TYPE_SWITCH, - &setup.only_show_local_scores, "only_show_local_scores" + TYPE_STRING, + &setup.scores_in_highscore_list, "scores_in_highscore_list" }, { TYPE_STRING, @@ -10619,7 +10628,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->small_game_graphics = FALSE; si->show_load_save_buttons = FALSE; si->show_undo_redo_buttons = FALSE; - si->only_show_local_scores = FALSE; + si->scores_in_highscore_list = getStringCopy(STR_SCORES_TYPE_DEFAULT); si->graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR); si->sounds_set = getStringCopy(SND_CLASSIC_SUBDIR);