mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Allow antibot to kick people
This commit is contained in:
parent
4d00e8c0e3
commit
a5b72fef42
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue