From 9ced62e239c6ff424659cc1151632766d366da20 Mon Sep 17 00:00:00 2001 From: truelight Date: Mon, 13 Dec 2004 17:47:21 +0000 Subject: (svn r1059) -Fix: [Console] Renamed 'set port' to 'set server_port' -Add: [Network] Add ip-bind ('set server_bind_ip ' in console or use scripts/pre_dedicated.scr) --- console_cmds.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'console_cmds.c') diff --git a/console_cmds.c b/console_cmds.c index d344d8e95..f9b8d7271 100644 --- a/console_cmds.c +++ b/console_cmds.c @@ -657,8 +657,8 @@ DEF_CONSOLE_CMD(ConSet) { return NULL; } - // setting the server name - if (strcmp(argv[1],"port") == 0) { + // setting the server port + if (strcmp(argv[1],"server_port") == 0) { if (argc == 3 && atoi(argv[2]) != 0) { _network_server_port = atoi(argv[2]); IConsolePrintF(_iconsole_color_warning, "Server-port changed to '%d'", _network_server_port); @@ -670,7 +670,22 @@ DEF_CONSOLE_CMD(ConSet) { return NULL; } -#endif + // setting the server ip + if (strcmp(argv[1],"server_bind_ip") == 0 || strcmp(argv[1],"server_ip_bind") == 0 || + strcmp(argv[1],"server_ip") == 0 || strcmp(argv[1],"server_bind") == 0) { + if (argc == 3) { + _network_server_bind_ip = inet_addr(argv[2]); + snprintf(_network_server_bind_ip_host, sizeof(_network_server_bind_ip_host), "%s", inet_ntoa(*(struct in_addr *)&_network_server_bind_ip)); + IConsolePrintF(_iconsole_color_warning, "Server-bind-ip changed to '%s'", _network_server_bind_ip_host); + IConsolePrintF(_iconsole_color_warning, "Changes will take effect the next time you start a server."); + } else { + IConsolePrintF(_iconsole_color_default, "Current server-bind-ip is '%s'", _network_server_bind_ip_host); + IConsolePrint(_iconsole_color_warning, "Usage: set server_bind_ip ."); + } + return NULL; + } + +#endif /* ENABLE_NETWORK */ // Patch-options if (strcmp(argv[1],"patch") == 0) { @@ -688,7 +703,17 @@ DEF_CONSOLE_CMD(ConSet) { } - IConsolePrintF(_iconsole_color_error,"Unknown setting"); + 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, " - 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 "); +#endif /* ENABLE_NETWORK */ + IConsolePrint(_iconsole_color_error, " - patch []"); return NULL; } -- cgit v1.2.3-54-g00ecf