2020-05-13 20:27:49 +00:00
|
|
|
#ifndef ENGINE_SERVER_ANTIBOT_H
|
|
|
|
#define ENGINE_SERVER_ANTIBOT_H
|
|
|
|
|
|
|
|
#include <antibot/antibot_data.h>
|
|
|
|
#include <engine/antibot.h>
|
|
|
|
|
|
|
|
class CAntibot : public IEngineAntibot
|
|
|
|
{
|
|
|
|
class IServer *m_pServer;
|
|
|
|
class IConsole *m_pConsole;
|
|
|
|
class IGameServer *m_pGameServer;
|
|
|
|
|
|
|
|
class IServer *Server() const { return m_pServer; }
|
|
|
|
class IConsole *Console() const { return m_pConsole; }
|
|
|
|
class IGameServer *GameServer() const { return m_pGameServer; }
|
|
|
|
|
2020-05-15 16:29:34 +00:00
|
|
|
CAntibotData m_Data;
|
2020-05-13 20:27:49 +00:00
|
|
|
CAntibotRoundData m_RoundData;
|
2020-05-16 20:04:14 +00:00
|
|
|
bool m_Initialized;
|
2020-05-13 20:27:49 +00:00
|
|
|
|
|
|
|
void Update();
|
2024-03-05 14:44:09 +00:00
|
|
|
static void Kick(int ClientId, const char *pMessage, void *pUser);
|
2020-05-13 20:27:49 +00:00
|
|
|
static void Log(const char *pMessage, void *pUser);
|
2024-03-05 14:44:09 +00:00
|
|
|
static void Report(int ClientId, const char *pMessage, void *pUser);
|
|
|
|
static void Send(int ClientId, const void *pData, int Size, int Flags, void *pUser);
|
2023-08-25 12:26:09 +00:00
|
|
|
static void Teehistorian(const void *pData, int Size, void *pUser);
|
2020-09-26 19:41:58 +00:00
|
|
|
|
2020-05-13 20:27:49 +00:00
|
|
|
public:
|
|
|
|
CAntibot();
|
|
|
|
virtual ~CAntibot();
|
|
|
|
|
|
|
|
// Engine
|
2022-05-17 20:13:44 +00:00
|
|
|
void Init() override;
|
2020-05-13 20:27:49 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void OnEngineTick() override;
|
2024-03-05 14:44:09 +00:00
|
|
|
void OnEngineClientJoin(int ClientId, bool Sixup) override;
|
|
|
|
void OnEngineClientDrop(int ClientId, const char *pReason) override;
|
|
|
|
bool OnEngineClientMessage(int ClientId, const void *pData, int Size, int Flags) override;
|
|
|
|
bool OnEngineServerMessage(int ClientId, const void *pData, int Size, int Flags) override;
|
|
|
|
bool OnEngineSimulateClientMessage(int *pClientId, void *pBuffer, int BufferSize, int *pOutSize, int *pFlags) override;
|
2020-05-13 20:27:49 +00:00
|
|
|
|
|
|
|
// Game
|
2022-05-17 20:13:44 +00:00
|
|
|
void RoundStart(class IGameServer *pGameServer) override;
|
|
|
|
void RoundEnd() override;
|
|
|
|
|
2024-03-05 14:44:09 +00:00
|
|
|
void OnPlayerInit(int ClientId) override;
|
|
|
|
void OnPlayerDestroy(int ClientId) override;
|
|
|
|
void OnSpawn(int ClientId) override;
|
|
|
|
void OnHammerFireReloading(int ClientId) override;
|
|
|
|
void OnHammerFire(int ClientId) override;
|
|
|
|
void OnHammerHit(int ClientId, int TargetId) override;
|
|
|
|
void OnDirectInput(int ClientId) override;
|
|
|
|
void OnCharacterTick(int ClientId) override;
|
|
|
|
void OnHookAttach(int ClientId, bool Player) override;
|
2022-05-17 20:13:44 +00:00
|
|
|
|
2023-11-19 03:41:56 +00:00
|
|
|
void ConsoleCommand(const char *pCommand) override;
|
2020-05-13 20:27:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern IEngineAntibot *CreateEngineAntibot();
|
|
|
|
|
|
|
|
#endif // ENGINE_SERVER_ANTIBOT_H
|