DDraceNetwork Docs
antibot.h
Go to the documentation of this file.
1#ifndef ENGINE_SERVER_ANTIBOT_H
2#define ENGINE_SERVER_ANTIBOT_H
3
5#include <engine/antibot.h>
6
7class CAntibot : public IEngineAntibot
8{
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
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
60
61#endif // ENGINE_SERVER_ANTIBOT_H
Definition: antibot.h:8
void OnEngineClientDrop(int ClientId, const char *pReason) override
Definition: antibot.cpp:174
void OnEngineTick() override
Definition: antibot.cpp:164
void Init() override
Definition: antibot.cpp:62
void OnCharacterTick(int ClientId) override
Definition: antibot.cpp:153
CAntibotRoundData m_RoundData
Definition: antibot.h:18
class IGameServer * GameServer() const
Definition: antibot.h:15
CAntibot()
Definition: antibot.cpp:14
void Update()
Definition: antibot.cpp:105
bool OnEngineClientMessage(int ClientId, const void *pData, int Size, int Flags) override
Definition: antibot.cpp:179
bool m_Initialized
Definition: antibot.h:19
void OnPlayerDestroy(int ClientId) override
Definition: antibot.cpp:123
class IServer * m_pServer
Definition: antibot.h:9
CAntibotData m_Data
Definition: antibot.h:17
void OnHammerFireReloading(int ClientId) override
Definition: antibot.cpp:133
class IServer * Server() const
Definition: antibot.h:13
void OnHookAttach(int ClientId, bool Player) override
Definition: antibot.cpp:158
bool OnEngineSimulateClientMessage(int *pClientId, void *pBuffer, int BufferSize, int *pOutSize, int *pFlags) override
Definition: antibot.cpp:199
static void Send(int ClientId, const void *pData, int Size, int Flags, void *pUser)
Definition: antibot.cpp:42
void OnEngineClientJoin(int ClientId, bool Sixup) override
Definition: antibot.cpp:169
void OnPlayerInit(int ClientId) override
Definition: antibot.cpp:118
static void Report(int ClientId, const char *pMessage, void *pUser)
Definition: antibot.cpp:36
void OnHammerFire(int ClientId) override
Definition: antibot.cpp:138
void ConsoleCommand(const char *pCommand) override
Definition: antibot.cpp:101
void RoundEnd() override
Definition: antibot.cpp:93
bool OnEngineServerMessage(int ClientId, const void *pData, int Size, int Flags) override
Definition: antibot.cpp:189
void OnSpawn(int ClientId) override
Definition: antibot.cpp:128
void RoundStart(class IGameServer *pGameServer) override
Definition: antibot.cpp:85
class IGameServer * m_pGameServer
Definition: antibot.h:11
class IConsole * Console() const
Definition: antibot.h:14
void OnDirectInput(int ClientId) override
Definition: antibot.cpp:148
static void Teehistorian(const void *pData, int Size, void *pUser)
Definition: antibot.cpp:57
void OnHammerHit(int ClientId, int TargetId) override
Definition: antibot.cpp:143
static void Log(const char *pMessage, void *pUser)
Definition: antibot.cpp:31
class IConsole * m_pConsole
Definition: antibot.h:10
virtual ~CAntibot()
Definition: antibot.cpp:18
static void Kick(int ClientId, const char *pMessage, void *pUser)
Definition: antibot.cpp:26
Definition: console.h:18
Definition: antibot.h:31
Definition: server.h:296
Definition: server.h:30
IEngineAntibot * CreateEngineAntibot()
Definition: antibot.cpp:266
Definition: antibot_data.h:85
Definition: antibot_data.h:98