2022-05-20 11:52:19 +02:00
|
|
|
#include "core/stdafx.h"
|
2022-08-27 23:45:58 +02:00
|
|
|
#include "tier0/threadtools.h"
|
|
|
|
#include "tier0/frametask.h"
|
2022-05-20 11:52:19 +02:00
|
|
|
#include "engine/server/sv_main.h"
|
2022-07-01 10:29:27 +02:00
|
|
|
#include "networksystem/pylon.h"
|
2022-08-09 17:34:10 +02:00
|
|
|
#include "networksystem/bansystem.h"
|
2022-05-20 11:52:19 +02:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: checks if particular client is banned on the comp server
|
|
|
|
//-----------------------------------------------------------------------------
|
2022-08-30 12:07:09 +02:00
|
|
|
void SV_IsClientBanned(const string& svIPAddr, const uint64_t nNucleusID)
|
2022-05-20 11:52:19 +02:00
|
|
|
{
|
2022-08-27 23:45:58 +02:00
|
|
|
string svError;
|
2022-06-14 20:56:55 +02:00
|
|
|
|
2022-08-30 12:07:09 +02:00
|
|
|
bool bCompBanned = g_pMasterServer->CheckForBan(svIPAddr, nNucleusID, svError);
|
2022-05-20 11:52:19 +02:00
|
|
|
if (bCompBanned)
|
|
|
|
{
|
2022-08-27 23:45:58 +02:00
|
|
|
if (!ThreadInMainThread())
|
|
|
|
{
|
|
|
|
g_TaskScheduler->Dispatch([svError, nNucleusID]
|
|
|
|
{
|
|
|
|
g_pBanSystem->AddConnectionRefuse(svError, nNucleusID); // Add to the vector.
|
|
|
|
}, 0);
|
|
|
|
}
|
2022-08-30 12:07:09 +02:00
|
|
|
Warning(eDLL_T::SERVER, "Added '%s' to refused list ('%llu' is banned from the master server!)\n", svIPAddr.c_str(), nNucleusID);
|
2022-05-20 11:52:19 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|