From 5e28fb8f97f7f57be4f62676fd96bd7b97103419 Mon Sep 17 00:00:00 2001 From: truelight Date: Thu, 16 Dec 2004 13:59:23 +0000 Subject: (svn r1131) -Add: [Network] Autoclean_companies (set it with 'set autoclean_companies on/off'). When enabled, empty companies (companies with no active clients) with no password are declared bankrupt after 1 year of emptyness. For empty companies with password, the password is removed after 3 years of emptyness. The delay of removing company/password can be configured via: - 'set autoclean_protected ' - 'set autoclean_unprotected ' --- console_cmds.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 4 deletions(-) (limited to 'console_cmds.c') diff --git a/console_cmds.c b/console_cmds.c index 3c2a8e0c9..9724c2f63 100644 --- a/console_cmds.c +++ b/console_cmds.c @@ -790,6 +790,57 @@ DEF_CONSOLE_CMD(ConSet) { return NULL; } + // setting the server autoclean on/off + if (strcmp(argv[1],"autoclean_companies") == 0) { + if (!_network_server) { + IConsolePrintF(_iconsole_color_error, "You are not the server"); + return NULL; + } + if (argc == 3) { + if (strcmp(argv[2], "on") == 0 || atoi(argv[2]) == 1) + _network_autoclean_companies = true; + else + _network_autoclean_companies = false; + IConsolePrintF(_iconsole_color_warning, "Autoclean-companies changed to '%s'", (_network_autoclean_companies)?"on":"off"); + } else { + IConsolePrintF(_iconsole_color_default, "Current autoclean-companies is '%s'", (_network_autoclean_companies)?"on":"off"); + IConsolePrint(_iconsole_color_warning, "Usage: set autoclean_companies on/off."); + } + return NULL; + } + + // setting the server autoclean protected + if (strcmp(argv[1],"autoclean_protected") == 0) { + if (!_network_server) { + IConsolePrintF(_iconsole_color_error, "You are not the server"); + return NULL; + } + if (argc == 3) { + _network_autoclean_protected = atoi(argv[2]); + IConsolePrintF(_iconsole_color_warning, "Autoclean-protected changed to '%d'", _network_autoclean_protected); + } else { + IConsolePrintF(_iconsole_color_default, "Current autoclean-protected is '%d'", _network_autoclean_protected); + IConsolePrint(_iconsole_color_warning, "Usage: set autoclean_protected ."); + } + return NULL; + } + + // setting the server autoclean protected + if (strcmp(argv[1],"autoclean_unprotected") == 0) { + if (!_network_server) { + IConsolePrintF(_iconsole_color_error, "You are not the server"); + return NULL; + } + if (argc == 3) { + _network_autoclean_unprotected = atoi(argv[2]); + IConsolePrintF(_iconsole_color_warning, "Autoclean-unprotected changed to '%d'", _network_autoclean_unprotected); + } else { + IConsolePrintF(_iconsole_color_default, "Current autoclean-unprotected is '%d'", _network_autoclean_unprotected); + IConsolePrint(_iconsole_color_warning, "Usage: set autoclean_unprotected ."); + } + return NULL; + } + #endif /* ENABLE_NETWORK */ // Patch-options @@ -811,13 +862,16 @@ DEF_CONSOLE_CMD(ConSet) { IConsolePrint(_iconsole_color_error, "Unknown setting"); IConsolePrint(_iconsole_color_error, "Known settings are:"); #ifdef ENABLE_NETWORK - IConsolePrint(_iconsole_color_error, " - server_pw \"\""); + IConsolePrint(_iconsole_color_error, " - autoclean_companies on/off"); + IConsolePrint(_iconsole_color_error, " - autoclean_protected "); + IConsolePrint(_iconsole_color_error, " - autoclean_unprotected "); IConsolePrint(_iconsole_color_error, " - company_pw \"\""); IConsolePrint(_iconsole_color_error, " - name \"\""); - IConsolePrint(_iconsole_color_error, " - servername \"\""); - IConsolePrint(_iconsole_color_error, " - server_port "); - IConsolePrint(_iconsole_color_error, " - server_bind_ip "); + IConsolePrint(_iconsole_color_error, " - server_name \"\""); IConsolePrint(_iconsole_color_error, " - server_advertise on/off"); + IConsolePrint(_iconsole_color_error, " - server_bind_ip "); + IConsolePrint(_iconsole_color_error, " - server_port "); + IConsolePrint(_iconsole_color_error, " - server_pw \"\""); #endif /* ENABLE_NETWORK */ IConsolePrint(_iconsole_color_error, " - patch []"); -- cgit v1.2.3-54-g00ecf