Allow antibot to kick people

This commit is contained in:
heinrich5991 2023-11-19 14:59:14 +01:00
parent 4d00e8c0e3
commit a5b72fef42
3 changed files with 9 additions and 1 deletions

View file

@ -6,7 +6,7 @@
enum
{
ANTIBOT_ABI_VERSION = 8,
ANTIBOT_ABI_VERSION = 9,
ANTIBOT_MSGFLAG_NONVITAL = 1,
ANTIBOT_MSGFLAG_FLUSH = 2,
@ -88,6 +88,7 @@ struct CAntibotData
int64_t m_Now;
int64_t m_Freq;
void (*m_pfnKick)(int ClientID, const char *pMessage, void *pUser);
void (*m_pfnLog)(const char *pMessage, void *pUser);
void (*m_pfnReport)(int ClientID, const char *pMessage, void *pUser);
void (*m_pfnSend)(int ClientID, const void *pData, int DataSize, int Flags, void *pUser);

View file

@ -23,6 +23,11 @@ CAntibot::~CAntibot()
if(m_Initialized)
AntibotDestroy();
}
void CAntibot::Kick(int ClientID, const char *pMessage, void *pUser)
{
CAntibot *pAntibot = (CAntibot *)pUser;
pAntibot->Server()->Kick(ClientID, pMessage);
}
void CAntibot::Log(const char *pMessage, void *pUser)
{
CAntibot *pAntibot = (CAntibot *)pUser;
@ -67,6 +72,7 @@ void CAntibot::Init()
m_Data.m_Now = time_get();
m_Data.m_Freq = time_freq();
m_Data.m_pfnKick = Kick;
m_Data.m_pfnLog = Log;
m_Data.m_pfnReport = Report;
m_Data.m_pfnSend = Send;

View file

@ -19,6 +19,7 @@ class CAntibot : public IEngineAntibot
bool m_Initialized;
void Update();
static void Kick(int ClientID, const char *pMessage, void *pUser);
static void Log(const char *pMessage, void *pUser);
static void Report(int ClientID, const char *pMessage, void *pUser);
static void Send(int ClientID, const void *pData, int Size, int Flags, void *pUser);