sources/network/rconsession.cpp

changeset 158
de7574d292ad
parent 157
42bb29924218
child 159
970d58a01e8b
child 163
5948441a1951
equal deleted inserted replaced
157:42bb29924218 158:de7574d292ad
77 m_state = RCON_DISCONNECTED; 77 m_state = RCON_DISCONNECTED;
78 } 78 }
79 79
80 // ------------------------------------------------------------------------------------------------- 80 // -------------------------------------------------------------------------------------------------
81 // 81 //
82 void RCONSession::send(const Vector<unsigned char>& packet) 82 void RCONSession::send(const ByteArray& packet)
83 { 83 {
84 m_socket.send(m_address, packet); 84 m_socket.send(m_address, packet);
85 } 85 }
86 86
87 // ------------------------------------------------------------------------------------------------- 87 // -------------------------------------------------------------------------------------------------
281 // ------------------------------------------------------------------------------------------------- 281 // -------------------------------------------------------------------------------------------------
282 // 282 //
283 void RCONSession::sendPassword() 283 void RCONSession::sendPassword()
284 { 284 {
285 m_interface->print("Authenticating...\n"); 285 m_interface->print("Authenticating...\n");
286 Vector<unsigned char> message; 286 ByteArray message;
287 Bytestream stream(message); 287 Bytestream stream(message);
288 stream.writeByte(CLRC_PASSWORD); 288 stream.writeByte(CLRC_PASSWORD);
289 stream.writeString((m_salt + m_password).md5()); 289 stream.writeString((m_salt + m_password).md5());
290 send(message); 290 send(message);
291 bumpLastPing(); 291 bumpLastPing();
320 bool RCONSession::sendCommand(const String& commandString) 320 bool RCONSession::sendCommand(const String& commandString)
321 { 321 {
322 if (m_state != RCON_CONNECTED or commandString.isEmpty()) 322 if (m_state != RCON_CONNECTED or commandString.isEmpty())
323 return false; 323 return false;
324 324
325 Vector<unsigned char> message; 325 ByteArray message;
326 Bytestream stream(message); 326 Bytestream stream(message);
327 stream.writeByte(CLRC_COMMAND); 327 stream.writeByte(CLRC_COMMAND);
328 stream.writeString(commandString); 328 stream.writeString(commandString);
329 send(message); 329 send(message);
330 bumpLastPing(); 330 bumpLastPing();
363 // 363 //
364 void RCONSession::requestTabCompletion(const String& part) 364 void RCONSession::requestTabCompletion(const String& part)
365 { 365 {
366 if (m_serverProtocol >= 4) 366 if (m_serverProtocol >= 4)
367 { 367 {
368 Vector<unsigned char> message; 368 ByteArray message;
369 Bytestream stream(message); 369 Bytestream stream(message);
370 stream.writeByte(CLRC_TABCOMPLETE); 370 stream.writeByte(CLRC_TABCOMPLETE);
371 stream.writeString(part); 371 stream.writeString(part);
372 send(message); 372 send(message);
373 bumpLastPing(); 373 bumpLastPing();

mercurial