summaryrefslogtreecommitdiff
path: root/console_cmds.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-23 17:37:26 +0000
committertruelight <truelight@openttd.org>2004-12-23 17:37:26 +0000
commitc9645885d085706aab46c593fab1fd2c1d560c17 (patch)
tree58714b88a827433fe0f108fda19afc593185fdea /console_cmds.c
parent3672ae111857e7dffff55737a50d06f5d44114a5 (diff)
downloadopenttd-c9645885d085706aab46c593fab1fd2c1d560c17.tar.xz
(svn r1252) -Add: [Network] With 'set restart_game_date' you can set the date for in
which year the server must restart hisself. (0 = disabled, default value)
Diffstat (limited to 'console_cmds.c')
-rw-r--r--console_cmds.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/console_cmds.c b/console_cmds.c
index 36be8248f..b929cf013 100644
--- a/console_cmds.c
+++ b/console_cmds.c
@@ -837,6 +837,23 @@ DEF_CONSOLE_CMD(ConSet) {
return NULL;
}
+ // setting the server auto restart date
+ if (strcmp(argv[1],"restart_game_date") == 0) {
+ if (!_network_server) {
+ IConsolePrintF(_iconsole_color_error, "You are not the server");
+ return NULL;
+ }
+ if (argc == 3) {
+ _network_restart_game_date = atoi(argv[2]);
+ IConsolePrintF(_iconsole_color_warning, "Restart Game Date changed to '%d'", _network_restart_game_date);
+ } else {
+ IConsolePrintF(_iconsole_color_default, "Current Restart Game Date is '%d'", _network_restart_game_date);
+ IConsolePrint(_iconsole_color_warning, "Usage: set restart_game_date <year>. '0' means disabled.");
+ IConsolePrint(_iconsole_color_warning, " Auto-restart the server when 1 jan of this year is reached (e.g.: 2030).");
+ }
+ return NULL;
+ }
+
#endif /* ENABLE_NETWORK */
// Patch-options
@@ -868,6 +885,7 @@ DEF_CONSOLE_CMD(ConSet) {
IConsolePrint(_iconsole_color_error, " - server_bind_ip <ip>");
IConsolePrint(_iconsole_color_error, " - server_port <port>");
IConsolePrint(_iconsole_color_error, " - server_pw \"<password>\"");
+ IConsolePrint(_iconsole_color_error, " - restart_game_date \"<year>\"");
#endif /* ENABLE_NETWORK */
IConsolePrint(_iconsole_color_error, " - patch <patch_name> [<value>]");