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();
|
|
|
|
static void Send(int ClientID, const void *pData, int Size, int Flags, void *pUser);
|
|
|
|
static void Log(const char *pMessage, void *pUser);
|
|
|
|
static void Report(int ClientID, const char *pMessage, void *pUser);
|
2020-09-26 19:41:58 +00:00
|
|
|
|
2020-05-13 20:27:49 +00:00
|
|
|
public:
|
|
|
|
CAntibot();
|
|
|
|
virtual ~CAntibot();
|
|
|
|
|
|
|
|
// Engine
|
|
|
|
virtual void Init();
|
|
|
|
|
2020-05-15 16:29:34 +00:00
|
|
|
virtual void OnEngineTick();
|
2020-07-01 12:11:37 +00:00
|
|
|
virtual void OnEngineClientJoin(int ClientID, bool Sixup);
|
2020-05-13 20:27:49 +00:00
|
|
|
virtual void OnEngineClientDrop(int ClientID, const char *pReason);
|
2021-06-24 18:32:41 +00:00
|
|
|
virtual bool OnEngineClientMessage(int ClientID, const void *pData, int Size, int Flags);
|
|
|
|
virtual bool OnEngineServerMessage(int ClientID, const void *pData, int Size, int Flags);
|
|
|
|
virtual bool OnEngineSimulateClientMessage(int *pClientID, void *pBuffer, int BufferSize, int *pOutSize, int *pFlags);
|
2020-05-13 20:27:49 +00:00
|
|
|
|
|
|
|
// Game
|
|
|
|
virtual void RoundStart(class IGameServer *pGameServer);
|
|
|
|
virtual void RoundEnd();
|
|
|
|
|
|
|
|
virtual void OnPlayerInit(int ClientID);
|
|
|
|
virtual void OnPlayerDestroy(int ClientID);
|
|
|
|
virtual void OnSpawn(int ClientID);
|
|
|
|
virtual void OnHammerFireReloading(int ClientID);
|
|
|
|
virtual void OnHammerFire(int ClientID);
|
2021-07-21 20:28:59 +00:00
|
|
|
virtual void OnHammerHit(int ClientID, int TargetID);
|
2020-05-13 20:27:49 +00:00
|
|
|
virtual void OnDirectInput(int ClientID);
|
2020-05-15 16:29:34 +00:00
|
|
|
virtual void OnCharacterTick(int ClientID);
|
2020-05-13 20:27:49 +00:00
|
|
|
virtual void OnHookAttach(int ClientID, bool Player);
|
|
|
|
|
|
|
|
virtual void Dump();
|
|
|
|
};
|
|
|
|
|
|
|
|
extern IEngineAntibot *CreateEngineAntibot();
|
|
|
|
|
|
|
|
#endif // ENGINE_SERVER_ANTIBOT_H
|