console_cmds.c
changeset 785 bba7b3b35dec
parent 784 a490f92a33c2
child 841 4874b9ce2765
equal deleted inserted replaced
784:a490f92a33c2 785:bba7b3b35dec
   835 			IConsolePrint(_iconsole_color_warning, "Usage: set autoclean_unprotected <months>.");
   835 			IConsolePrint(_iconsole_color_warning, "Usage: set autoclean_unprotected <months>.");
   836 		}
   836 		}
   837 		return NULL;
   837 		return NULL;
   838 	}
   838 	}
   839 
   839 
       
   840 	// setting the server auto restart date
       
   841 	if (strcmp(argv[1],"restart_game_date") == 0) {
       
   842 		if (!_network_server) {
       
   843 			IConsolePrintF(_iconsole_color_error, "You are not the server");
       
   844 			return NULL;
       
   845 		}
       
   846 		if (argc == 3) {
       
   847 			_network_restart_game_date = atoi(argv[2]);
       
   848 			IConsolePrintF(_iconsole_color_warning, "Restart Game Date changed to '%d'", _network_restart_game_date);
       
   849 		} else {
       
   850 			IConsolePrintF(_iconsole_color_default, "Current Restart Game Date is '%d'", _network_restart_game_date);
       
   851 			IConsolePrint(_iconsole_color_warning, "Usage: set restart_game_date <year>. '0' means disabled.");
       
   852 			IConsolePrint(_iconsole_color_warning, " Auto-restart the server when 1 jan of this year is reached (e.g.: 2030).");
       
   853 		}
       
   854 		return NULL;
       
   855 	}
       
   856 
   840 #endif /* ENABLE_NETWORK */
   857 #endif /* ENABLE_NETWORK */
   841 
   858 
   842 	// Patch-options
   859 	// Patch-options
   843 	if (strcmp(argv[1],"patch") == 0) {
   860 	if (strcmp(argv[1],"patch") == 0) {
   844 		if (_networking && !_network_server) {
   861 		if (_networking && !_network_server) {
   866 	IConsolePrint(_iconsole_color_error, " - server_name \"<name>\"");
   883 	IConsolePrint(_iconsole_color_error, " - server_name \"<name>\"");
   867 	IConsolePrint(_iconsole_color_error, " - server_advertise on/off");
   884 	IConsolePrint(_iconsole_color_error, " - server_advertise on/off");
   868 	IConsolePrint(_iconsole_color_error, " - server_bind_ip <ip>");
   885 	IConsolePrint(_iconsole_color_error, " - server_bind_ip <ip>");
   869 	IConsolePrint(_iconsole_color_error, " - server_port <port>");
   886 	IConsolePrint(_iconsole_color_error, " - server_port <port>");
   870 	IConsolePrint(_iconsole_color_error, " - server_pw \"<password>\"");
   887 	IConsolePrint(_iconsole_color_error, " - server_pw \"<password>\"");
       
   888 	IConsolePrint(_iconsole_color_error, " - restart_game_date \"<year>\"");
   871 #endif /* ENABLE_NETWORK */
   889 #endif /* ENABLE_NETWORK */
   872 	IConsolePrint(_iconsole_color_error, " - patch <patch_name> [<value>]");
   890 	IConsolePrint(_iconsole_color_error, " - patch <patch_name> [<value>]");
   873 
   891 
   874 	return NULL;
   892 	return NULL;
   875 }
   893 }