1#ifndef ANTIBOT_ANTIBOT_DATA_H
2#define ANTIBOT_ANTIBOT_DATA_H
3
4#include <base/system.h>
5#include <base/vmath.h>
6
7enum
8{
9 ANTIBOT_ABI_VERSION = 5,
10
11 ANTIBOT_MSGFLAG_NONVITAL = 1,
12 ANTIBOT_MSGFLAG_FLUSH = 2,
13
14 ANTIBOT_MAX_CLIENTS = 64,
15};
16
17struct CAntibotMapData
18{
19 int m_Width;
20 int m_Height;
21 unsigned char *m_pTiles;
22};
23
24struct CAntibotInputData
25{
26 int m_TargetX;
27 int m_TargetY;
28};
29
30// Defined by the network protocol, unlikely to change.
31//enum
32//{
33// TEAM_SPECTATORS=-1,
34// TEAM_RED=0,
35// TEAM_BLUE=1,
36//};
37
38struct CAntibotCharacterData
39{
40 char m_aName[16];
41 CAntibotInputData m_aLatestInputs[3];
42
43 bool m_Alive;
44 bool m_Pause;
45 int m_Team;
46
47 vec2 m_Pos;
48 vec2 m_Vel;
49 int m_Angle;
50 int m_HookedPlayer;
51 int m_SpawnTick;
52 int m_WeaponChangeTick;
53};
54
55struct CAntibotVersion
56{
57 int m_AbiVersion;
58 int m_Size;
59
60 int m_SizeData;
61 int m_SizeCharacterData;
62 int m_SizeInputData;
63 int m_SizeMapData;
64 int m_SizeRoundData;
65};
66
67#define ANTIBOT_VERSION \
68 { \
69 ANTIBOT_ABI_VERSION, \
70 sizeof(CAntibotVersion), \
71 sizeof(CAntibotData), \
72 sizeof(CAntibotCharacterData), \
73 sizeof(CAntibotInputData), \
74 sizeof(CAntibotMapData), \
75 sizeof(CAntibotRoundData), \
76 }
77
78struct CAntibotData
79{
80 CAntibotVersion m_Version;
81
82 int64_t m_Now;
83 int64_t m_Freq;
84 void (*m_pfnLog)(const char *pMessage, void *pUser);
85 void (*m_pfnReport)(int ClientID, const char *pMessage, void *pUser);
86 void (*m_pfnSend)(int ClientID, const void *pData, int DataSize, int Flags, void *pUser);
87 void *m_pUser;
88};
89struct CAntibotRoundData
90{
91 int m_Tick;
92 CAntibotCharacterData m_aCharacters[ANTIBOT_MAX_CLIENTS];
93 CAntibotMapData m_Map;
94};
95
96#endif // ANTIBOT_ANTIBOT_DATA_H
97