summaryrefslogtreecommitdiffstats
path: root/src/RCONServer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/RCONServer.cpp')
-rw-r--r--src/RCONServer.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/RCONServer.cpp b/src/RCONServer.cpp
index d7083ff2b..141c67d1b 100644
--- a/src/RCONServer.cpp
+++ b/src/RCONServer.cpp
@@ -38,7 +38,7 @@ enum
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
// cRCONCommandOutput:
class cRCONCommandOutput :
@@ -59,7 +59,7 @@ public:
virtual void Finished(void) override
{
- m_Connection.SendResponse(m_RequestID, RCON_PACKET_RESPONSE, m_Buffer.size(), m_Buffer.c_str());
+ m_Connection.SendResponse(m_RequestID, RCON_PACKET_RESPONSE, (int)m_Buffer.size(), m_Buffer.c_str());
delete this;
}
@@ -73,13 +73,13 @@ protected:
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
// cRCONServer:
cRCONServer::cRCONServer(cServer & a_Server) :
m_Server(a_Server),
- m_ListenThread4(*this, cSocket::IPv4, "RCON IPv4"),
- m_ListenThread6(*this, cSocket::IPv6, "RCON IPv6")
+ m_ListenThread4(*this, cSocket::IPv4, "RCON"),
+ m_ListenThread6(*this, cSocket::IPv6, "RCON")
{
}
@@ -154,7 +154,7 @@ void cRCONServer::OnConnectionAccepted(cSocket & a_Socket)
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
// cRCONServer::cConnection:
cRCONServer::cConnection::cConnection(cRCONServer & a_RCONServer, cSocket & a_Socket) :
@@ -169,7 +169,7 @@ cRCONServer::cConnection::cConnection(cRCONServer & a_RCONServer, cSocket & a_So
-void cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size)
+bool cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size)
{
// Append data to the buffer:
m_Buffer.append(a_Data, a_Size);
@@ -187,12 +187,12 @@ void cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size)
m_RCONServer.m_SocketThreads.RemoveClient(this);
m_Socket.CloseSocket();
delete this;
- return;
+ return false;
}
if (Length > (int)(m_Buffer.size() + 4))
{
// Incomplete packet yet, wait for more data to come
- return;
+ return false;
}
int RequestID = IntFromBuffer(m_Buffer.data() + 4);
@@ -202,10 +202,11 @@ void cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size)
m_RCONServer.m_SocketThreads.RemoveClient(this);
m_Socket.CloseSocket();
delete this;
- return;
+ return false;
}
m_Buffer.erase(0, Length + 4);
} // while (m_Buffer.size() >= 14)
+ return false;
}