diff options
author | truelight <truelight@openttd.org> | 2004-12-13 17:47:21 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2004-12-13 17:47:21 +0000 |
commit | 9ced62e239c6ff424659cc1151632766d366da20 (patch) | |
tree | 01af336ac91325c4ce99a24b1968cfe7078c5e6b /console_cmds.c | |
parent | 382b924b41f1448ef5a843fd6ce07d31415afb99 (diff) | |
download | openttd-9ced62e239c6ff424659cc1151632766d366da20.tar.xz |
(svn r1059) -Fix: [Console] Renamed 'set port' to 'set server_port'
-Add: [Network] Add ip-bind ('set server_bind_ip <ip>' in console or use
scripts/pre_dedicated.scr)
Diffstat (limited to 'console_cmds.c')
-rw-r--r-- | console_cmds.c | 33 |
1 files changed, 29 insertions, 4 deletions
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 <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 \"<password>\""); + IConsolePrint(_iconsole_color_error, " - company_pw \"<password>\""); + IConsolePrint(_iconsole_color_error, " - name \"<playername>\""); + IConsolePrint(_iconsole_color_error, " - servername \"<name>\""); + IConsolePrint(_iconsole_color_error, " - server_port <port>"); + IConsolePrint(_iconsole_color_error, " - server_bind_ip <ip>"); +#endif /* ENABLE_NETWORK */ + IConsolePrint(_iconsole_color_error, " - patch <patch_name> [<value>]"); return NULL; } |