mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
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:
parent
e34d4b9456
commit
358a2c4bf0
@ -109,7 +109,7 @@ bool CRConClient::ProcessMessage(const char* pMsgBuf, const int nMsgLen)
|
||||
{
|
||||
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");
|
||||
return false;
|
||||
@ -184,7 +184,7 @@ void CRConClient::RequestConsoleLog(const bool bWantLog)
|
||||
bool CRConClient::Serialize(vector<char>& vecBuf, const char* szReqBuf,
|
||||
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());
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ bool CRConClient::Serialize(vector<char>& vecBuf, const char* szReqBuf,
|
||||
//-----------------------------------------------------------------------------
|
||||
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)
|
||||
{
|
||||
return SH_GetNetConSocketHandle(this, 0);
|
||||
return NetconShared_GetSocketHandle(this, 0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -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,
|
||||
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());
|
||||
}
|
||||
|
||||
@ -448,7 +448,7 @@ bool CRConServer::ProcessMessage(const char* pMsgBuf, const int nMsgLen)
|
||||
{
|
||||
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");
|
||||
return false;
|
||||
|
@ -133,7 +133,7 @@ const char* CNetConBase::GetKey(void) const
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CNetConBase::Connect(const char* pHostName, const int nPort)
|
||||
{
|
||||
return CL_NetConConnect(this, pHostName, nPort);
|
||||
return NetconClient_Connect(this, pHostName, nPort);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -21,7 +21,7 @@
|
||||
// bDebug -
|
||||
// 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)
|
||||
{
|
||||
netcon::response response;
|
||||
@ -32,7 +32,7 @@ bool SV_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const ch
|
||||
response.set_responsemsg(pResponseMsg);
|
||||
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;
|
||||
}
|
||||
@ -51,7 +51,7 @@ bool SV_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const ch
|
||||
// bDebug -
|
||||
// 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)
|
||||
{
|
||||
netcon::request request;
|
||||
@ -61,7 +61,7 @@ bool CL_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const ch
|
||||
request.set_requestmsg(szReqBuf);
|
||||
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;
|
||||
}
|
||||
@ -76,7 +76,7 @@ bool CL_NetConSerialize(const CNetConBase* pBase, vector<char>& vecBuf, const ch
|
||||
// nHostPort -
|
||||
// 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;
|
||||
const bool bValidSocket = nHostPort != SOCKET_ERROR;
|
||||
@ -124,7 +124,7 @@ bool CL_NetConConnect(CNetConBase* pBase, const char* pHostAdr, const int nHostP
|
||||
// bDebug -
|
||||
// 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)
|
||||
{
|
||||
char* encodeBuf = new char[nMsgLen];
|
||||
@ -194,7 +194,7 @@ bool SH_NetConPackEnvelope(const CNetConBase* pBase, vector<char>& outMsgBuf, co
|
||||
// bDebug -
|
||||
// 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)
|
||||
{
|
||||
netcon::envelope envelope;
|
||||
@ -279,7 +279,7 @@ bool SH_NetConUnpackEnvelope(const CNetConBase* pBase, const char* pMsgBuf, cons
|
||||
// iSocket -
|
||||
// Output : nullptr on failure
|
||||
//-----------------------------------------------------------------------------
|
||||
CConnectedNetConsoleData* SH_GetNetConData(CNetConBase* pBase, const int iSocket)
|
||||
CConnectedNetConsoleData* NetconShared_GetConnData(CNetConBase* pBase, const int iSocket)
|
||||
{
|
||||
CSocketCreator* pCreator = pBase->GetSocketCreator();
|
||||
Assert(iSocket >= 0 && (pCreator->GetAcceptedSocketCount() == 0
|
||||
@ -299,9 +299,9 @@ CConnectedNetConsoleData* SH_GetNetConData(CNetConBase* pBase, const int iSocket
|
||||
// iSocket -
|
||||
// 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)
|
||||
{
|
||||
return SOCKET_ERROR;
|
||||
|
@ -16,17 +16,17 @@ extern void RCON_InitClientAndTrySyncKeys();
|
||||
#endif // !DEDICATED
|
||||
#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);
|
||||
|
||||
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);
|
||||
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 SH_NetConUnpackEnvelope(const CNetConBase* pBase, const char* pMsgBuf, const size_t nMsgLen, google::protobuf::MessageLite* outMsg, 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 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);
|
||||
SocketHandle_t SH_GetNetConSocketHandle(CNetConBase* pBase, const int iSocket);
|
||||
CConnectedNetConsoleData* NetconShared_GetConnData(CNetConBase* pBase, const int iSocket);
|
||||
SocketHandle_t NetconShared_GetSocketHandle(CNetConBase* pBase, const int iSocket);
|
||||
|
||||
#endif // SHARED_RCON_H
|
||||
|
@ -384,7 +384,7 @@ bool CNetCon::Connect(const char* pHostName, const int nPort)
|
||||
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;
|
||||
|
||||
if (!SH_NetConUnpackEnvelope(this, pMsgBuf, nMsgLen, &response, true))
|
||||
if (!NetconShared_UnpackEnvelope(this, pMsgBuf, nMsgLen, &response, true))
|
||||
{
|
||||
Disconnect("received invalid message");
|
||||
return false;
|
||||
@ -472,7 +472,7 @@ bool CNetCon::ProcessMessage(const char* pMsgBuf, const int nMsgLen)
|
||||
bool CNetCon::Serialize(vector<char>& vecBuf, const char* szReqBuf,
|
||||
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)
|
||||
{
|
||||
return SH_GetNetConSocketHandle(this, 0);
|
||||
return NetconShared_GetSocketHandle(this, 0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user