From 198fad473e56c400273e51f30db864f4a7cb9e3f Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 24 Feb 2006 18:33:58 +0000 Subject: [PATCH] Rework obsolete comment on hours file, an move it where it belongs: next to variable definitions and into econfig doc strings. --- include/econfig-spec.h | 27 ++++++++++++++------- include/wantupd.h | 49 +++----------------------------------- src/lib/global/constants.c | 20 ++++++++-------- 3 files changed, 32 insertions(+), 64 deletions(-) diff --git a/include/econfig-spec.h b/include/econfig-spec.h index 05ed768f0..dba89c166 100644 --- a/include/econfig-spec.h +++ b/include/econfig-spec.h @@ -97,33 +97,44 @@ EMPCFBOTH("WORLD_Y", WORLD_Y, int, NSC_INT, 0, EMPCF_COMMENT("\n\n### Update policy") EMPCFBOTH("update_policy", update_policy, int, NSC_INT, 0, - "0 - normal, 1 - update_times, 2 - blitz, 3 - demand only") + "Update policy") +EMPCF_COMMENT("# 0 - Schedule updates according to etu_per_update, s_p_etu, adj_update\n" + "# 1 - Update at times specified by key \"update_times\"\n" + "# 2 - Blitz update every blitz_time minute\n" + "# 3 - No regular updates, only demand ones") EMPCFBOTH("etu_per_update", etu_per_update, int, NSC_INT, 0, "Number of ETUs per update") EMPCFBOTH("s_p_etu", s_p_etu, int, NSC_INT, 0, - "Seconds per etu, updates will occur every s_p_etu * etu_per_update seconds") + "Seconds per etu, updates under policy 0 every s_p_etu * etu_per_update seconds") EMPCFBOTH("adj_update", adj_update, int, NSC_INT, KM_INTERNAL, "Move the update forward or backward (in seconds)") EMPCFBOTH("update_window", update_window, int, NSC_INT, 0, "Window the update will occur in (in seconds) before and after the update time") EMPCFBOTH("update_times", update_times, char *, NSC_STRING, 0, - "Times when updates occur under policy #1. Must coincide with schedule.") + "Times of day when updates may occur under policy 1, separated by space.") +EMPCF_COMMENT("# Give time of day as HOUR:MINUTE, e.g. 20:00\n" + "# Times must coincide with updates under policy 0.") EMPCFBOTH("hourslop", hourslop, int, NSC_INT, KM_INTERNAL, "Number of minutes update check can slip to match update_times") EMPCFBOTH("blitz_time", blitz_time, int, NSC_INT, 0, - "Number of minutes between updates under policy #2.") + "Number of minutes between updates under policy 2.") EMPCFBOTH("pre_update_hook", pre_update_hook, char *, NSC_STRING, KM_INTERNAL, "Shell command run right before the update.") EMPCF_COMMENT("\n\n### Demand update policy") EMPCFBOTH("update_demandpolicy", update_demandpolicy, int, NSC_INT, 0, - "0 - emp_tm checks, 1 - after setting, 2 - demand updates disabled") + "Demand update policy") +EMPCF_COMMENT("# 0 - Votes tallied at update times under policy 0\n" + "# 1 - Votes tallies right after a vote\n" + "# 2 - Demand updates disabled") EMPCFBOTH("update_wantmin", update_wantmin, int, NSC_INT, 0, - "number of requests needed for demand update") + "Number of votes required for a demand update") EMPCFBOTH("update_missed", update_missed, int, NSC_INT, 0, - "number of demand updates country can miss before veto update") + "A country vetoes further demand updates after missing that many votes") EMPCFBOTH("update_demandtimes", update_demandtimes, char *, NSC_STRING, 0, - "Times when demand updates can occur. Ranges CANNOT cross midnight.") + "Time of day ranges when demand updates can occur, separated by space.") +EMPCF_COMMENT("# Give range HOUR:MINUTE-HOUR:MINUTE, e.g. 20:00-24:00\n" + "# Ranges CANNOT cross midnight.") EMPCF_COMMENT("\n\n### Game hours restrictions") EMPCFBOTH("game_days", game_days, char *, NSC_STRING, 0, diff --git a/include/wantupd.h b/include/wantupd.h index f435da0f8..83ac6eedb 100644 --- a/include/wantupd.h +++ b/include/wantupd.h @@ -32,54 +32,10 @@ * Doug Hay, 1991 */ -/* - * In the "hours" file, - * - * update_policy: N - * 0 - normal policy, update each time. - * 1 - update at times specified by keyword "update_times". - * 2 - blitz updates - * 3 - no regular updates. (Only demand ones.) - * default: 0. - * - * update_times: 1:00 3:00 8:00 - * Sets the times when updates occur under policy #1. - * NOTE that the schedual times should coincide. - * - * update_timeslop: N - * The number of minutes that the update check is allowed to slip - * to match one of the update times shown. - * default 5. - * - * update_wantmin: N - * 0 - disabled, no requests. - * >0 - minimum number of requests before an update. - * Setting it to more than num of coun will max at num of coun. - * defaults to MAXNOC. - * - * update_abswantmin: N - * N - absolute minimum number of requests for an update. - * Prevents quick breaks and updates. - * defaults to 1. - * - * update_demandtimes: 1:00-3:00 5:00-6:00 - * Time intervals when update requests are allowed. - * NOTE that time ranges CANNOT cross midnight. - * They must go like: 20:00-24:00 0:00-3:00 - * - * update_demandpolicy: N - * 0 - demand updates occur only emp_tm checks. - * 1 - demand updates occur right after setting command. - * 2 - demand updates disabled. - * defaults to 0. - * - * update_demandmaxperday: N - * Not implemented yet. - */ - #ifndef WANTUPD_H #define WANTUPD_H +/* Update policies */ #define UDP_NORMAL 0 #define UDP_TIMES 1 #define UDP_NOREG 3 @@ -87,10 +43,11 @@ #define UDP_MAX 3 #define UDP_DEFAULT UDP_NORMAL +/* Demand update policies */ #define UDDEM_TMCHECK 0 #define UDDEM_COMSET 1 #define UDDEM_DISABLE 2 #define UDDEM_MAX 2 -#define UDDEM_DEFAULT UDDEM_TMCHECK +#define UDDEM_DEFAULT UDDEM_DISABLE #endif diff --git a/src/lib/global/constants.c b/src/lib/global/constants.c index fe8d61d1d..c66ca23d1 100644 --- a/src/lib/global/constants.c +++ b/src/lib/global/constants.c @@ -35,7 +35,7 @@ #include -#include "misc.h" +#include "wantupd.h" char *privname = "Deity forgot to edit econfig"; /* name of priv user */ char *privlog = "careless@invalid"; /* logname of priv user */ @@ -48,18 +48,18 @@ int MARK_DELAY = 7200; /* Seconds to bid on commodities */ int TRADE_DELAY = 7200; /* Seconds to bid on units */ int m_m_p_d = 1440; /* max mins of play per day (per country) */ -int s_p_etu = 10; /* seconds per Empire time unit */ +int s_p_etu = 10; /* seconds per Empire Time Unit */ int etu_per_update = 60; /* # of etu's per update */ -int adj_update = 0; /* update time adjustment */ -int update_window = 0; /* update window adjustment */ -int hourslop = 5; /* amount of slop to match update times */ -char *update_times = ""; /* times regular update is allowed */ -int update_policy = 0; /* update policy for regular updates */ -int update_demandpolicy = 2; /* update policy for demand updates */ +int adj_update = 0; /* update time adjustment, in seconds */ +int update_window = 0; /* update window adjustment, in seconds */ +int hourslop = 5; /* update_times matching fuzz, in minutes */ +char *update_times = ""; /* update times for policy UDP_TIMES */ +int update_policy = UDP_DEFAULT; /* update policy for regular updates */ +int update_demandpolicy = UDDEM_DEFAULT; /* update policy for demand updates */ int update_missed = 999; /* demand updates missed before veto */ -int update_wantmin = 0; /* number of votes required for demand update */ +int update_wantmin = 0; /* votes required for demand update */ int blitz_time = 10; /* number of minutes between blitz updates */ -char *update_demandtimes = ""; /* times demand update is allowed */ +char *update_demandtimes = ""; /* demand update time ranges */ char *game_days = ""; /* days game is running */ char *game_hours = ""; /* hours game is running */ char *pre_update_hook = ""; -- 2.43.0