Sends a RCON packet back to the client
| 308 | |
| 309 | /// Sends a RCON packet back to the client |
| 310 | void cRCONServer::cConnection::SendResponse(int a_RequestID, int a_PacketType, int a_PayloadLength, const char * a_Payload) |
| 311 | { |
| 312 | ASSERT((a_PayloadLength == 0) || (a_Payload != NULL)); // Either zero data to send, or a valid payload ptr |
| 313 | |
| 314 | char Buffer[4]; |
| 315 | int Length = a_PayloadLength + 10; |
| 316 | IntToBuffer(Length, Buffer); |
| 317 | m_Outgoing.append(Buffer, 4); |
| 318 | IntToBuffer(a_RequestID, Buffer); |
| 319 | m_Outgoing.append(Buffer, 4); |
| 320 | IntToBuffer(a_PacketType, Buffer); |
| 321 | m_Outgoing.append(Buffer, 4); |
| 322 | if (a_PayloadLength > 0) |
| 323 | { |
| 324 | m_Outgoing.append(a_Payload, a_PayloadLength); |
| 325 | } |
| 326 | m_Outgoing.push_back(0); |
| 327 | m_Outgoing.push_back(0); |
| 328 | m_RCONServer.m_SocketThreads.NotifyWrite(this); |
| 329 | } |
| 330 | |
| 331 | |
| 332 |