Engine: improve naming convention for RCON

Make it more consistent with the rest of the SDK. Nothing logic wise has been changed in this patch.
This commit is contained in:
Kawe Mazidjatari 2024-06-17 15:24:08 +02:00
parent e34d4b9456
commit 358a2c4bf0
6 changed files with 28 additions and 28 deletions

View File

@ -109,7 +109,7 @@ bool CRConClient::ProcessMessage(const char* pMsgBuf, const int nMsgLen)
{ {
netcon::response response; netcon::response response;
if (!SH_NetConUnpackEnvelope(this, pMsgBuf, nMsgLen, &response, rcon_debug.GetBool())) if (!NetconShared_UnpackEnvelope(this, pMsgBuf, nMsgLen, &response, rcon_debug.GetBool()))
{ {
Disconnect("received invalid message"); Disconnect("received invalid message");
return false; return false;
@ -184,7 +184,7 @@ void CRConClient::RequestConsoleLog(const bool bWantLog)
bool CRConClient::Serialize(vector<char>& vecBuf, const char* szReqBuf, bool CRConClient::Serialize(vector<char>& vecBuf, const char* szReqBuf,
const char* szReqVal, const netcon::request_e requestType) const const char* szReqVal, const netcon::request_e requestType) const
{ {
return CL_NetConSerialize(this, vecBuf, szReqBuf, szReqVal, requestType, return NetconClient_Serialize(this, vecBuf, szReqBuf, szReqVal, requestType,
rcon_encryptframes.GetBool(), rcon_debug.GetBool()); rcon_encryptframes.GetBool(), rcon_debug.GetBool());
} }
@ -194,7 +194,7 @@ bool CRConClient::Serialize(vector<char>& vecBuf, const char* szReqBuf,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
CConnectedNetConsoleData* CRConClient::GetData(void) CConnectedNetConsoleData* CRConClient::GetData(void)
{ {
return SH_GetNetConData(this, 0); return NetconShared_GetConnData(this, 0);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -203,7 +203,7 @@ CConnectedNetConsoleData* CRConClient::GetData(void)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
SocketHandle_t CRConClient::GetSocket(void) SocketHandle_t CRConClient::GetSocket(void)
{ {
return SH_GetNetConSocketHandle(this, 0); return NetconShared_GetSocketHandle(this, 0);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -371,7 +371,7 @@ bool CRConServer::SendEncoded(const SocketHandle_t hSocket, const char* pRespons
bool CRConServer::Serialize(vector<char>& vecBuf, const char* pResponseMsg, const char* pResponseVal, bool CRConServer::Serialize(vector<char>& vecBuf, const char* pResponseMsg, const char* pResponseVal,
const netcon::response_e responseType, const int nMessageId, const int nMessageType) const const netcon::response_e responseType, const int nMessageId, const int nMessageType) const
{ {
return SV_NetConSerialize(this, vecBuf, pResponseMsg, pResponseVal, responseType, nMessageId, nMessageType, return NetconServer_Serialize(this, vecBuf, pResponseMsg, pResponseVal, responseType, nMessageId, nMessageType,
rcon_encryptframes.GetBool(), rcon_debug.GetBool()); rcon_encryptframes.GetBool(), rcon_debug.GetBool());
} }
@ -448,7 +448,7 @@ bool CRConServer::ProcessMessage(const char* pMsgBuf, const int nMsgLen)
{ {
netcon::request request; netcon::request request;
if (!SH_NetConUnpackEnvelope(this, pMsgBuf, nMsgLen, &request, rcon_debug.GetBool())) if (!NetconShared_UnpackEnvelope(this, pMsgBuf, nMsgLen, &request, rcon_debug.GetBool()))
{ {
Disconnect("received invalid message"); Disconnect("received invalid message");
return false; return false;

View File

@ -133,7 +133,7 @@ const char* CNetConBase::GetKey(void) const
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool CNetConBase::Connect(const char* pHostName, const int nPort) bool CNetConBase::Connect(const char* pHostName, const int nPort)
{ {
return CL_NetConConnect(this, pHostName, nPort); return NetconClient_Connect(this, pHostName, nPort);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -21,7 +21,7 @@
// bDebug - // bDebug -
// Output : true on success, false otherwise // Output : true on success, false otherwise
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool SV_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const char* pResponseMsg, const char* pResponseVal, bool NetconServer_Serialize(const CNetConBase* pBase, vector<char>& vecBuf, const char* pResponseMsg, const char* pResponseVal,
const netcon::response_e responseType, const int nMessageId, const int nMessageType, const bool bEncrypt, const bool bDebug) const netcon::response_e responseType, const int nMessageId, const int nMessageType, const bool bEncrypt, const bool bDebug)
{ {
netcon::response response; netcon::response response;
@ -32,7 +32,7 @@ bool SV_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const ch
response.set_responsemsg(pResponseMsg); response.set_responsemsg(pResponseMsg);
response.set_responseval(pResponseVal); response.set_responseval(pResponseVal);
if (!SH_NetConPackEnvelope(pBase, vecBuf, response.ByteSizeLong(), &response, bEncrypt, bDebug)) if (!NetconShared_PackEnvelope(pBase, vecBuf, response.ByteSizeLong(), &response, bEncrypt, bDebug))
{ {
return false; return false;
} }
@ -51,7 +51,7 @@ bool SV_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const ch
// bDebug - // bDebug -
// Output : true on success, false otherwise // Output : true on success, false otherwise
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool CL_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const char* szReqBuf, bool NetconClient_Serialize(const CNetConBase* pBase, vector<char>& vecBuf, const char* szReqBuf,
const char* szReqVal, const netcon::request_e requestType, const bool bEncrypt, const bool bDebug) const char* szReqVal, const netcon::request_e requestType, const bool bEncrypt, const bool bDebug)
{ {
netcon::request request; netcon::request request;
@ -61,7 +61,7 @@ bool CL_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const ch
request.set_requestmsg(szReqBuf); request.set_requestmsg(szReqBuf);
request.set_requestval(szReqVal); request.set_requestval(szReqVal);
if (!SH_NetConPackEnvelope(pBase, vecBuf, request.ByteSizeLong(), &request, bEncrypt, bDebug)) if (!NetconShared_PackEnvelope(pBase, vecBuf, request.ByteSizeLong(), &request, bEncrypt, bDebug))
{ {
return false; return false;
} }
@ -76,7 +76,7 @@ bool CL_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const ch
// nHostPort - // nHostPort -
// Output : true on success, false otherwise // Output : true on success, false otherwise
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool CL_NetConConnect(CNetConBase* pBase, const char* pHostAdr, const int nHostPort) bool NetconClient_Connect(CNetConBase* pBase, const char* pHostAdr, const int nHostPort)
{ {
string svLocalHost; string svLocalHost;
const bool bValidSocket = nHostPort != SOCKET_ERROR; const bool bValidSocket = nHostPort != SOCKET_ERROR;
@ -124,7 +124,7 @@ bool CL_NetConConnect(CNetConBase* pBase, const char* pHostAdr, const int nHostP
// bDebug - // bDebug -
// Output : true on success, false otherwise // Output : true on success, false otherwise
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool SH_NetConPackEnvelope(const CNetConBase* pBase, vector<char>& outMsgBuf, const size_t nMsgLen, bool NetconShared_PackEnvelope(const CNetConBase* pBase, vector<char>& outMsgBuf, const size_t nMsgLen,
google::protobuf::MessageLite* inMsg, const bool bEncrypt, const bool bDebug) google::protobuf::MessageLite* inMsg, const bool bEncrypt, const bool bDebug)
{ {
char* encodeBuf = new char[nMsgLen]; char* encodeBuf = new char[nMsgLen];
@ -194,7 +194,7 @@ bool SH_NetConPackEnvelope(const CNetConBase* pBase, vector<char>& outMsgBuf, co
// bDebug - // bDebug -
// Output : true on success, false otherwise // Output : true on success, false otherwise
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool SH_NetConUnpackEnvelope(const CNetConBase* pBase, const char* pMsgBuf, const size_t nMsgLen, bool NetconShared_UnpackEnvelope(const CNetConBase* pBase, const char* pMsgBuf, const size_t nMsgLen,
google::protobuf::MessageLite* outMsg, const bool bDebug) google::protobuf::MessageLite* outMsg, const bool bDebug)
{ {
netcon::envelope envelope; netcon::envelope envelope;
@ -279,7 +279,7 @@ bool SH_NetConUnpackEnvelope(const CNetConBase* pBase, const char* pMsgBuf, cons
// iSocket - // iSocket -
// Output : nullptr on failure // Output : nullptr on failure
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
CConnectedNetConsoleData* SH_GetNetConData(CNetConBase* pBase, const int iSocket) CConnectedNetConsoleData* NetconShared_GetConnData(CNetConBase* pBase, const int iSocket)
{ {
CSocketCreator* pCreator = pBase->GetSocketCreator(); CSocketCreator* pCreator = pBase->GetSocketCreator();
Assert(iSocket >= 0 && (pCreator->GetAcceptedSocketCount() == 0 Assert(iSocket >= 0 && (pCreator->GetAcceptedSocketCount() == 0
@ -299,9 +299,9 @@ CConnectedNetConsoleData* SH_GetNetConData(CNetConBase* pBase, const int iSocket
// iSocket - // iSocket -
// Output : SOCKET_ERROR (-1) on failure // Output : SOCKET_ERROR (-1) on failure
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
SocketHandle_t SH_GetNetConSocketHandle(CNetConBase* pBase, const int iSocket) SocketHandle_t NetconShared_GetSocketHandle(CNetConBase* pBase, const int iSocket)
{ {
const CConnectedNetConsoleData* pData = SH_GetNetConData(pBase, iSocket); const CConnectedNetConsoleData* pData = NetconShared_GetConnData(pBase, iSocket);
if (!pData) if (!pData)
{ {
return SOCKET_ERROR; return SOCKET_ERROR;

View File

@ -16,17 +16,17 @@ extern void RCON_InitClientAndTrySyncKeys();
#endif // !DEDICATED #endif // !DEDICATED
#endif // _TOOLS #endif // _TOOLS
bool SV_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const char* pResponseMsg, const char* pResponseVal, bool NetconServer_Serialize(const CNetConBase* pBase, vector<char>& vecBuf, const char* pResponseMsg, const char* pResponseVal,
const netcon::response_e responseType, const int nMessageId, const int nMessageType, const bool bEncrypt, const bool bDebug); const netcon::response_e responseType, const int nMessageId, const int nMessageType, const bool bEncrypt, const bool bDebug);
bool CL_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const char* szReqBuf, bool NetconClient_Serialize(const CNetConBase* pBase, vector<char>& vecBuf, const char* szReqBuf,
const char* szReqVal, const netcon::request_e requestType, const bool bEncrypt, const bool bDebug); const char* szReqVal, const netcon::request_e requestType, const bool bEncrypt, const bool bDebug);
bool CL_NetConConnect(CNetConBase* pBase, const char* pHostAdr, const int nHostPort); bool NetconClient_Connect(CNetConBase* pBase, const char* pHostAdr, const int nHostPort);
bool SH_NetConPackEnvelope(const CNetConBase* pBase, vector<char>& outMsgBuf, const size_t nMsgLen, google::protobuf::MessageLite* inMsg, const bool bEncrypt, const bool bDebug); bool NetconShared_PackEnvelope(const CNetConBase* pBase, vector<char>& outMsgBuf, const size_t nMsgLen, google::protobuf::MessageLite* inMsg, const bool bEncrypt, const bool bDebug);
bool SH_NetConUnpackEnvelope(const CNetConBase* pBase, const char* pMsgBuf, const size_t nMsgLen, google::protobuf::MessageLite* outMsg, const bool bDebug); bool NetconShared_UnpackEnvelope(const CNetConBase* pBase, const char* pMsgBuf, const size_t nMsgLen, google::protobuf::MessageLite* outMsg, const bool bDebug);
CConnectedNetConsoleData* SH_GetNetConData(CNetConBase* pBase, const int iSocket); CConnectedNetConsoleData* NetconShared_GetConnData(CNetConBase* pBase, const int iSocket);
SocketHandle_t SH_GetNetConSocketHandle(CNetConBase* pBase, const int iSocket); SocketHandle_t NetconShared_GetSocketHandle(CNetConBase* pBase, const int iSocket);
#endif // SHARED_RCON_H #endif // SHARED_RCON_H

View File

@ -384,7 +384,7 @@ bool CNetCon::Connect(const char* pHostName, const int nPort)
Msg(eDLL_T::CLIENT, "Attempting connection to '%s'\n", pHostName); Msg(eDLL_T::CLIENT, "Attempting connection to '%s'\n", pHostName);
} }
return CL_NetConConnect(this, pHostName, SOCKET_ERROR); return NetconClient_Connect(this, pHostName, SOCKET_ERROR);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -417,7 +417,7 @@ bool CNetCon::ProcessMessage(const char* pMsgBuf, const int nMsgLen)
{ {
netcon::response response; netcon::response response;
if (!SH_NetConUnpackEnvelope(this, pMsgBuf, nMsgLen, &response, true)) if (!NetconShared_UnpackEnvelope(this, pMsgBuf, nMsgLen, &response, true))
{ {
Disconnect("received invalid message"); Disconnect("received invalid message");
return false; return false;
@ -472,7 +472,7 @@ bool CNetCon::ProcessMessage(const char* pMsgBuf, const int nMsgLen)
bool CNetCon::Serialize(vector<char>& vecBuf, const char* szReqBuf, bool CNetCon::Serialize(vector<char>& vecBuf, const char* szReqBuf,
const char* szReqVal, const netcon::request_e requestType) const const char* szReqVal, const netcon::request_e requestType) const
{ {
return CL_NetConSerialize(this, vecBuf, szReqBuf, szReqVal, requestType, m_bEncryptFrames, true); return NetconClient_Serialize(this, vecBuf, szReqBuf, szReqVal, requestType, m_bEncryptFrames, true);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -481,7 +481,7 @@ bool CNetCon::Serialize(vector<char>& vecBuf, const char* szReqBuf,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
SocketHandle_t CNetCon::GetSocket(void) SocketHandle_t CNetCon::GetSocket(void)
{ {
return SH_GetNetConSocketHandle(this, 0); return NetconShared_GetSocketHandle(this, 0);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------