mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Drop a warning when someone fails authentication
This commit is contained in:
parent
ab5c5a39e1
commit
e99e1c40e0
@ -165,21 +165,21 @@ bool CClient::Authenticate(const char* const playerName, char* const reasonBuf,
|
||||
//---------------------------------------------------------------------------------
|
||||
// Purpose: connect new client
|
||||
// Input : *szName -
|
||||
// *pNetChannel -
|
||||
// *pNetChan -
|
||||
// bFakePlayer -
|
||||
// *conVars -
|
||||
// *szMessage -
|
||||
// nMessageSize -
|
||||
// Output : true if connection was successful, false otherwise
|
||||
//---------------------------------------------------------------------------------
|
||||
bool CClient::Connect(const char* szName, void* pNetChannel, bool bFakePlayer,
|
||||
bool CClient::Connect(const char* szName, CNetChan* pNetChan, bool bFakePlayer,
|
||||
CUtlVector<NET_SetConVar::cvar_t>* conVars, char* szMessage, int nMessageSize)
|
||||
{
|
||||
#ifndef CLIENT_DLL
|
||||
g_ServerPlayer[GetUserID()].Reset(); // Reset ServerPlayer slot.
|
||||
#endif
|
||||
|
||||
if (!v_CClient_Connect(this, szName, pNetChannel, bFakePlayer, conVars, szMessage, nMessageSize))
|
||||
if (!v_CClient_Connect(this, szName, pNetChan, bFakePlayer, conVars, szMessage, nMessageSize))
|
||||
return false;
|
||||
|
||||
#ifndef CLIENT_DLL
|
||||
@ -192,6 +192,16 @@ bool CClient::Connect(const char* szName, void* pNetChannel, bool bFakePlayer,
|
||||
if (!Authenticate(szName, authFailReason, sizeof(authFailReason)))
|
||||
{
|
||||
REJECT_CONNECTION("Failed to verify authentication token [%s]", authFailReason);
|
||||
|
||||
const bool bEnableLogging = sv_showconnecting->GetBool();
|
||||
if (bEnableLogging)
|
||||
{
|
||||
const char* const netAdr = pNetChan ? pNetChan->GetAddress() : "<unknown>";
|
||||
|
||||
Warning(eDLL_T::SERVER, "Connection rejected for '%s' ('%llu' failed online authentication!)\n",
|
||||
netAdr, m_nNucleusID);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -206,17 +216,17 @@ bool CClient::Connect(const char* szName, void* pNetChannel, bool bFakePlayer,
|
||||
// Purpose: connect new client
|
||||
// Input : *pClient -
|
||||
// *szName -
|
||||
// *pNetChannel -
|
||||
// *pNetChan -
|
||||
// bFakePlayer -
|
||||
// *a5 -
|
||||
// *szMessage -
|
||||
// nMessageSize -
|
||||
// Output : true if connection was successful, false otherwise
|
||||
//---------------------------------------------------------------------------------
|
||||
bool CClient::VConnect(CClient* pClient, const char* szName, void* pNetChannel, bool bFakePlayer,
|
||||
bool CClient::VConnect(CClient* pClient, const char* szName, CNetChan* pNetChan, bool bFakePlayer,
|
||||
CUtlVector<NET_SetConVar::cvar_t>* conVars, char* szMessage, int nMessageSize)
|
||||
{
|
||||
return pClient->Connect(szName, pNetChannel, bFakePlayer, conVars, szMessage, nMessageSize);;
|
||||
return pClient->Connect(szName, pNetChan, bFakePlayer, conVars, szMessage, nMessageSize);;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
@ -96,14 +96,14 @@ public:
|
||||
bool SendNetMsgEx(CNetMessage* pMsg, char bLocal, bool bForceReliable, bool bVoice);
|
||||
|
||||
bool Authenticate(const char* const playerName, char* const reasonBuf, const size_t reasonBufLen);
|
||||
bool Connect(const char* szName, void* pNetChannel, bool bFakePlayer,
|
||||
bool Connect(const char* szName, CNetChan* pNetChan, bool bFakePlayer,
|
||||
CUtlVector<NET_SetConVar::cvar_t>* conVars, char* szMessage, int nMessageSize);
|
||||
void Disconnect(const Reputation_t nRepLvl, const char* szReason, ...);
|
||||
void Clear(void);
|
||||
|
||||
public: // Hook statics:
|
||||
static void VClear(CClient* pClient);
|
||||
static bool VConnect(CClient* pClient, const char* szName, void* pNetChannel, bool bFakePlayer,
|
||||
static bool VConnect(CClient* pClient, const char* szName, CNetChan* pNetChan, bool bFakePlayer,
|
||||
CUtlVector<NET_SetConVar::cvar_t>* conVars, char* szMessage, int nMessageSize);
|
||||
|
||||
static void VActivatePlayer(CClient* pClient);
|
||||
@ -210,7 +210,7 @@ static_assert(sizeof(CClient) == 0x4A4C0);
|
||||
|
||||
/* ==== CBASECLIENT ===================================================================================================================================================== */
|
||||
inline CMemory p_CClient_Connect;
|
||||
inline bool(*v_CClient_Connect)(CClient* pClient, const char* szName, void* pNetChannel, bool bFakePlayer, CUtlVector<NET_SetConVar::cvar_t>* conVars, char* szMessage, int nMessageSize);
|
||||
inline bool(*v_CClient_Connect)(CClient* pClient, const char* szName, CNetChan* pNetChan, bool bFakePlayer, CUtlVector<NET_SetConVar::cvar_t>* conVars, char* szMessage, int nMessageSize);
|
||||
|
||||
inline CMemory p_CClient_Disconnect;
|
||||
inline bool(*v_CClient_Disconnect)(CClient* pClient, const Reputation_t nRepLvl, const char* szReason, ...);
|
||||
@ -275,7 +275,7 @@ class VClient : public IDetour
|
||||
p_CClient_ProcessSetConVar = g_GameDll.FindPatternSIMD("48 83 EC 28 48 83 C2 20");
|
||||
p_CClient_SetSignonState = g_GameDll.FindPatternSIMD("48 8B C4 48 89 58 10 48 89 70 18 57 48 81 EC ?? ?? ?? ?? 0F 29 70 E8 8B F2");
|
||||
|
||||
v_CClient_Connect = p_CClient_Connect.RCast<bool (*)(CClient*, const char*, void*, bool, CUtlVector<NET_SetConVar::cvar_t>*, char*, int)>();
|
||||
v_CClient_Connect = p_CClient_Connect.RCast<bool (*)(CClient*, const char*, CNetChan*, bool, CUtlVector<NET_SetConVar::cvar_t>*, char*, int)>();
|
||||
v_CClient_Disconnect = p_CClient_Disconnect.RCast<bool (*)(CClient*, const Reputation_t, const char*, ...)>();
|
||||
v_CClient_Clear = p_CClient_Clear.RCast<void (*)(CClient*)>();
|
||||
v_CClient_ActivatePlayer = p_CClient_ActivatePlayer.RCast<void (*)(CClient* pClient)>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user