(svn r1116) -Add: [Console] With 'set server_advertise on/off' you can put server
authortruelight
Wed, 15 Dec 2004 22:06:47 +0000
changeset 678 9c84b180ecd7
parent 677 90346642763a
child 679 e959706a3e4d
(svn r1116) -Add: [Console] With 'set server_advertise on/off' you can put server
advertise on/off via console (requested by imachine)
console_cmds.c
--- a/console_cmds.c	Wed Dec 15 22:05:40 2004 +0000
+++ b/console_cmds.c	Wed Dec 15 22:06:47 2004 +0000
@@ -718,6 +718,21 @@
 		return NULL;
 	}
 
+	// setting the server advertising on/off
+	if (strcmp(argv[1],"server_advertise") == 0) {
+		if (argc == 3) {
+			if (strcmp(argv[2], "on") == 0 || atoi(argv[2]) == 1)
+				_network_advertise = true;
+			else
+				_network_advertise = false;
+			IConsolePrintF(_iconsole_color_warning, "Server-advertise changed to '%s'", (_network_advertise)?"on":"off");
+		} else {
+			IConsolePrintF(_iconsole_color_default, "Current server-advertise is '%s'", (_network_advertise)?"on":"off");
+			IConsolePrint(_iconsole_color_warning, "Usage: set server_advertise on/off.");
+		}
+		return NULL;
+	}
+
 #endif /* ENABLE_NETWORK */
 
 	// Patch-options
@@ -745,6 +760,7 @@
 	IConsolePrint(_iconsole_color_error, " - servername \"<name>\"");
 	IConsolePrint(_iconsole_color_error, " - server_port <port>");
 	IConsolePrint(_iconsole_color_error, " - server_bind_ip <ip>");
+	IConsolePrint(_iconsole_color_error, " - server_advertise on/off");
 #endif /* ENABLE_NETWORK */
 	IConsolePrint(_iconsole_color_error, " - patch <patch_name> [<value>]");