261 // Returns true if the message was successfully sent. |
261 // Returns true if the message was successfully sent. |
262 // |
262 // |
263 METHOD |
263 METHOD |
264 RCONSession::send_command (const String& message) -> bool |
264 RCONSession::send_command (const String& message) -> bool |
265 { |
265 { |
266 if (m_state != RCON_CONNECTED) |
266 if (m_state != RCON_CONNECTED or message.is_empty()) |
267 return false; |
267 return false; |
268 |
268 |
269 Bytestream packet; |
269 Bytestream packet; |
270 packet.write_byte (CLRC_COMMAND); |
270 packet.write_byte (CLRC_COMMAND); |
271 packet.write_string (message); |
271 packet.write_string (message); |