1#ifndef ENGINE_SERVER_ANTIBOT_H
2#define ENGINE_SERVER_ANTIBOT_H
3
4#include <antibot/antibot_data.h>
5#include <engine/antibot.h>
6
7class CAntibot : public IEngineAntibot
8{
9 class IServer *m_pServer;
10 class IConsole *m_pConsole;
11 class IGameServer *m_pGameServer;
12
13 class IServer *Server() const { return m_pServer; }
14 class IConsole *Console() const { return m_pConsole; }
15 class IGameServer *GameServer() const { return m_pGameServer; }
16
17 CAntibotData m_Data;
18 CAntibotRoundData m_RoundData;
19 bool m_Initialized;
20
21 void Update();
22 static void Kick(int ClientId, const char *pMessage, void *pUser);
23 static void Log(const char *pMessage, void *pUser);
24 static void Report(int ClientId, const char *pMessage, void *pUser);
25 static void Send(int ClientId, const void *pData, int Size, int Flags, void *pUser);
26 static void Teehistorian(const void *pData, int Size, void *pUser);
27
28public:
29 CAntibot();
30 virtual ~CAntibot();
31
32 // Engine
33 void Init() override;
34
35 void OnEngineTick() override;
36 void OnEngineClientJoin(int ClientId, bool Sixup) override;
37 void OnEngineClientDrop(int ClientId, const char *pReason) override;
38 bool OnEngineClientMessage(int ClientId, const void *pData, int Size, int Flags) override;
39 bool OnEngineServerMessage(int ClientId, const void *pData, int Size, int Flags) override;
40 bool OnEngineSimulateClientMessage(int *pClientId, void *pBuffer, int BufferSize, int *pOutSize, int *pFlags) override;
41
42 // Game
43 void RoundStart(class IGameServer *pGameServer) override;
44 void RoundEnd() override;
45
46 void OnPlayerInit(int ClientId) override;
47 void OnPlayerDestroy(int ClientId) override;
48 void OnSpawn(int ClientId) override;
49 void OnHammerFireReloading(int ClientId) override;
50 void OnHammerFire(int ClientId) override;
51 void OnHammerHit(int ClientId, int TargetId) override;
52 void OnDirectInput(int ClientId) override;
53 void OnCharacterTick(int ClientId) override;
54 void OnHookAttach(int ClientId, bool Player) override;
55
56 void ConsoleCommand(const char *pCommand) override;
57};
58
59extern IEngineAntibot *CreateEngineAntibot();
60
61#endif // ENGINE_SERVER_ANTIBOT_H
62