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