sources/network/rconsession.cpp

changeset 17
50341dec533e
parent 15
33da84af4bba
child 21
12e4ff8bb471
--- a/sources/network/rconsession.cpp	Sun Dec 14 18:15:28 2014 +0200
+++ b/sources/network/rconsession.cpp	Sun Dec 14 19:38:47 2014 +0200
@@ -258,3 +258,20 @@
 {
 	return g_rconSession;
 }
+
+// -------------------------------------------------------------------------------------------------
+// Returns true if the message was successfully sent.
+//
+METHOD
+RCONSession::send_command (const String& message) -> bool
+{
+	if (m_state != RCON_CONNECTED)
+		return false;
+
+	Bytestream packet;
+	packet.write_byte (CLRC_COMMAND);
+	packet.write_string (message);
+	send (packet);
+	bump_last_ping();
+	return true;
+}

mercurial