| 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 = 11, |
| 9 | |
| 10 | ANTIBOT_MSGFLAG_NONVITAL = 1, |
| 11 | ANTIBOT_MSGFLAG_FLUSH = 2, |
| 12 | |
| 13 | ANTIBOT_MAX_CLIENTS = 128, |
| 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 | bool m_Sixup; |
| 27 | bool m_DnsblNone; |
| 28 | bool m_DnsblPending; |
| 29 | bool m_DnsblBlacklisted; |
| 30 | bool m_Authed; |
| 31 | }; |
| 32 | |
| 33 | struct CAntibotInputData |
| 34 | { |
| 35 | int m_Direction; |
| 36 | int m_TargetX; |
| 37 | int m_TargetY; |
| 38 | int m_Jump; |
| 39 | int m_Fire; |
| 40 | int m_Hook; |
| 41 | int m_PlayerFlags; |
| 42 | int m_WantedWeapon; |
| 43 | int m_NextWeapon; |
| 44 | int m_PrevWeapon; |
| 45 | }; |
| 46 | |
| 47 | // Defined by the network protocol, unlikely to change. |
| 48 | //enum |
| 49 | //{ |
| 50 | // TEAM_SPECTATORS=-1, |
| 51 | // TEAM_RED=0, |
| 52 | // TEAM_BLUE=1, |
| 53 | //}; |
| 54 | |
| 55 | struct CAntibotCharacterData |
| 56 | { |
| 57 | char m_aName[16]; |
| 58 | CAntibotInputData m_aLatestInputs[3]; |
| 59 | |
| 60 | bool m_Alive; |
| 61 | bool m_Pause; |
| 62 | int m_Team; |
| 63 | |
| 64 | vec2 m_Pos; |
| 65 | vec2 m_Vel; |
| 66 | int m_Angle; |
| 67 | int m_HookedPlayer; |
| 68 | int m_SpawnTick; |
| 69 | int m_WeaponChangeTick; |
| 70 | }; |
| 71 | |
| 72 | struct CAntibotVersion |
| 73 | { |
| 74 | int m_AbiVersion; |
| 75 | int m_Size; |
| 76 | |
| 77 | int m_SizeData; |
| 78 | int m_SizePlayerData; |
| 79 | int m_SizeCharacterData; |
| 80 | int m_SizeInputData; |
| 81 | int m_SizeMapData; |
| 82 | int m_SizeRoundData; |
| 83 | }; |
| 84 | |
| 85 | #define ANTIBOT_VERSION \ |
| 86 | { \ |
| 87 | ANTIBOT_ABI_VERSION, \ |
| 88 | sizeof(CAntibotVersion), \ |
| 89 | sizeof(CAntibotData), \ |
| 90 | sizeof(CAntibotPlayerData), \ |
| 91 | sizeof(CAntibotCharacterData), \ |
| 92 | sizeof(CAntibotInputData), \ |
| 93 | sizeof(CAntibotMapData), \ |
| 94 | sizeof(CAntibotRoundData), \ |
| 95 | } |
| 96 | |
| 97 | struct CAntibotData |
| 98 | { |
| 99 | CAntibotVersion m_Version; |
| 100 | |
| 101 | int64_t m_Now; |
| 102 | int64_t m_Freq; |
| 103 | void (*m_pfnKick)(int ClientId, const char *pMessage, void *pUser); |
| 104 | void (*m_pfnLog)(const char *pMessage, void *pUser); |
| 105 | void (*m_pfnReport)(int ClientId, const char *pMessage, void *pUser); |
| 106 | void (*m_pfnSend)(int ClientId, const void *pData, int DataSize, int Flags, void *pUser); |
| 107 | void (*m_pfnTeehistorian)(const void *pData, int DataSize, void *pUser); |
| 108 | void *m_pUser; |
| 109 | }; |
| 110 | struct CAntibotRoundData |
| 111 | { |
| 112 | int m_Tick; |
| 113 | CAntibotPlayerData m_aPlayers[ANTIBOT_MAX_CLIENTS]; |
| 114 | CAntibotCharacterData m_aCharacters[ANTIBOT_MAX_CLIENTS]; |
| 115 | CAntibotMapData m_Map; |
| 116 | }; |
| 117 | |
| 118 | #endif // ANTIBOT_ANTIBOT_DATA_H |
| 119 | |