Removed the hardcoded /watch from RCONSession::send_command since it already exists in Interface::handle_command protocol5

Wed, 20 Jul 2016 13:29:03 +0300

author
Teemu Piippo <teemu@compsta2.com>
date
Wed, 20 Jul 2016 13:29:03 +0300
branch
protocol5
changeset 136
8fb1c657e0b0
parent 135
966c09c34ae1
child 141
d9073c13dc98

Removed the hardcoded /watch from RCONSession::send_command since it already exists in Interface::handle_command

sources/interface.cpp file | annotate | diff | comparison | revisions
sources/network/rconsession.cpp file | annotate | diff | comparison | revisions
--- a/sources/interface.cpp	Wed Jul 20 13:25:54 2016 +0300
+++ b/sources/interface.cpp	Wed Jul 20 13:29:03 2016 +0300
@@ -1106,7 +1106,7 @@
 			print_error("No CVars to watch.\n");
 	}
 	else
-		print_error("Unknown command %s\n", command.chars());
+		print_error("Unknown command: %s\n", command.chars());
 }
 
 // -------------------------------------------------------------------------------------------------
--- a/sources/network/rconsession.cpp	Wed Jul 20 13:25:54 2016 +0300
+++ b/sources/network/rconsession.cpp	Wed Jul 20 13:29:03 2016 +0300
@@ -370,18 +370,8 @@
 		return false;
 
 	Bytestream packet;
-
-	// Let's hardcode a /watch for CVar watching testing purposes
-	if (message.starts_with ("/watch "))
-	{
-		request_watch(message.mid(String("/watch ").length(), -1).split(','));
-	}
-	else
-	{
-		packet.write_byte (CLRC_COMMAND);
-		packet.write_string (message);
-	}
-
+	packet.write_byte (CLRC_COMMAND);
+	packet.write_string (message);
 	send (packet);
 	bump_last_ping();
 	return true;

mercurial