Skip to content

Commit 4e22fd2

Browse files
committed
disable_autoupdate_standings supported
1 parent 64b2317 commit 4e22fd2

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

lib/prepare.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2843,8 +2843,12 @@ set_defaults(
28432843
g->stand_show_ok_time = DFLT_G_STAND_SHOW_OK_TIME;
28442844
if (g->stand_show_warn_number == -1)
28452845
g->stand_show_warn_number = DFLT_G_STAND_SHOW_WARN_NUMBER;
2846-
if (g->autoupdate_standings == -1)
2847-
g->autoupdate_standings = DFLT_G_AUTOUPDATE_STANDINGS;
2846+
if (g->autoupdate_standings == -1) {
2847+
if (ejudge_config->disable_autoupdate_standings > 0)
2848+
g->autoupdate_standings = 0;
2849+
else
2850+
g->autoupdate_standings = DFLT_G_AUTOUPDATE_STANDINGS;
2851+
}
28482852
if (g->use_ac_not_ok == -1)
28492853
g->use_ac_not_ok = DFLT_G_USE_AC_NOT_OK;
28502854
if (g->disable_auto_testing == -1)
@@ -5451,7 +5455,12 @@ prepare_set_global_defaults(struct section_global_data *g)
54515455
if (!g->max_clar_num) g->max_clar_num = DFLT_G_MAX_CLAR_NUM;
54525456
if (g->board_fog_time < 0) g->board_fog_time = DFLT_G_BOARD_FOG_TIME;
54535457
if (g->board_unfog_time < 0) g->board_unfog_time = DFLT_G_BOARD_UNFOG_TIME;
5454-
if (g->autoupdate_standings < 0) g->autoupdate_standings=DFLT_G_AUTOUPDATE_STANDINGS;
5458+
if (g->autoupdate_standings < 0) {
5459+
if (ejudge_config->disable_autoupdate_standings > 0)
5460+
g->autoupdate_standings = 0;
5461+
else
5462+
g->autoupdate_standings = DFLT_G_AUTOUPDATE_STANDINGS;
5463+
}
54555464
if (g->use_ac_not_ok < 0) g->use_ac_not_ok = DFLT_G_USE_AC_NOT_OK;
54565465
if (g->team_enable_src_view < 0) g->team_enable_src_view=DFLT_G_TEAM_ENABLE_SRC_VIEW;
54575466
if (g->team_enable_rep_view < 0) g->team_enable_rep_view=DFLT_G_TEAM_ENABLE_REP_VIEW;
@@ -5718,8 +5727,10 @@ prepare_new_global_section(int contest_id, const unsigned char *root_dir,
57185727
global->max_clar_num = DFLT_G_MAX_CLAR_NUM;
57195728
global->board_fog_time = DFLT_G_BOARD_FOG_TIME;
57205729
global->board_unfog_time = DFLT_G_BOARD_UNFOG_TIME;
5721-
5722-
global->autoupdate_standings = DFLT_G_AUTOUPDATE_STANDINGS;
5730+
if (ejudge_config && ejudge_config->disable_autoupdate_standings > 0)
5731+
global->autoupdate_standings = 0;
5732+
else
5733+
global->autoupdate_standings = DFLT_G_AUTOUPDATE_STANDINGS;
57235734
global->use_ac_not_ok = DFLT_G_USE_AC_NOT_OK;
57245735
global->team_enable_src_view = DFLT_G_TEAM_ENABLE_SRC_VIEW;
57255736
global->team_enable_rep_view = DFLT_G_TEAM_ENABLE_REP_VIEW;

lib/prepare_out.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,13 @@ prepare_unparse_global(
464464
fprintf(f, "sleep_time = %d\n", global->sleep_time);
465465
if (global->serve_sleep_time != DFLT_G_SERVE_SLEEP_TIME)
466466
fprintf(f, "serve_sleep_time = %d\n", global->serve_sleep_time);
467-
if (global->autoupdate_standings != DFLT_G_AUTOUPDATE_STANDINGS)
468-
unparse_bool(f, "autoupdate_standings", global->autoupdate_standings);
467+
if (ejudge_config && ejudge_config->disable_autoupdate_standings > 0) {
468+
if (global->autoupdate_standings > 0)
469+
unparse_bool(f, "autoupdate_standings", global->autoupdate_standings);
470+
} else {
471+
if (global->autoupdate_standings != DFLT_G_AUTOUPDATE_STANDINGS)
472+
unparse_bool(f, "autoupdate_standings", global->autoupdate_standings);
473+
}
469474
if (global->use_ac_not_ok != DFLT_G_USE_AC_NOT_OK)
470475
unparse_bool(f, "use_ac_not_ok", global->use_ac_not_ok);
471476
if (global->inactivity_timeout

0 commit comments

Comments
 (0)