Index: common/game.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/game.c,v retrieving revision 1.104 diff -u -r1.104 game.c --- common/game.c 2001/08/30 13:00:14 1.104 +++ common/game.c 2001/08/31 18:34:25 @@ -676,6 +676,7 @@ game.gold = GAME_DEFAULT_GOLD; game.tech = GAME_DEFAULT_TECHLEVEL; game.skill_level = GAME_DEFAULT_SKILL_LEVEL; + game.mintimeout = GAME_MIN_TIMEOUT; game.timeout = GAME_DEFAULT_TIMEOUT; game.tcptimeout = GAME_DEFAULT_TCPTIMEOUT; game.netwait = GAME_DEFAULT_NETWAIT; Index: common/game.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/game.h,v retrieving revision 1.83 diff -u -r1.83 game.h --- common/game.h 2001/08/30 13:00:14 1.83 +++ common/game.h 2001/08/31 18:34:25 @@ -59,6 +59,7 @@ int dispersion; int tech; int skill_level; + int mintimeout; int timeout; int tcptimeout; int netwait; Index: server/stdinhand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v retrieving revision 1.188 diff -u -r1.188 stdinhand.c --- server/stdinhand.c 2001/08/27 06:41:21 1.188 +++ server/stdinhand.c 2001/08/31 18:34:25 @@ -661,6 +661,12 @@ GAME_MIN_END_YEAR, GAME_MAX_END_YEAR, GAME_DEFAULT_END_YEAR, N_("Year the game ends"), "" }, + { "mintimeout", &game.mintimeout, NULL, NULL, + SSET_META, SSET_SERVER_ONLY, + GAME_MIN_TIMEOUT, GAME_MAX_TIMEOUT, GAME_DEFAULT_TIMEOUT, + N_("Minumum timeout"), + N_("The Minumum that the timeout can be set.") }, + { "timeout", &game.timeout, NULL, NULL, SSET_META, SSET_TO_CLIENT, GAME_MIN_TIMEOUT, GAME_MAX_TIMEOUT, GAME_DEFAULT_TIMEOUT, @@ -2588,7 +2594,10 @@ if (!val && arg[0] != '0') { cmd_reply(CMD_SET, caller, C_SYNTAX, _("Value must be an integer.")); - } else if (val >= op->min_value && val <= op->max_value) { + } else if ((val >= op->min_value && val <= op->max_value && strcmp(op->name,"timeout") != 0) || + ((val == 0 || val >= game.mintimeout) && val <=op->max_value)) { + /* hack to allow 0 to be used as 'none' and to use game.mintimeout + a more general mechanism should be introduced for this - rp and pdz */ char *reject_message = NULL; if (!settings[cmd].func_change || settings[cmd].func_change(val, &reject_message)) { *(op->value) = val; @@ -2611,9 +2620,15 @@ op->min_value, op->max_value); } } else { /* not in valid range */ + int min; + if ( strcmp(op->name,"timeout") != 0 ) { /* continuation of above timeout hack - pdz */ + min = op->min_value; + } else { + min = game.mintimeout; + } cmd_reply(CMD_SET, caller, C_SYNTAX, _("Value out of range (minimum: %d, maximum: %d)."), - op->min_value, op->max_value); + min, op->max_value); } } else { if (strlen(arg)sz_svalue) {