Don't check for ban if client is a loopback address

This commit is contained in:
Kawe Mazidjatari 2023-04-30 11:31:05 +02:00
parent 17c8a5e49c
commit 90cf742fb5
2 changed files with 8 additions and 2 deletions

View File

@ -141,8 +141,11 @@ CClient* CServer::ConnectClient(CServer* pServer, user_creds_s* pChallenge)
if (pClient && sv_globalBanlist->GetBool())
{
std::thread th(SV_IsClientBanned, pClient, string(pszAddresBuffer), nNucleusID, string(pszPersonaName), nPort);
th.detach();
if (!pClient->GetNetChan()->GetRemoteAddress().IsLoopback())
{
std::thread th(SV_IsClientBanned, pClient, string(pszAddresBuffer), nNucleusID, string(pszPersonaName), nPort);
th.detach();
}
}
return pClient;

View File

@ -89,6 +89,9 @@ void SV_CheckForBan(const BannedVec_t* pBannedVec /*= nullptr*/)
if (!pClient->IsConnected())
continue;
if (pNetChan->GetRemoteAddress().IsLoopback())
continue;
const char* szIPAddr = pNetChan->GetAddress(true);
const uint64_t nNucleusID = pClient->GetNucleusID();