| 1 | #include "protocol7.h" |
| 2 | |
| 3 | #include <base/dbg.h> |
| 4 | #include <base/str.h> |
| 5 | |
| 6 | #include <engine/shared/packer.h> |
| 7 | #include <engine/shared/protocol.h> |
| 8 | #include <engine/shared/snapshot.h> |
| 9 | namespace protocol7 { |
| 10 | CNetObjHandler::CNetObjHandler() |
| 11 | { |
| 12 | m_pMsgFailedOn = "" ; |
| 13 | m_pObjFailedOn = "" ; |
| 14 | m_NumObjFailures = 0; |
| 15 | } |
| 16 | |
| 17 | const char *CNetObjHandler::FailedObjOn() const { return m_pObjFailedOn; } |
| 18 | int CNetObjHandler::NumObjFailures() const { return m_NumObjFailures; } |
| 19 | const char *CNetObjHandler::FailedMsgOn() const { return m_pMsgFailedOn; } |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | static const int max_int = 0x7fffffff; |
| 25 | |
| 26 | bool CNetObjHandler::CheckInt(const char *pErrorMsg, int Value, int Min, int Max) |
| 27 | { |
| 28 | if(Value < Min || Value > Max) { m_pObjFailedOn = pErrorMsg; m_NumObjFailures++; return false; } |
| 29 | return true; |
| 30 | } |
| 31 | |
| 32 | bool CNetObjHandler::CheckFlag(const char *pErrorMsg, int Value, int Mask) |
| 33 | { |
| 34 | if((Value&Mask) != Value) { m_pObjFailedOn = pErrorMsg; m_NumObjFailures++; return false; } |
| 35 | return true; |
| 36 | } |
| 37 | |
| 38 | const char *CNetObjHandler::ms_apObjNames[] = { |
| 39 | "invalid" , |
| 40 | "PlayerInput" , |
| 41 | "Projectile" , |
| 42 | "Laser" , |
| 43 | "Pickup" , |
| 44 | "Flag" , |
| 45 | "GameData" , |
| 46 | "GameDataTeam" , |
| 47 | "GameDataFlag" , |
| 48 | "CharacterCore" , |
| 49 | "Character" , |
| 50 | "PlayerInfo" , |
| 51 | "SpectatorInfo" , |
| 52 | "De_ClientInfo" , |
| 53 | "De_GameInfo" , |
| 54 | "De_TuneParams" , |
| 55 | "Common" , |
| 56 | "Explosion" , |
| 57 | "Spawn" , |
| 58 | "HammerHit" , |
| 59 | "Death" , |
| 60 | "SoundWorld" , |
| 61 | "Damage" , |
| 62 | "PlayerInfoRace" , |
| 63 | "GameDataRace" , |
| 64 | "" |
| 65 | }; |
| 66 | |
| 67 | int CNetObjHandler::ms_aObjSizes[] = { |
| 68 | 0, |
| 69 | sizeof(CNetObj_PlayerInput), |
| 70 | sizeof(CNetObj_Projectile), |
| 71 | sizeof(CNetObj_Laser), |
| 72 | sizeof(CNetObj_Pickup), |
| 73 | sizeof(CNetObj_Flag), |
| 74 | sizeof(CNetObj_GameData), |
| 75 | sizeof(CNetObj_GameDataTeam), |
| 76 | sizeof(CNetObj_GameDataFlag), |
| 77 | sizeof(CNetObj_CharacterCore), |
| 78 | sizeof(CNetObj_Character), |
| 79 | sizeof(CNetObj_PlayerInfo), |
| 80 | sizeof(CNetObj_SpectatorInfo), |
| 81 | sizeof(CNetObj_De_ClientInfo), |
| 82 | sizeof(CNetObj_De_GameInfo), |
| 83 | sizeof(CNetObj_De_TuneParams), |
| 84 | sizeof(CNetEvent_Common), |
| 85 | sizeof(CNetEvent_Explosion), |
| 86 | sizeof(CNetEvent_Spawn), |
| 87 | sizeof(CNetEvent_HammerHit), |
| 88 | sizeof(CNetEvent_Death), |
| 89 | sizeof(CNetEvent_SoundWorld), |
| 90 | sizeof(CNetEvent_Damage), |
| 91 | sizeof(CNetObj_PlayerInfoRace), |
| 92 | sizeof(CNetObj_GameDataRace), |
| 93 | 0 |
| 94 | }; |
| 95 | |
| 96 | const char *CNetObjHandler::ms_apMsgNames[] = { |
| 97 | "invalid" , |
| 98 | "Sv_Motd" , |
| 99 | "Sv_Broadcast" , |
| 100 | "Sv_Chat" , |
| 101 | "Sv_Team" , |
| 102 | "Sv_KillMsg" , |
| 103 | "Sv_TuneParams" , |
| 104 | "Unused" , |
| 105 | "Sv_ReadyToEnter" , |
| 106 | "Sv_WeaponPickup" , |
| 107 | "Sv_Emoticon" , |
| 108 | "Sv_VoteClearOptions" , |
| 109 | "Sv_VoteOptionListAdd" , |
| 110 | "Sv_VoteOptionAdd" , |
| 111 | "Sv_VoteOptionRemove" , |
| 112 | "Sv_VoteSet" , |
| 113 | "Sv_VoteStatus" , |
| 114 | "Sv_ServerSettings" , |
| 115 | "Sv_ClientInfo" , |
| 116 | "Sv_GameInfo" , |
| 117 | "Sv_ClientDrop" , |
| 118 | "Sv_GameMsg" , |
| 119 | "De_ClientEnter" , |
| 120 | "De_ClientLeave" , |
| 121 | "Cl_Say" , |
| 122 | "Cl_SetTeam" , |
| 123 | "Cl_SetSpectatorMode" , |
| 124 | "Cl_StartInfo" , |
| 125 | "Cl_Kill" , |
| 126 | "Cl_ReadyChange" , |
| 127 | "Cl_Emoticon" , |
| 128 | "Cl_Vote" , |
| 129 | "Cl_CallVote" , |
| 130 | "Sv_SkinChange" , |
| 131 | "Cl_SkinChange" , |
| 132 | "Sv_RaceFinish" , |
| 133 | "Sv_Checkpoint" , |
| 134 | "Sv_CommandInfo" , |
| 135 | "Sv_CommandInfoRemove" , |
| 136 | "Cl_Command" , |
| 137 | "" |
| 138 | }; |
| 139 | |
| 140 | const char *CNetObjHandler::GetObjName(int Type) const |
| 141 | { |
| 142 | if(Type < 0 || Type >= NUM_NETOBJTYPES) return "(out of range)" ; |
| 143 | return ms_apObjNames[Type]; |
| 144 | }; |
| 145 | |
| 146 | int CNetObjHandler::GetObjSize(int Type) const |
| 147 | { |
| 148 | if(Type < 0 || Type >= NUM_NETOBJTYPES) return 0; |
| 149 | return ms_aObjSizes[Type]; |
| 150 | }; |
| 151 | |
| 152 | const char *CNetObjHandler::GetMsgName(int Type) const |
| 153 | { |
| 154 | if(Type < 0 || Type >= NUM_NETMSGTYPES) return "(out of range)" ; |
| 155 | return ms_apMsgNames[Type]; |
| 156 | }; |
| 157 | |
| 158 | int CNetObjHandler::ValidateObj(int Type, const void *pData, int Size) |
| 159 | { |
| 160 | switch(Type) |
| 161 | { |
| 162 | case NETOBJTYPE_PLAYERINPUT: |
| 163 | { |
| 164 | CNetObj_PlayerInput *pObj = (CNetObj_PlayerInput *)pData; |
| 165 | if(sizeof(*pObj) != Size) return -1; |
| 166 | if(!CheckInt(pErrorMsg: "m_Direction" , Value: pObj->m_Direction, Min: -1, Max: 1)) return -1; |
| 167 | if(!CheckInt(pErrorMsg: "m_Jump" , Value: pObj->m_Jump, Min: 0, Max: 1)) return -1; |
| 168 | if(!CheckInt(pErrorMsg: "m_Hook" , Value: pObj->m_Hook, Min: 0, Max: 1)) return -1; |
| 169 | if(!CheckFlag(pErrorMsg: "m_PlayerFlags" , Value: pObj->m_PlayerFlags, Mask: PLAYERFLAG_ADMIN|PLAYERFLAG_CHATTING|PLAYERFLAG_SCOREBOARD|PLAYERFLAG_READY|PLAYERFLAG_DEAD|PLAYERFLAG_WATCHING|PLAYERFLAG_BOT|PLAYERFLAG_AIM)) return -1; |
| 170 | if(!CheckInt(pErrorMsg: "m_WantedWeapon" , Value: pObj->m_WantedWeapon, Min: 0, Max: NUM_WEAPONS-1)) return -1; |
| 171 | return 0; |
| 172 | } |
| 173 | |
| 174 | case NETOBJTYPE_PROJECTILE: |
| 175 | { |
| 176 | CNetObj_Projectile *pObj = (CNetObj_Projectile *)pData; |
| 177 | if(sizeof(*pObj) != Size) return -1; |
| 178 | if(!CheckInt(pErrorMsg: "m_Type" , Value: pObj->m_Type, Min: 0, Max: NUM_WEAPONS-1)) return -1; |
| 179 | if(!CheckInt(pErrorMsg: "m_StartTick" , Value: pObj->m_StartTick, Min: 0, Max: max_int)) return -1; |
| 180 | return 0; |
| 181 | } |
| 182 | |
| 183 | case NETOBJTYPE_LASER: |
| 184 | { |
| 185 | CNetObj_Laser *pObj = (CNetObj_Laser *)pData; |
| 186 | if(sizeof(*pObj) != Size) return -1; |
| 187 | if(!CheckInt(pErrorMsg: "m_StartTick" , Value: pObj->m_StartTick, Min: 0, Max: max_int)) return -1; |
| 188 | return 0; |
| 189 | } |
| 190 | |
| 191 | case NETOBJTYPE_PICKUP: |
| 192 | { |
| 193 | CNetObj_Pickup *pObj = (CNetObj_Pickup *)pData; |
| 194 | if(sizeof(*pObj) != Size) return -1; |
| 195 | if(!CheckInt(pErrorMsg: "m_Type" , Value: pObj->m_Type, Min: 0, Max: 7)) return -1; |
| 196 | return 0; |
| 197 | } |
| 198 | |
| 199 | case NETOBJTYPE_FLAG: |
| 200 | { |
| 201 | CNetObj_Flag *pObj = (CNetObj_Flag *)pData; |
| 202 | if(sizeof(*pObj) != Size) return -1; |
| 203 | if(!CheckInt(pErrorMsg: "m_Team" , Value: pObj->m_Team, Min: TEAM_RED, Max: TEAM_BLUE)) return -1; |
| 204 | return 0; |
| 205 | } |
| 206 | |
| 207 | case NETOBJTYPE_GAMEDATA: |
| 208 | { |
| 209 | CNetObj_GameData *pObj = (CNetObj_GameData *)pData; |
| 210 | if(sizeof(*pObj) != Size) return -1; |
| 211 | if(!CheckInt(pErrorMsg: "m_GameStartTick" , Value: pObj->m_GameStartTick, Min: 0, Max: max_int)) return -1; |
| 212 | if(!CheckFlag(pErrorMsg: "m_GameStateFlags" , Value: pObj->m_GameStateFlags, Mask: GAMESTATEFLAG_WARMUP|GAMESTATEFLAG_SUDDENDEATH|GAMESTATEFLAG_ROUNDOVER|GAMESTATEFLAG_GAMEOVER|GAMESTATEFLAG_PAUSED|GAMESTATEFLAG_STARTCOUNTDOWN)) return -1; |
| 213 | if(!CheckInt(pErrorMsg: "m_GameStateEndTick" , Value: pObj->m_GameStateEndTick, Min: 0, Max: max_int)) return -1; |
| 214 | return 0; |
| 215 | } |
| 216 | |
| 217 | case NETOBJTYPE_GAMEDATATEAM: |
| 218 | { |
| 219 | CNetObj_GameDataTeam *pObj = (CNetObj_GameDataTeam *)pData; |
| 220 | if(sizeof(*pObj) != Size) return -1; |
| 221 | return 0; |
| 222 | } |
| 223 | |
| 224 | case NETOBJTYPE_GAMEDATAFLAG: |
| 225 | { |
| 226 | CNetObj_GameDataFlag *pObj = (CNetObj_GameDataFlag *)pData; |
| 227 | if(sizeof(*pObj) != Size) return -1; |
| 228 | if(!CheckInt(pErrorMsg: "m_FlagCarrierRed" , Value: pObj->m_FlagCarrierRed, Min: FLAG_MISSING, Max: MAX_CLIENTS-1)) return -1; |
| 229 | if(!CheckInt(pErrorMsg: "m_FlagCarrierBlue" , Value: pObj->m_FlagCarrierBlue, Min: FLAG_MISSING, Max: MAX_CLIENTS-1)) return -1; |
| 230 | if(!CheckInt(pErrorMsg: "m_FlagDropTickRed" , Value: pObj->m_FlagDropTickRed, Min: 0, Max: max_int)) return -1; |
| 231 | if(!CheckInt(pErrorMsg: "m_FlagDropTickBlue" , Value: pObj->m_FlagDropTickBlue, Min: 0, Max: max_int)) return -1; |
| 232 | return 0; |
| 233 | } |
| 234 | |
| 235 | case NETOBJTYPE_CHARACTERCORE: |
| 236 | { |
| 237 | CNetObj_CharacterCore *pObj = (CNetObj_CharacterCore *)pData; |
| 238 | if(sizeof(*pObj) != Size) return -1; |
| 239 | if(!CheckInt(pErrorMsg: "m_Tick" , Value: pObj->m_Tick, Min: 0, Max: max_int)) return -1; |
| 240 | if(!CheckInt(pErrorMsg: "m_Direction" , Value: pObj->m_Direction, Min: -1, Max: 1)) return -1; |
| 241 | if(!CheckInt(pErrorMsg: "m_Jumped" , Value: pObj->m_Jumped, Min: 0, Max: 3)) return -1; |
| 242 | if(!CheckInt(pErrorMsg: "m_HookedPlayer" , Value: pObj->m_HookedPlayer, Min: -1, Max: MAX_CLIENTS-1)) return -1; |
| 243 | if(!CheckInt(pErrorMsg: "m_HookState" , Value: pObj->m_HookState, Min: -1, Max: 5)) return -1; |
| 244 | if(!CheckInt(pErrorMsg: "m_HookTick" , Value: pObj->m_HookTick, Min: 0, Max: max_int)) return -1; |
| 245 | return 0; |
| 246 | } |
| 247 | |
| 248 | case NETOBJTYPE_CHARACTER: |
| 249 | { |
| 250 | CNetObj_Character *pObj = (CNetObj_Character *)pData; |
| 251 | if(sizeof(*pObj) != Size) return -1; |
| 252 | if(!CheckInt(pErrorMsg: "m_Tick" , Value: pObj->m_Tick, Min: 0, Max: max_int)) return -1; |
| 253 | if(!CheckInt(pErrorMsg: "m_Direction" , Value: pObj->m_Direction, Min: -1, Max: 1)) return -1; |
| 254 | if(!CheckInt(pErrorMsg: "m_Jumped" , Value: pObj->m_Jumped, Min: 0, Max: 3)) return -1; |
| 255 | if(!CheckInt(pErrorMsg: "m_HookedPlayer" , Value: pObj->m_HookedPlayer, Min: -1, Max: MAX_CLIENTS-1)) return -1; |
| 256 | if(!CheckInt(pErrorMsg: "m_HookState" , Value: pObj->m_HookState, Min: -1, Max: 5)) return -1; |
| 257 | if(!CheckInt(pErrorMsg: "m_HookTick" , Value: pObj->m_HookTick, Min: 0, Max: max_int)) return -1; |
| 258 | if(!CheckInt(pErrorMsg: "m_Health" , Value: pObj->m_Health, Min: 0, Max: 10)) return -1; |
| 259 | if(!CheckInt(pErrorMsg: "m_Armor" , Value: pObj->m_Armor, Min: 0, Max: 10)) return -1; |
| 260 | if(!CheckInt(pErrorMsg: "m_Weapon" , Value: pObj->m_Weapon, Min: -1, Max: NUM_WEAPONS-1)) return -1; |
| 261 | if(!CheckInt(pErrorMsg: "m_Emote" , Value: pObj->m_Emote, Min: 0, Max: 5)) return -1; |
| 262 | if(!CheckInt(pErrorMsg: "m_AttackTick" , Value: pObj->m_AttackTick, Min: 0, Max: max_int)) return -1; |
| 263 | if(!CheckFlag(pErrorMsg: "m_TriggeredEvents" , Value: pObj->m_TriggeredEvents, Mask: COREEVENTFLAG_GROUND_JUMP|COREEVENTFLAG_AIR_JUMP|COREEVENTFLAG_HOOK_ATTACH_PLAYER|COREEVENTFLAG_HOOK_ATTACH_GROUND|COREEVENTFLAG_HOOK_HIT_NOHOOK)) return -1; |
| 264 | return 0; |
| 265 | } |
| 266 | |
| 267 | case NETOBJTYPE_PLAYERINFO: |
| 268 | { |
| 269 | CNetObj_PlayerInfo *pObj = (CNetObj_PlayerInfo *)pData; |
| 270 | if(sizeof(*pObj) != Size) return -1; |
| 271 | if(!CheckFlag(pErrorMsg: "m_PlayerFlags" , Value: pObj->m_PlayerFlags, Mask: PLAYERFLAG_ADMIN|PLAYERFLAG_CHATTING|PLAYERFLAG_SCOREBOARD|PLAYERFLAG_READY|PLAYERFLAG_DEAD|PLAYERFLAG_WATCHING|PLAYERFLAG_BOT|PLAYERFLAG_AIM)) return -1; |
| 272 | return 0; |
| 273 | } |
| 274 | |
| 275 | case NETOBJTYPE_SPECTATORINFO: |
| 276 | { |
| 277 | CNetObj_SpectatorInfo *pObj = (CNetObj_SpectatorInfo *)pData; |
| 278 | if(sizeof(*pObj) != Size) return -1; |
| 279 | if(!CheckInt(pErrorMsg: "m_SpecMode" , Value: pObj->m_SpecMode, Min: 0, Max: NUM_SPECMODES-1)) return -1; |
| 280 | if(!CheckInt(pErrorMsg: "m_SpectatorId" , Value: pObj->m_SpectatorId, Min: -1, Max: MAX_CLIENTS-1)) return -1; |
| 281 | return 0; |
| 282 | } |
| 283 | |
| 284 | case NETOBJTYPE_DE_CLIENTINFO: |
| 285 | { |
| 286 | CNetObj_De_ClientInfo *pObj = (CNetObj_De_ClientInfo *)pData; |
| 287 | if(sizeof(*pObj) != Size) return -1; |
| 288 | if(!CheckInt(pErrorMsg: "m_Local" , Value: pObj->m_Local, Min: 0, Max: 1)) return -1; |
| 289 | if(!CheckInt(pErrorMsg: "m_Team" , Value: pObj->m_Team, Min: TEAM_SPECTATORS, Max: TEAM_BLUE)) return -1; |
| 290 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[0]" , Value: pObj->m_aUseCustomColors[0], Min: 0, Max: 1)) return -1; |
| 291 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[1]" , Value: pObj->m_aUseCustomColors[1], Min: 0, Max: 1)) return -1; |
| 292 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[2]" , Value: pObj->m_aUseCustomColors[2], Min: 0, Max: 1)) return -1; |
| 293 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[3]" , Value: pObj->m_aUseCustomColors[3], Min: 0, Max: 1)) return -1; |
| 294 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[4]" , Value: pObj->m_aUseCustomColors[4], Min: 0, Max: 1)) return -1; |
| 295 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[5]" , Value: pObj->m_aUseCustomColors[5], Min: 0, Max: 1)) return -1; |
| 296 | return 0; |
| 297 | } |
| 298 | |
| 299 | case NETOBJTYPE_DE_GAMEINFO: |
| 300 | { |
| 301 | CNetObj_De_GameInfo *pObj = (CNetObj_De_GameInfo *)pData; |
| 302 | if(sizeof(*pObj) != Size) return -1; |
| 303 | if(!CheckFlag(pErrorMsg: "m_GameFlags" , Value: pObj->m_GameFlags, Mask: GAMEFLAG_TEAMS|GAMEFLAG_FLAGS|GAMEFLAG_SURVIVAL|GAMEFLAG_RACE)) return -1; |
| 304 | if(!CheckInt(pErrorMsg: "m_ScoreLimit" , Value: pObj->m_ScoreLimit, Min: 0, Max: max_int)) return -1; |
| 305 | if(!CheckInt(pErrorMsg: "m_TimeLimit" , Value: pObj->m_TimeLimit, Min: 0, Max: max_int)) return -1; |
| 306 | if(!CheckInt(pErrorMsg: "m_MatchNum" , Value: pObj->m_MatchNum, Min: 0, Max: max_int)) return -1; |
| 307 | if(!CheckInt(pErrorMsg: "m_MatchCurrent" , Value: pObj->m_MatchCurrent, Min: 0, Max: max_int)) return -1; |
| 308 | return 0; |
| 309 | } |
| 310 | |
| 311 | case NETOBJTYPE_DE_TUNEPARAMS: |
| 312 | { |
| 313 | CNetObj_De_TuneParams *pObj = (CNetObj_De_TuneParams *)pData; |
| 314 | if(sizeof(*pObj) != Size) return -1; |
| 315 | return 0; |
| 316 | } |
| 317 | |
| 318 | case NETEVENTTYPE_COMMON: |
| 319 | { |
| 320 | CNetEvent_Common *pObj = (CNetEvent_Common *)pData; |
| 321 | if(sizeof(*pObj) != Size) return -1; |
| 322 | return 0; |
| 323 | } |
| 324 | |
| 325 | case NETEVENTTYPE_EXPLOSION: |
| 326 | { |
| 327 | CNetEvent_Explosion *pObj = (CNetEvent_Explosion *)pData; |
| 328 | if(sizeof(*pObj) != Size) return -1; |
| 329 | return 0; |
| 330 | } |
| 331 | |
| 332 | case NETEVENTTYPE_SPAWN: |
| 333 | { |
| 334 | CNetEvent_Spawn *pObj = (CNetEvent_Spawn *)pData; |
| 335 | if(sizeof(*pObj) != Size) return -1; |
| 336 | return 0; |
| 337 | } |
| 338 | |
| 339 | case NETEVENTTYPE_HAMMERHIT: |
| 340 | { |
| 341 | CNetEvent_HammerHit *pObj = (CNetEvent_HammerHit *)pData; |
| 342 | if(sizeof(*pObj) != Size) return -1; |
| 343 | return 0; |
| 344 | } |
| 345 | |
| 346 | case NETEVENTTYPE_DEATH: |
| 347 | { |
| 348 | CNetEvent_Death *pObj = (CNetEvent_Death *)pData; |
| 349 | if(sizeof(*pObj) != Size) return -1; |
| 350 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pObj->m_ClientId, Min: 0, Max: MAX_CLIENTS-1)) return -1; |
| 351 | return 0; |
| 352 | } |
| 353 | |
| 354 | case NETEVENTTYPE_SOUNDWORLD: |
| 355 | { |
| 356 | CNetEvent_SoundWorld *pObj = (CNetEvent_SoundWorld *)pData; |
| 357 | if(sizeof(*pObj) != Size) return -1; |
| 358 | if(!CheckInt(pErrorMsg: "m_SoundId" , Value: pObj->m_SoundId, Min: 0, Max: NUM_SOUNDS-1)) return -1; |
| 359 | return 0; |
| 360 | } |
| 361 | |
| 362 | case NETEVENTTYPE_DAMAGE: |
| 363 | { |
| 364 | CNetEvent_Damage *pObj = (CNetEvent_Damage *)pData; |
| 365 | if(sizeof(*pObj) != Size) return -1; |
| 366 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pObj->m_ClientId, Min: 0, Max: MAX_CLIENTS-1)) return -1; |
| 367 | if(!CheckInt(pErrorMsg: "m_HealthAmount" , Value: pObj->m_HealthAmount, Min: 0, Max: 9)) return -1; |
| 368 | if(!CheckInt(pErrorMsg: "m_ArmorAmount" , Value: pObj->m_ArmorAmount, Min: 0, Max: 9)) return -1; |
| 369 | if(!CheckInt(pErrorMsg: "m_Self" , Value: pObj->m_Self, Min: 0, Max: 1)) return -1; |
| 370 | return 0; |
| 371 | } |
| 372 | |
| 373 | case NETOBJTYPE_PLAYERINFORACE: |
| 374 | { |
| 375 | CNetObj_PlayerInfoRace *pObj = (CNetObj_PlayerInfoRace *)pData; |
| 376 | if(sizeof(*pObj) != Size) return -1; |
| 377 | if(!CheckInt(pErrorMsg: "m_RaceStartTick" , Value: pObj->m_RaceStartTick, Min: 0, Max: max_int)) return -1; |
| 378 | return 0; |
| 379 | } |
| 380 | |
| 381 | case NETOBJTYPE_GAMEDATARACE: |
| 382 | { |
| 383 | CNetObj_GameDataRace *pObj = (CNetObj_GameDataRace *)pData; |
| 384 | if(sizeof(*pObj) != Size) return -1; |
| 385 | if(!CheckInt(pErrorMsg: "m_BestTime" , Value: pObj->m_BestTime, Min: -1, Max: max_int)) return -1; |
| 386 | if(!CheckInt(pErrorMsg: "m_Precision" , Value: pObj->m_Precision, Min: 0, Max: 3)) return -1; |
| 387 | if(!CheckFlag(pErrorMsg: "m_RaceFlags" , Value: pObj->m_RaceFlags, Mask: RACEFLAG_HIDE_KILLMSG|RACEFLAG_FINISHMSG_AS_CHAT|RACEFLAG_KEEP_WANTED_WEAPON)) return -1; |
| 388 | return 0; |
| 389 | } |
| 390 | |
| 391 | } |
| 392 | return -1; |
| 393 | }; |
| 394 | |
| 395 | void CNetObjHandler::DebugDumpSnapshot(const ::CSnapshot *pSnap) const |
| 396 | { |
| 397 | dbg_msg(sys: "snapshot" , fmt: "data_size=%d num_items=%d" , pSnap->DataSize(), pSnap->NumItems()); |
| 398 | for(int i = 0; i < pSnap->NumItems(); i++) |
| 399 | { |
| 400 | const CSnapshotItem *pItem = pSnap->GetItem(Index: i); |
| 401 | int Size = pSnap->GetItemSize(Index: i); |
| 402 | int Type = pSnap->GetItemType(Index: i); |
| 403 | const char *pName = GetObjName(Type); |
| 404 | dbg_msg(sys: "snapshot" , fmt: "\t%s type=%d id=%d size=%d" , pName, pItem->InternalType(), pItem->Id(), Size); |
| 405 | if(!DumpObj(Type, pData: pItem->Data(), Size)) |
| 406 | continue; |
| 407 | |
| 408 | for(size_t b = 0; b < Size / sizeof(int32_t); b++) |
| 409 | dbg_msg(sys: "snapshot" , fmt: "\t\t%3d %12d\t%08x" , (int)b, pItem->Data()[b], pItem->Data()[b]); |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | int CNetObjHandler::DumpObj(int Type, const void *pData, int Size) const |
| 414 | { |
| 415 | char aRawData[512]; |
| 416 | switch(Type) |
| 417 | { |
| 418 | case NETOBJTYPE_PLAYERINPUT: |
| 419 | { |
| 420 | CNetObj_PlayerInput *pObj = (CNetObj_PlayerInput *)pData; |
| 421 | if(sizeof(*pObj) != Size) return -1; |
| 422 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 423 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Direction=%d (min=-1 max=1)" , aRawData, pObj->m_Direction); |
| 424 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 425 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_TargetX=%d" , aRawData, pObj->m_TargetX); |
| 426 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 427 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_TargetY=%d" , aRawData, pObj->m_TargetY); |
| 428 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 3, ((const int *)pData)[3], ((const int *)pData)[3]); |
| 429 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Jump=%d (min=0 max=1)" , aRawData, pObj->m_Jump); |
| 430 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 4, ((const int *)pData)[4], ((const int *)pData)[4]); |
| 431 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Fire=%d" , aRawData, pObj->m_Fire); |
| 432 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 5, ((const int *)pData)[5], ((const int *)pData)[5]); |
| 433 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Hook=%d (min=0 max=1)" , aRawData, pObj->m_Hook); |
| 434 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 6, ((const int *)pData)[6], ((const int *)pData)[6]); |
| 435 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_PlayerFlags=%d (mask=%d)" , aRawData, pObj->m_PlayerFlags, PLAYERFLAG_ADMIN|PLAYERFLAG_CHATTING|PLAYERFLAG_SCOREBOARD|PLAYERFLAG_READY|PLAYERFLAG_DEAD|PLAYERFLAG_WATCHING|PLAYERFLAG_BOT|PLAYERFLAG_AIM); |
| 436 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 7, ((const int *)pData)[7], ((const int *)pData)[7]); |
| 437 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_WantedWeapon=%d (min=0 max=NUM_WEAPONS-1(%d))" , aRawData, pObj->m_WantedWeapon, (int)NUM_WEAPONS-1); |
| 438 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 8, ((const int *)pData)[8], ((const int *)pData)[8]); |
| 439 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_NextWeapon=%d" , aRawData, pObj->m_NextWeapon); |
| 440 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 9, ((const int *)pData)[9], ((const int *)pData)[9]); |
| 441 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_PrevWeapon=%d" , aRawData, pObj->m_PrevWeapon); |
| 442 | return 0; |
| 443 | } |
| 444 | |
| 445 | case NETOBJTYPE_PROJECTILE: |
| 446 | { |
| 447 | CNetObj_Projectile *pObj = (CNetObj_Projectile *)pData; |
| 448 | if(sizeof(*pObj) != Size) return -1; |
| 449 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 450 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 451 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 452 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 453 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 454 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_VelX=%d" , aRawData, pObj->m_VelX); |
| 455 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 3, ((const int *)pData)[3], ((const int *)pData)[3]); |
| 456 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_VelY=%d" , aRawData, pObj->m_VelY); |
| 457 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 4, ((const int *)pData)[4], ((const int *)pData)[4]); |
| 458 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Type=%d (min=0 max=NUM_WEAPONS-1(%d))" , aRawData, pObj->m_Type, (int)NUM_WEAPONS-1); |
| 459 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 5, ((const int *)pData)[5], ((const int *)pData)[5]); |
| 460 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_StartTick=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_StartTick, (int)max_int); |
| 461 | return 0; |
| 462 | } |
| 463 | |
| 464 | case NETOBJTYPE_LASER: |
| 465 | { |
| 466 | CNetObj_Laser *pObj = (CNetObj_Laser *)pData; |
| 467 | if(sizeof(*pObj) != Size) return -1; |
| 468 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 469 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 470 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 471 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 472 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 473 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_FromX=%d" , aRawData, pObj->m_FromX); |
| 474 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 3, ((const int *)pData)[3], ((const int *)pData)[3]); |
| 475 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_FromY=%d" , aRawData, pObj->m_FromY); |
| 476 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 4, ((const int *)pData)[4], ((const int *)pData)[4]); |
| 477 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_StartTick=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_StartTick, (int)max_int); |
| 478 | return 0; |
| 479 | } |
| 480 | |
| 481 | case NETOBJTYPE_PICKUP: |
| 482 | { |
| 483 | CNetObj_Pickup *pObj = (CNetObj_Pickup *)pData; |
| 484 | if(sizeof(*pObj) != Size) return -1; |
| 485 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 486 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 487 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 488 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 489 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 490 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Type=%d (min=0 max=7)" , aRawData, pObj->m_Type); |
| 491 | return 0; |
| 492 | } |
| 493 | |
| 494 | case NETOBJTYPE_FLAG: |
| 495 | { |
| 496 | CNetObj_Flag *pObj = (CNetObj_Flag *)pData; |
| 497 | if(sizeof(*pObj) != Size) return -1; |
| 498 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 499 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 500 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 501 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 502 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 503 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Team=%d (min=TEAM_RED(%d) max=TEAM_BLUE(%d))" , aRawData, pObj->m_Team, (int)TEAM_RED, (int)TEAM_BLUE); |
| 504 | return 0; |
| 505 | } |
| 506 | |
| 507 | case NETOBJTYPE_GAMEDATA: |
| 508 | { |
| 509 | CNetObj_GameData *pObj = (CNetObj_GameData *)pData; |
| 510 | if(sizeof(*pObj) != Size) return -1; |
| 511 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 512 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_GameStartTick=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_GameStartTick, (int)max_int); |
| 513 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 514 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_GameStateFlags=%d (mask=%d)" , aRawData, pObj->m_GameStateFlags, GAMESTATEFLAG_WARMUP|GAMESTATEFLAG_SUDDENDEATH|GAMESTATEFLAG_ROUNDOVER|GAMESTATEFLAG_GAMEOVER|GAMESTATEFLAG_PAUSED|GAMESTATEFLAG_STARTCOUNTDOWN); |
| 515 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 516 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_GameStateEndTick=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_GameStateEndTick, (int)max_int); |
| 517 | return 0; |
| 518 | } |
| 519 | |
| 520 | case NETOBJTYPE_GAMEDATATEAM: |
| 521 | { |
| 522 | CNetObj_GameDataTeam *pObj = (CNetObj_GameDataTeam *)pData; |
| 523 | if(sizeof(*pObj) != Size) return -1; |
| 524 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 525 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_TeamscoreRed=%d" , aRawData, pObj->m_TeamscoreRed); |
| 526 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 527 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_TeamscoreBlue=%d" , aRawData, pObj->m_TeamscoreBlue); |
| 528 | return 0; |
| 529 | } |
| 530 | |
| 531 | case NETOBJTYPE_GAMEDATAFLAG: |
| 532 | { |
| 533 | CNetObj_GameDataFlag *pObj = (CNetObj_GameDataFlag *)pData; |
| 534 | if(sizeof(*pObj) != Size) return -1; |
| 535 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 536 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_FlagCarrierRed=%d (min=FLAG_MISSING(%d) max=MAX_CLIENTS-1(%d))" , aRawData, pObj->m_FlagCarrierRed, (int)FLAG_MISSING, (int)MAX_CLIENTS-1); |
| 537 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 538 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_FlagCarrierBlue=%d (min=FLAG_MISSING(%d) max=MAX_CLIENTS-1(%d))" , aRawData, pObj->m_FlagCarrierBlue, (int)FLAG_MISSING, (int)MAX_CLIENTS-1); |
| 539 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 540 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_FlagDropTickRed=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_FlagDropTickRed, (int)max_int); |
| 541 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 3, ((const int *)pData)[3], ((const int *)pData)[3]); |
| 542 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_FlagDropTickBlue=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_FlagDropTickBlue, (int)max_int); |
| 543 | return 0; |
| 544 | } |
| 545 | |
| 546 | case NETOBJTYPE_CHARACTERCORE: |
| 547 | { |
| 548 | CNetObj_CharacterCore *pObj = (CNetObj_CharacterCore *)pData; |
| 549 | if(sizeof(*pObj) != Size) return -1; |
| 550 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 551 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Tick=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_Tick, (int)max_int); |
| 552 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 553 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 554 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 555 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 556 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 3, ((const int *)pData)[3], ((const int *)pData)[3]); |
| 557 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_VelX=%d" , aRawData, pObj->m_VelX); |
| 558 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 4, ((const int *)pData)[4], ((const int *)pData)[4]); |
| 559 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_VelY=%d" , aRawData, pObj->m_VelY); |
| 560 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 5, ((const int *)pData)[5], ((const int *)pData)[5]); |
| 561 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Angle=%d" , aRawData, pObj->m_Angle); |
| 562 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 6, ((const int *)pData)[6], ((const int *)pData)[6]); |
| 563 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Direction=%d (min=-1 max=1)" , aRawData, pObj->m_Direction); |
| 564 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 7, ((const int *)pData)[7], ((const int *)pData)[7]); |
| 565 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Jumped=%d (min=0 max=3)" , aRawData, pObj->m_Jumped); |
| 566 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 8, ((const int *)pData)[8], ((const int *)pData)[8]); |
| 567 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookedPlayer=%d (min=-1 max=MAX_CLIENTS-1(%d))" , aRawData, pObj->m_HookedPlayer, (int)MAX_CLIENTS-1); |
| 568 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 9, ((const int *)pData)[9], ((const int *)pData)[9]); |
| 569 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookState=%d (min=-1 max=5)" , aRawData, pObj->m_HookState); |
| 570 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 10, ((const int *)pData)[10], ((const int *)pData)[10]); |
| 571 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookTick=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_HookTick, (int)max_int); |
| 572 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 11, ((const int *)pData)[11], ((const int *)pData)[11]); |
| 573 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookX=%d" , aRawData, pObj->m_HookX); |
| 574 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 12, ((const int *)pData)[12], ((const int *)pData)[12]); |
| 575 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookY=%d" , aRawData, pObj->m_HookY); |
| 576 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 13, ((const int *)pData)[13], ((const int *)pData)[13]); |
| 577 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookDx=%d" , aRawData, pObj->m_HookDx); |
| 578 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 14, ((const int *)pData)[14], ((const int *)pData)[14]); |
| 579 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookDy=%d" , aRawData, pObj->m_HookDy); |
| 580 | return 0; |
| 581 | } |
| 582 | |
| 583 | case NETOBJTYPE_CHARACTER: |
| 584 | { |
| 585 | CNetObj_Character *pObj = (CNetObj_Character *)pData; |
| 586 | if(sizeof(*pObj) != Size) return -1; |
| 587 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 588 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Tick=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_Tick, (int)max_int); |
| 589 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 590 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 591 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 592 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 593 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 3, ((const int *)pData)[3], ((const int *)pData)[3]); |
| 594 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_VelX=%d" , aRawData, pObj->m_VelX); |
| 595 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 4, ((const int *)pData)[4], ((const int *)pData)[4]); |
| 596 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_VelY=%d" , aRawData, pObj->m_VelY); |
| 597 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 5, ((const int *)pData)[5], ((const int *)pData)[5]); |
| 598 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Angle=%d" , aRawData, pObj->m_Angle); |
| 599 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 6, ((const int *)pData)[6], ((const int *)pData)[6]); |
| 600 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Direction=%d (min=-1 max=1)" , aRawData, pObj->m_Direction); |
| 601 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 7, ((const int *)pData)[7], ((const int *)pData)[7]); |
| 602 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Jumped=%d (min=0 max=3)" , aRawData, pObj->m_Jumped); |
| 603 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 8, ((const int *)pData)[8], ((const int *)pData)[8]); |
| 604 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookedPlayer=%d (min=-1 max=MAX_CLIENTS-1(%d))" , aRawData, pObj->m_HookedPlayer, (int)MAX_CLIENTS-1); |
| 605 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 9, ((const int *)pData)[9], ((const int *)pData)[9]); |
| 606 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookState=%d (min=-1 max=5)" , aRawData, pObj->m_HookState); |
| 607 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 10, ((const int *)pData)[10], ((const int *)pData)[10]); |
| 608 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookTick=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_HookTick, (int)max_int); |
| 609 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 11, ((const int *)pData)[11], ((const int *)pData)[11]); |
| 610 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookX=%d" , aRawData, pObj->m_HookX); |
| 611 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 12, ((const int *)pData)[12], ((const int *)pData)[12]); |
| 612 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookY=%d" , aRawData, pObj->m_HookY); |
| 613 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 13, ((const int *)pData)[13], ((const int *)pData)[13]); |
| 614 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookDx=%d" , aRawData, pObj->m_HookDx); |
| 615 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 14, ((const int *)pData)[14], ((const int *)pData)[14]); |
| 616 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HookDy=%d" , aRawData, pObj->m_HookDy); |
| 617 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 15, ((const int *)pData)[15], ((const int *)pData)[15]); |
| 618 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Health=%d (min=0 max=10)" , aRawData, pObj->m_Health); |
| 619 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 16, ((const int *)pData)[16], ((const int *)pData)[16]); |
| 620 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Armor=%d (min=0 max=10)" , aRawData, pObj->m_Armor); |
| 621 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 17, ((const int *)pData)[17], ((const int *)pData)[17]); |
| 622 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_AmmoCount=%d" , aRawData, pObj->m_AmmoCount); |
| 623 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 18, ((const int *)pData)[18], ((const int *)pData)[18]); |
| 624 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Weapon=%d (min=-1 max=NUM_WEAPONS-1(%d))" , aRawData, pObj->m_Weapon, (int)NUM_WEAPONS-1); |
| 625 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 19, ((const int *)pData)[19], ((const int *)pData)[19]); |
| 626 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Emote=%d (min=0 max=5)" , aRawData, pObj->m_Emote); |
| 627 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 20, ((const int *)pData)[20], ((const int *)pData)[20]); |
| 628 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_AttackTick=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_AttackTick, (int)max_int); |
| 629 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 21, ((const int *)pData)[21], ((const int *)pData)[21]); |
| 630 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_TriggeredEvents=%d (mask=%d)" , aRawData, pObj->m_TriggeredEvents, COREEVENTFLAG_GROUND_JUMP|COREEVENTFLAG_AIR_JUMP|COREEVENTFLAG_HOOK_ATTACH_PLAYER|COREEVENTFLAG_HOOK_ATTACH_GROUND|COREEVENTFLAG_HOOK_HIT_NOHOOK); |
| 631 | return 0; |
| 632 | } |
| 633 | |
| 634 | case NETOBJTYPE_PLAYERINFO: |
| 635 | { |
| 636 | CNetObj_PlayerInfo *pObj = (CNetObj_PlayerInfo *)pData; |
| 637 | if(sizeof(*pObj) != Size) return -1; |
| 638 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 639 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_PlayerFlags=%d (mask=%d)" , aRawData, pObj->m_PlayerFlags, PLAYERFLAG_ADMIN|PLAYERFLAG_CHATTING|PLAYERFLAG_SCOREBOARD|PLAYERFLAG_READY|PLAYERFLAG_DEAD|PLAYERFLAG_WATCHING|PLAYERFLAG_BOT|PLAYERFLAG_AIM); |
| 640 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 641 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Score=%d" , aRawData, pObj->m_Score); |
| 642 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 643 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Latency=%d" , aRawData, pObj->m_Latency); |
| 644 | return 0; |
| 645 | } |
| 646 | |
| 647 | case NETOBJTYPE_SPECTATORINFO: |
| 648 | { |
| 649 | CNetObj_SpectatorInfo *pObj = (CNetObj_SpectatorInfo *)pData; |
| 650 | if(sizeof(*pObj) != Size) return -1; |
| 651 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 652 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_SpecMode=%d (min=0 max=NUM_SPECMODES-1(%d))" , aRawData, pObj->m_SpecMode, (int)NUM_SPECMODES-1); |
| 653 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 654 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_SpectatorId=%d (min=-1 max=MAX_CLIENTS-1(%d))" , aRawData, pObj->m_SpectatorId, (int)MAX_CLIENTS-1); |
| 655 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 656 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 657 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 3, ((const int *)pData)[3], ((const int *)pData)[3]); |
| 658 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 659 | return 0; |
| 660 | } |
| 661 | |
| 662 | case NETOBJTYPE_DE_CLIENTINFO: |
| 663 | { |
| 664 | CNetObj_De_ClientInfo *pObj = (CNetObj_De_ClientInfo *)pData; |
| 665 | if(sizeof(*pObj) != Size) return -1; |
| 666 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 667 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Local=%d (min=0 max=1)" , aRawData, pObj->m_Local); |
| 668 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 669 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Team=%d (min=TEAM_SPECTATORS(%d) max=TEAM_BLUE(%d))" , aRawData, pObj->m_Team, (int)TEAM_SPECTATORS, (int)TEAM_BLUE); |
| 670 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 671 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 3, ((const int *)pData)[3], ((const int *)pData)[3]); |
| 672 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 4, ((const int *)pData)[4], ((const int *)pData)[4]); |
| 673 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Country=%d" , aRawData, pObj->m_Country); |
| 674 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 5, ((const int *)pData)[5], ((const int *)pData)[5]); |
| 675 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 6, ((const int *)pData)[6], ((const int *)pData)[6]); |
| 676 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 7, ((const int *)pData)[7], ((const int *)pData)[7]); |
| 677 | return 0; |
| 678 | } |
| 679 | |
| 680 | case NETOBJTYPE_DE_GAMEINFO: |
| 681 | { |
| 682 | CNetObj_De_GameInfo *pObj = (CNetObj_De_GameInfo *)pData; |
| 683 | if(sizeof(*pObj) != Size) return -1; |
| 684 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 685 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_GameFlags=%d (mask=%d)" , aRawData, pObj->m_GameFlags, GAMEFLAG_TEAMS|GAMEFLAG_FLAGS|GAMEFLAG_SURVIVAL|GAMEFLAG_RACE); |
| 686 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 687 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_ScoreLimit=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_ScoreLimit, (int)max_int); |
| 688 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 689 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_TimeLimit=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_TimeLimit, (int)max_int); |
| 690 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 3, ((const int *)pData)[3], ((const int *)pData)[3]); |
| 691 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_MatchNum=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_MatchNum, (int)max_int); |
| 692 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 4, ((const int *)pData)[4], ((const int *)pData)[4]); |
| 693 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_MatchCurrent=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_MatchCurrent, (int)max_int); |
| 694 | return 0; |
| 695 | } |
| 696 | |
| 697 | case NETOBJTYPE_DE_TUNEPARAMS: |
| 698 | { |
| 699 | CNetObj_De_TuneParams *pObj = (CNetObj_De_TuneParams *)pData; |
| 700 | if(sizeof(*pObj) != Size) return -1; |
| 701 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 702 | return 0; |
| 703 | } |
| 704 | |
| 705 | case NETEVENTTYPE_COMMON: |
| 706 | { |
| 707 | CNetEvent_Common *pObj = (CNetEvent_Common *)pData; |
| 708 | if(sizeof(*pObj) != Size) return -1; |
| 709 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 710 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 711 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 712 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 713 | return 0; |
| 714 | } |
| 715 | |
| 716 | case NETEVENTTYPE_EXPLOSION: |
| 717 | { |
| 718 | CNetEvent_Explosion *pObj = (CNetEvent_Explosion *)pData; |
| 719 | if(sizeof(*pObj) != Size) return -1; |
| 720 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 721 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 722 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 723 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 724 | return 0; |
| 725 | } |
| 726 | |
| 727 | case NETEVENTTYPE_SPAWN: |
| 728 | { |
| 729 | CNetEvent_Spawn *pObj = (CNetEvent_Spawn *)pData; |
| 730 | if(sizeof(*pObj) != Size) return -1; |
| 731 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 732 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 733 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 734 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 735 | return 0; |
| 736 | } |
| 737 | |
| 738 | case NETEVENTTYPE_HAMMERHIT: |
| 739 | { |
| 740 | CNetEvent_HammerHit *pObj = (CNetEvent_HammerHit *)pData; |
| 741 | if(sizeof(*pObj) != Size) return -1; |
| 742 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 743 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 744 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 745 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 746 | return 0; |
| 747 | } |
| 748 | |
| 749 | case NETEVENTTYPE_DEATH: |
| 750 | { |
| 751 | CNetEvent_Death *pObj = (CNetEvent_Death *)pData; |
| 752 | if(sizeof(*pObj) != Size) return -1; |
| 753 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 754 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 755 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 756 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 757 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 758 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_ClientId=%d (min=0 max=MAX_CLIENTS-1(%d))" , aRawData, pObj->m_ClientId, (int)MAX_CLIENTS-1); |
| 759 | return 0; |
| 760 | } |
| 761 | |
| 762 | case NETEVENTTYPE_SOUNDWORLD: |
| 763 | { |
| 764 | CNetEvent_SoundWorld *pObj = (CNetEvent_SoundWorld *)pData; |
| 765 | if(sizeof(*pObj) != Size) return -1; |
| 766 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 767 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 768 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 769 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 770 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 771 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_SoundId=%d (min=0 max=NUM_SOUNDS-1(%d))" , aRawData, pObj->m_SoundId, (int)NUM_SOUNDS-1); |
| 772 | return 0; |
| 773 | } |
| 774 | |
| 775 | case NETEVENTTYPE_DAMAGE: |
| 776 | { |
| 777 | CNetEvent_Damage *pObj = (CNetEvent_Damage *)pData; |
| 778 | if(sizeof(*pObj) != Size) return -1; |
| 779 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 780 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_X=%d" , aRawData, pObj->m_X); |
| 781 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 782 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Y=%d" , aRawData, pObj->m_Y); |
| 783 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 784 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_ClientId=%d (min=0 max=MAX_CLIENTS-1(%d))" , aRawData, pObj->m_ClientId, (int)MAX_CLIENTS-1); |
| 785 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 3, ((const int *)pData)[3], ((const int *)pData)[3]); |
| 786 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Angle=%d" , aRawData, pObj->m_Angle); |
| 787 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 4, ((const int *)pData)[4], ((const int *)pData)[4]); |
| 788 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_HealthAmount=%d (min=0 max=9)" , aRawData, pObj->m_HealthAmount); |
| 789 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 5, ((const int *)pData)[5], ((const int *)pData)[5]); |
| 790 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_ArmorAmount=%d (min=0 max=9)" , aRawData, pObj->m_ArmorAmount); |
| 791 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 6, ((const int *)pData)[6], ((const int *)pData)[6]); |
| 792 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Self=%d (min=0 max=1)" , aRawData, pObj->m_Self); |
| 793 | return 0; |
| 794 | } |
| 795 | |
| 796 | case NETOBJTYPE_PLAYERINFORACE: |
| 797 | { |
| 798 | CNetObj_PlayerInfoRace *pObj = (CNetObj_PlayerInfoRace *)pData; |
| 799 | if(sizeof(*pObj) != Size) return -1; |
| 800 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 801 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_RaceStartTick=%d (min=0 max=max_int(%d))" , aRawData, pObj->m_RaceStartTick, (int)max_int); |
| 802 | return 0; |
| 803 | } |
| 804 | |
| 805 | case NETOBJTYPE_GAMEDATARACE: |
| 806 | { |
| 807 | CNetObj_GameDataRace *pObj = (CNetObj_GameDataRace *)pData; |
| 808 | if(sizeof(*pObj) != Size) return -1; |
| 809 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 0, ((const int *)pData)[0], ((const int *)pData)[0]); |
| 810 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_BestTime=%d (min=-1 max=max_int(%d))" , aRawData, pObj->m_BestTime, (int)max_int); |
| 811 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 1, ((const int *)pData)[1], ((const int *)pData)[1]); |
| 812 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_Precision=%d (min=0 max=3)" , aRawData, pObj->m_Precision); |
| 813 | str_format(buffer: aRawData, buffer_size: sizeof(aRawData), format: "\t\t%3d %12d\t%08x" , 2, ((const int *)pData)[2], ((const int *)pData)[2]); |
| 814 | dbg_msg(sys: "snapshot" , fmt: "%s\tm_RaceFlags=%d (mask=%d)" , aRawData, pObj->m_RaceFlags, RACEFLAG_HIDE_KILLMSG|RACEFLAG_FINISHMSG_AS_CHAT|RACEFLAG_KEEP_WANTED_WEAPON); |
| 815 | return 0; |
| 816 | } |
| 817 | |
| 818 | } |
| 819 | return -1; |
| 820 | }; |
| 821 | |
| 822 | void *CNetObjHandler::SecureUnpackMsg(int Type, CUnpacker *pUnpacker) |
| 823 | { |
| 824 | m_pMsgFailedOn = 0; |
| 825 | m_pObjFailedOn = 0; |
| 826 | switch(Type) |
| 827 | { |
| 828 | case NETMSGTYPE_SV_MOTD: |
| 829 | { |
| 830 | CNetMsg_Sv_Motd *pMsg = (CNetMsg_Sv_Motd *)m_aMsgData; |
| 831 | (void)pMsg; |
| 832 | pMsg->m_pMessage = pUnpacker->GetString(); |
| 833 | } break; |
| 834 | |
| 835 | case NETMSGTYPE_SV_BROADCAST: |
| 836 | { |
| 837 | CNetMsg_Sv_Broadcast *pMsg = (CNetMsg_Sv_Broadcast *)m_aMsgData; |
| 838 | (void)pMsg; |
| 839 | pMsg->m_pMessage = pUnpacker->GetString(); |
| 840 | } break; |
| 841 | |
| 842 | case NETMSGTYPE_SV_CHAT: |
| 843 | { |
| 844 | CNetMsg_Sv_Chat *pMsg = (CNetMsg_Sv_Chat *)m_aMsgData; |
| 845 | (void)pMsg; |
| 846 | pMsg->m_Mode = pUnpacker->GetInt(); |
| 847 | pMsg->m_ClientId = pUnpacker->GetInt(); |
| 848 | pMsg->m_TargetId = pUnpacker->GetInt(); |
| 849 | pMsg->m_pMessage = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 850 | if(!CheckInt(pErrorMsg: "m_Mode" , Value: pMsg->m_Mode, Min: 0, Max: NUM_CHATS-1)) break; |
| 851 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pMsg->m_ClientId, Min: -1, Max: MAX_CLIENTS-1)) break; |
| 852 | if(!CheckInt(pErrorMsg: "m_TargetId" , Value: pMsg->m_TargetId, Min: -1, Max: MAX_CLIENTS-1)) break; |
| 853 | } break; |
| 854 | |
| 855 | case NETMSGTYPE_SV_TEAM: |
| 856 | { |
| 857 | CNetMsg_Sv_Team *pMsg = (CNetMsg_Sv_Team *)m_aMsgData; |
| 858 | (void)pMsg; |
| 859 | pMsg->m_ClientId = pUnpacker->GetInt(); |
| 860 | pMsg->m_Team = pUnpacker->GetInt(); |
| 861 | pMsg->m_Silent = pUnpacker->GetInt(); |
| 862 | pMsg->m_CooldownTick = pUnpacker->GetInt(); |
| 863 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pMsg->m_ClientId, Min: -1, Max: MAX_CLIENTS-1)) break; |
| 864 | if(!CheckInt(pErrorMsg: "m_Team" , Value: pMsg->m_Team, Min: TEAM_SPECTATORS, Max: TEAM_BLUE)) break; |
| 865 | if(!CheckInt(pErrorMsg: "m_Silent" , Value: pMsg->m_Silent, Min: 0, Max: 1)) break; |
| 866 | if(!CheckInt(pErrorMsg: "m_CooldownTick" , Value: pMsg->m_CooldownTick, Min: 0, Max: max_int)) break; |
| 867 | } break; |
| 868 | |
| 869 | case NETMSGTYPE_SV_KILLMSG: |
| 870 | { |
| 871 | CNetMsg_Sv_KillMsg *pMsg = (CNetMsg_Sv_KillMsg *)m_aMsgData; |
| 872 | (void)pMsg; |
| 873 | pMsg->m_Killer = pUnpacker->GetInt(); |
| 874 | pMsg->m_Victim = pUnpacker->GetInt(); |
| 875 | pMsg->m_Weapon = pUnpacker->GetInt(); |
| 876 | pMsg->m_ModeSpecial = pUnpacker->GetInt(); |
| 877 | if(!CheckInt(pErrorMsg: "m_Killer" , Value: pMsg->m_Killer, Min: -2, Max: MAX_CLIENTS-1)) break; |
| 878 | if(!CheckInt(pErrorMsg: "m_Victim" , Value: pMsg->m_Victim, Min: 0, Max: MAX_CLIENTS-1)) break; |
| 879 | if(!CheckInt(pErrorMsg: "m_Weapon" , Value: pMsg->m_Weapon, Min: -3, Max: NUM_WEAPONS-1)) break; |
| 880 | } break; |
| 881 | |
| 882 | case NETMSGTYPE_SV_TUNEPARAMS: |
| 883 | { |
| 884 | CNetMsg_Sv_TuneParams *pMsg = (CNetMsg_Sv_TuneParams *)m_aMsgData; |
| 885 | (void)pMsg; |
| 886 | } break; |
| 887 | |
| 888 | case NETMSGTYPE_UNUSED: |
| 889 | { |
| 890 | CNetMsg_Unused *pMsg = (CNetMsg_Unused *)m_aMsgData; |
| 891 | (void)pMsg; |
| 892 | } break; |
| 893 | |
| 894 | case NETMSGTYPE_SV_READYTOENTER: |
| 895 | { |
| 896 | CNetMsg_Sv_ReadyToEnter *pMsg = (CNetMsg_Sv_ReadyToEnter *)m_aMsgData; |
| 897 | (void)pMsg; |
| 898 | } break; |
| 899 | |
| 900 | case NETMSGTYPE_SV_WEAPONPICKUP: |
| 901 | { |
| 902 | CNetMsg_Sv_WeaponPickup *pMsg = (CNetMsg_Sv_WeaponPickup *)m_aMsgData; |
| 903 | (void)pMsg; |
| 904 | pMsg->m_Weapon = pUnpacker->GetInt(); |
| 905 | if(!CheckInt(pErrorMsg: "m_Weapon" , Value: pMsg->m_Weapon, Min: 0, Max: NUM_WEAPONS-1)) break; |
| 906 | } break; |
| 907 | |
| 908 | case NETMSGTYPE_SV_EMOTICON: |
| 909 | { |
| 910 | CNetMsg_Sv_Emoticon *pMsg = (CNetMsg_Sv_Emoticon *)m_aMsgData; |
| 911 | (void)pMsg; |
| 912 | pMsg->m_ClientId = pUnpacker->GetInt(); |
| 913 | pMsg->m_Emoticon = pUnpacker->GetInt(); |
| 914 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pMsg->m_ClientId, Min: 0, Max: MAX_CLIENTS-1)) break; |
| 915 | if(!CheckInt(pErrorMsg: "m_Emoticon" , Value: pMsg->m_Emoticon, Min: 0, Max: 15)) break; |
| 916 | } break; |
| 917 | |
| 918 | case NETMSGTYPE_SV_VOTECLEAROPTIONS: |
| 919 | { |
| 920 | CNetMsg_Sv_VoteClearOptions *pMsg = (CNetMsg_Sv_VoteClearOptions *)m_aMsgData; |
| 921 | (void)pMsg; |
| 922 | } break; |
| 923 | |
| 924 | case NETMSGTYPE_SV_VOTEOPTIONLISTADD: |
| 925 | { |
| 926 | CNetMsg_Sv_VoteOptionListAdd *pMsg = (CNetMsg_Sv_VoteOptionListAdd *)m_aMsgData; |
| 927 | (void)pMsg; |
| 928 | } break; |
| 929 | |
| 930 | case NETMSGTYPE_SV_VOTEOPTIONADD: |
| 931 | { |
| 932 | CNetMsg_Sv_VoteOptionAdd *pMsg = (CNetMsg_Sv_VoteOptionAdd *)m_aMsgData; |
| 933 | (void)pMsg; |
| 934 | pMsg->m_pDescription = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 935 | } break; |
| 936 | |
| 937 | case NETMSGTYPE_SV_VOTEOPTIONREMOVE: |
| 938 | { |
| 939 | CNetMsg_Sv_VoteOptionRemove *pMsg = (CNetMsg_Sv_VoteOptionRemove *)m_aMsgData; |
| 940 | (void)pMsg; |
| 941 | pMsg->m_pDescription = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 942 | } break; |
| 943 | |
| 944 | case NETMSGTYPE_SV_VOTESET: |
| 945 | { |
| 946 | CNetMsg_Sv_VoteSet *pMsg = (CNetMsg_Sv_VoteSet *)m_aMsgData; |
| 947 | (void)pMsg; |
| 948 | pMsg->m_ClientId = pUnpacker->GetInt(); |
| 949 | pMsg->m_Type = pUnpacker->GetInt(); |
| 950 | pMsg->m_Timeout = pUnpacker->GetInt(); |
| 951 | pMsg->m_pDescription = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 952 | pMsg->m_pReason = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 953 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pMsg->m_ClientId, Min: -1, Max: MAX_CLIENTS-1)) break; |
| 954 | if(!CheckInt(pErrorMsg: "m_Type" , Value: pMsg->m_Type, Min: 0, Max: 6)) break; |
| 955 | if(!CheckInt(pErrorMsg: "m_Timeout" , Value: pMsg->m_Timeout, Min: 0, Max: 60)) break; |
| 956 | } break; |
| 957 | |
| 958 | case NETMSGTYPE_SV_VOTESTATUS: |
| 959 | { |
| 960 | CNetMsg_Sv_VoteStatus *pMsg = (CNetMsg_Sv_VoteStatus *)m_aMsgData; |
| 961 | (void)pMsg; |
| 962 | pMsg->m_Yes = pUnpacker->GetInt(); |
| 963 | pMsg->m_No = pUnpacker->GetInt(); |
| 964 | pMsg->m_Pass = pUnpacker->GetInt(); |
| 965 | pMsg->m_Total = pUnpacker->GetInt(); |
| 966 | if(!CheckInt(pErrorMsg: "m_Yes" , Value: pMsg->m_Yes, Min: 0, Max: MAX_CLIENTS)) break; |
| 967 | if(!CheckInt(pErrorMsg: "m_No" , Value: pMsg->m_No, Min: 0, Max: MAX_CLIENTS)) break; |
| 968 | if(!CheckInt(pErrorMsg: "m_Pass" , Value: pMsg->m_Pass, Min: 0, Max: MAX_CLIENTS)) break; |
| 969 | if(!CheckInt(pErrorMsg: "m_Total" , Value: pMsg->m_Total, Min: 0, Max: MAX_CLIENTS)) break; |
| 970 | } break; |
| 971 | |
| 972 | case NETMSGTYPE_SV_SERVERSETTINGS: |
| 973 | { |
| 974 | CNetMsg_Sv_ServerSettings *pMsg = (CNetMsg_Sv_ServerSettings *)m_aMsgData; |
| 975 | (void)pMsg; |
| 976 | pMsg->m_KickVote = pUnpacker->GetInt(); |
| 977 | pMsg->m_KickMin = pUnpacker->GetInt(); |
| 978 | pMsg->m_SpecVote = pUnpacker->GetInt(); |
| 979 | pMsg->m_TeamLock = pUnpacker->GetInt(); |
| 980 | pMsg->m_TeamBalance = pUnpacker->GetInt(); |
| 981 | pMsg->m_PlayerSlots = pUnpacker->GetInt(); |
| 982 | if(!CheckInt(pErrorMsg: "m_KickVote" , Value: pMsg->m_KickVote, Min: 0, Max: 1)) break; |
| 983 | if(!CheckInt(pErrorMsg: "m_KickMin" , Value: pMsg->m_KickMin, Min: 0, Max: MAX_CLIENTS)) break; |
| 984 | if(!CheckInt(pErrorMsg: "m_SpecVote" , Value: pMsg->m_SpecVote, Min: 0, Max: 1)) break; |
| 985 | if(!CheckInt(pErrorMsg: "m_TeamLock" , Value: pMsg->m_TeamLock, Min: 0, Max: 1)) break; |
| 986 | if(!CheckInt(pErrorMsg: "m_TeamBalance" , Value: pMsg->m_TeamBalance, Min: 0, Max: 1)) break; |
| 987 | if(!CheckInt(pErrorMsg: "m_PlayerSlots" , Value: pMsg->m_PlayerSlots, Min: 0, Max: MAX_CLIENTS)) break; |
| 988 | } break; |
| 989 | |
| 990 | case NETMSGTYPE_SV_CLIENTINFO: |
| 991 | { |
| 992 | CNetMsg_Sv_ClientInfo *pMsg = (CNetMsg_Sv_ClientInfo *)m_aMsgData; |
| 993 | (void)pMsg; |
| 994 | pMsg->m_ClientId = pUnpacker->GetInt(); |
| 995 | pMsg->m_Local = pUnpacker->GetInt(); |
| 996 | pMsg->m_Team = pUnpacker->GetInt(); |
| 997 | pMsg->m_pName = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 998 | pMsg->m_pClan = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 999 | pMsg->m_Country = pUnpacker->GetInt(); |
| 1000 | pMsg->m_apSkinPartNames[0] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1001 | pMsg->m_apSkinPartNames[1] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1002 | pMsg->m_apSkinPartNames[2] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1003 | pMsg->m_apSkinPartNames[3] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1004 | pMsg->m_apSkinPartNames[4] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1005 | pMsg->m_apSkinPartNames[5] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1006 | pMsg->m_aUseCustomColors[0] = pUnpacker->GetInt(); |
| 1007 | pMsg->m_aUseCustomColors[1] = pUnpacker->GetInt(); |
| 1008 | pMsg->m_aUseCustomColors[2] = pUnpacker->GetInt(); |
| 1009 | pMsg->m_aUseCustomColors[3] = pUnpacker->GetInt(); |
| 1010 | pMsg->m_aUseCustomColors[4] = pUnpacker->GetInt(); |
| 1011 | pMsg->m_aUseCustomColors[5] = pUnpacker->GetInt(); |
| 1012 | pMsg->m_aSkinPartColors[0] = pUnpacker->GetInt(); |
| 1013 | pMsg->m_aSkinPartColors[1] = pUnpacker->GetInt(); |
| 1014 | pMsg->m_aSkinPartColors[2] = pUnpacker->GetInt(); |
| 1015 | pMsg->m_aSkinPartColors[3] = pUnpacker->GetInt(); |
| 1016 | pMsg->m_aSkinPartColors[4] = pUnpacker->GetInt(); |
| 1017 | pMsg->m_aSkinPartColors[5] = pUnpacker->GetInt(); |
| 1018 | pMsg->m_Silent = pUnpacker->GetInt(); |
| 1019 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pMsg->m_ClientId, Min: 0, Max: MAX_CLIENTS-1)) break; |
| 1020 | if(!CheckInt(pErrorMsg: "m_Local" , Value: pMsg->m_Local, Min: 0, Max: 1)) break; |
| 1021 | if(!CheckInt(pErrorMsg: "m_Team" , Value: pMsg->m_Team, Min: TEAM_SPECTATORS, Max: TEAM_BLUE)) break; |
| 1022 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[0]" , Value: pMsg->m_aUseCustomColors[0], Min: 0, Max: 1)) break; |
| 1023 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[1]" , Value: pMsg->m_aUseCustomColors[1], Min: 0, Max: 1)) break; |
| 1024 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[2]" , Value: pMsg->m_aUseCustomColors[2], Min: 0, Max: 1)) break; |
| 1025 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[3]" , Value: pMsg->m_aUseCustomColors[3], Min: 0, Max: 1)) break; |
| 1026 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[4]" , Value: pMsg->m_aUseCustomColors[4], Min: 0, Max: 1)) break; |
| 1027 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[5]" , Value: pMsg->m_aUseCustomColors[5], Min: 0, Max: 1)) break; |
| 1028 | if(!CheckInt(pErrorMsg: "m_Silent" , Value: pMsg->m_Silent, Min: 0, Max: 1)) break; |
| 1029 | } break; |
| 1030 | |
| 1031 | case NETMSGTYPE_SV_GAMEINFO: |
| 1032 | { |
| 1033 | CNetMsg_Sv_GameInfo *pMsg = (CNetMsg_Sv_GameInfo *)m_aMsgData; |
| 1034 | (void)pMsg; |
| 1035 | pMsg->m_GameFlags = pUnpacker->GetInt(); |
| 1036 | pMsg->m_ScoreLimit = pUnpacker->GetInt(); |
| 1037 | pMsg->m_TimeLimit = pUnpacker->GetInt(); |
| 1038 | pMsg->m_MatchNum = pUnpacker->GetInt(); |
| 1039 | pMsg->m_MatchCurrent = pUnpacker->GetInt(); |
| 1040 | if(!CheckFlag(pErrorMsg: "m_GameFlags" , Value: pMsg->m_GameFlags, Mask: GAMEFLAG_TEAMS|GAMEFLAG_FLAGS|GAMEFLAG_SURVIVAL|GAMEFLAG_RACE)) break; |
| 1041 | if(!CheckInt(pErrorMsg: "m_ScoreLimit" , Value: pMsg->m_ScoreLimit, Min: 0, Max: max_int)) break; |
| 1042 | if(!CheckInt(pErrorMsg: "m_TimeLimit" , Value: pMsg->m_TimeLimit, Min: 0, Max: max_int)) break; |
| 1043 | if(!CheckInt(pErrorMsg: "m_MatchNum" , Value: pMsg->m_MatchNum, Min: 0, Max: max_int)) break; |
| 1044 | if(!CheckInt(pErrorMsg: "m_MatchCurrent" , Value: pMsg->m_MatchCurrent, Min: 0, Max: max_int)) break; |
| 1045 | } break; |
| 1046 | |
| 1047 | case NETMSGTYPE_SV_CLIENTDROP: |
| 1048 | { |
| 1049 | CNetMsg_Sv_ClientDrop *pMsg = (CNetMsg_Sv_ClientDrop *)m_aMsgData; |
| 1050 | (void)pMsg; |
| 1051 | pMsg->m_ClientId = pUnpacker->GetInt(); |
| 1052 | pMsg->m_pReason = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1053 | pMsg->m_Silent = pUnpacker->GetInt(); |
| 1054 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pMsg->m_ClientId, Min: 0, Max: MAX_CLIENTS-1)) break; |
| 1055 | if(!CheckInt(pErrorMsg: "m_Silent" , Value: pMsg->m_Silent, Min: 0, Max: 1)) break; |
| 1056 | } break; |
| 1057 | |
| 1058 | case NETMSGTYPE_SV_GAMEMSG: |
| 1059 | { |
| 1060 | CNetMsg_Sv_GameMsg *pMsg = (CNetMsg_Sv_GameMsg *)m_aMsgData; |
| 1061 | (void)pMsg; |
| 1062 | } break; |
| 1063 | |
| 1064 | case NETMSGTYPE_DE_CLIENTENTER: |
| 1065 | { |
| 1066 | CNetMsg_De_ClientEnter *pMsg = (CNetMsg_De_ClientEnter *)m_aMsgData; |
| 1067 | (void)pMsg; |
| 1068 | pMsg->m_pName = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1069 | pMsg->m_ClientId = pUnpacker->GetInt(); |
| 1070 | pMsg->m_Team = pUnpacker->GetInt(); |
| 1071 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pMsg->m_ClientId, Min: -1, Max: MAX_CLIENTS-1)) break; |
| 1072 | if(!CheckInt(pErrorMsg: "m_Team" , Value: pMsg->m_Team, Min: TEAM_SPECTATORS, Max: TEAM_BLUE)) break; |
| 1073 | } break; |
| 1074 | |
| 1075 | case NETMSGTYPE_DE_CLIENTLEAVE: |
| 1076 | { |
| 1077 | CNetMsg_De_ClientLeave *pMsg = (CNetMsg_De_ClientLeave *)m_aMsgData; |
| 1078 | (void)pMsg; |
| 1079 | pMsg->m_pName = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1080 | pMsg->m_ClientId = pUnpacker->GetInt(); |
| 1081 | pMsg->m_pReason = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1082 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pMsg->m_ClientId, Min: -1, Max: MAX_CLIENTS-1)) break; |
| 1083 | } break; |
| 1084 | |
| 1085 | case NETMSGTYPE_CL_SAY: |
| 1086 | { |
| 1087 | CNetMsg_Cl_Say *pMsg = (CNetMsg_Cl_Say *)m_aMsgData; |
| 1088 | (void)pMsg; |
| 1089 | pMsg->m_Mode = pUnpacker->GetInt(); |
| 1090 | pMsg->m_Target = pUnpacker->GetInt(); |
| 1091 | pMsg->m_pMessage = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1092 | if(!CheckInt(pErrorMsg: "m_Mode" , Value: pMsg->m_Mode, Min: 0, Max: NUM_CHATS-1)) break; |
| 1093 | if(!CheckInt(pErrorMsg: "m_Target" , Value: pMsg->m_Target, Min: -1, Max: MAX_CLIENTS-1)) break; |
| 1094 | } break; |
| 1095 | |
| 1096 | case NETMSGTYPE_CL_SETTEAM: |
| 1097 | { |
| 1098 | CNetMsg_Cl_SetTeam *pMsg = (CNetMsg_Cl_SetTeam *)m_aMsgData; |
| 1099 | (void)pMsg; |
| 1100 | pMsg->m_Team = pUnpacker->GetInt(); |
| 1101 | if(!CheckInt(pErrorMsg: "m_Team" , Value: pMsg->m_Team, Min: TEAM_SPECTATORS, Max: TEAM_BLUE)) break; |
| 1102 | } break; |
| 1103 | |
| 1104 | case NETMSGTYPE_CL_SETSPECTATORMODE: |
| 1105 | { |
| 1106 | CNetMsg_Cl_SetSpectatorMode *pMsg = (CNetMsg_Cl_SetSpectatorMode *)m_aMsgData; |
| 1107 | (void)pMsg; |
| 1108 | pMsg->m_SpecMode = pUnpacker->GetInt(); |
| 1109 | pMsg->m_SpectatorId = pUnpacker->GetInt(); |
| 1110 | if(!CheckInt(pErrorMsg: "m_SpecMode" , Value: pMsg->m_SpecMode, Min: 0, Max: NUM_SPECMODES-1)) break; |
| 1111 | if(!CheckInt(pErrorMsg: "m_SpectatorId" , Value: pMsg->m_SpectatorId, Min: -1, Max: MAX_CLIENTS-1)) break; |
| 1112 | } break; |
| 1113 | |
| 1114 | case NETMSGTYPE_CL_STARTINFO: |
| 1115 | { |
| 1116 | CNetMsg_Cl_StartInfo *pMsg = (CNetMsg_Cl_StartInfo *)m_aMsgData; |
| 1117 | (void)pMsg; |
| 1118 | pMsg->m_pName = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1119 | pMsg->m_pClan = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1120 | pMsg->m_Country = pUnpacker->GetInt(); |
| 1121 | pMsg->m_apSkinPartNames[0] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1122 | pMsg->m_apSkinPartNames[1] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1123 | pMsg->m_apSkinPartNames[2] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1124 | pMsg->m_apSkinPartNames[3] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1125 | pMsg->m_apSkinPartNames[4] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1126 | pMsg->m_apSkinPartNames[5] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1127 | pMsg->m_aUseCustomColors[0] = pUnpacker->GetInt(); |
| 1128 | pMsg->m_aUseCustomColors[1] = pUnpacker->GetInt(); |
| 1129 | pMsg->m_aUseCustomColors[2] = pUnpacker->GetInt(); |
| 1130 | pMsg->m_aUseCustomColors[3] = pUnpacker->GetInt(); |
| 1131 | pMsg->m_aUseCustomColors[4] = pUnpacker->GetInt(); |
| 1132 | pMsg->m_aUseCustomColors[5] = pUnpacker->GetInt(); |
| 1133 | pMsg->m_aSkinPartColors[0] = pUnpacker->GetInt(); |
| 1134 | pMsg->m_aSkinPartColors[1] = pUnpacker->GetInt(); |
| 1135 | pMsg->m_aSkinPartColors[2] = pUnpacker->GetInt(); |
| 1136 | pMsg->m_aSkinPartColors[3] = pUnpacker->GetInt(); |
| 1137 | pMsg->m_aSkinPartColors[4] = pUnpacker->GetInt(); |
| 1138 | pMsg->m_aSkinPartColors[5] = pUnpacker->GetInt(); |
| 1139 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[0]" , Value: pMsg->m_aUseCustomColors[0], Min: 0, Max: 1)) break; |
| 1140 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[1]" , Value: pMsg->m_aUseCustomColors[1], Min: 0, Max: 1)) break; |
| 1141 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[2]" , Value: pMsg->m_aUseCustomColors[2], Min: 0, Max: 1)) break; |
| 1142 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[3]" , Value: pMsg->m_aUseCustomColors[3], Min: 0, Max: 1)) break; |
| 1143 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[4]" , Value: pMsg->m_aUseCustomColors[4], Min: 0, Max: 1)) break; |
| 1144 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[5]" , Value: pMsg->m_aUseCustomColors[5], Min: 0, Max: 1)) break; |
| 1145 | } break; |
| 1146 | |
| 1147 | case NETMSGTYPE_CL_KILL: |
| 1148 | { |
| 1149 | CNetMsg_Cl_Kill *pMsg = (CNetMsg_Cl_Kill *)m_aMsgData; |
| 1150 | (void)pMsg; |
| 1151 | } break; |
| 1152 | |
| 1153 | case NETMSGTYPE_CL_READYCHANGE: |
| 1154 | { |
| 1155 | CNetMsg_Cl_ReadyChange *pMsg = (CNetMsg_Cl_ReadyChange *)m_aMsgData; |
| 1156 | (void)pMsg; |
| 1157 | } break; |
| 1158 | |
| 1159 | case NETMSGTYPE_CL_EMOTICON: |
| 1160 | { |
| 1161 | CNetMsg_Cl_Emoticon *pMsg = (CNetMsg_Cl_Emoticon *)m_aMsgData; |
| 1162 | (void)pMsg; |
| 1163 | pMsg->m_Emoticon = pUnpacker->GetInt(); |
| 1164 | if(!CheckInt(pErrorMsg: "m_Emoticon" , Value: pMsg->m_Emoticon, Min: 0, Max: 15)) break; |
| 1165 | } break; |
| 1166 | |
| 1167 | case NETMSGTYPE_CL_VOTE: |
| 1168 | { |
| 1169 | CNetMsg_Cl_Vote *pMsg = (CNetMsg_Cl_Vote *)m_aMsgData; |
| 1170 | (void)pMsg; |
| 1171 | pMsg->m_Vote = pUnpacker->GetInt(); |
| 1172 | if(!CheckInt(pErrorMsg: "m_Vote" , Value: pMsg->m_Vote, Min: -1, Max: 1)) break; |
| 1173 | } break; |
| 1174 | |
| 1175 | case NETMSGTYPE_CL_CALLVOTE: |
| 1176 | { |
| 1177 | CNetMsg_Cl_CallVote *pMsg = (CNetMsg_Cl_CallVote *)m_aMsgData; |
| 1178 | (void)pMsg; |
| 1179 | pMsg->m_pType = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1180 | pMsg->m_pValue = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1181 | pMsg->m_pReason = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1182 | pMsg->m_Force = pUnpacker->GetInt(); |
| 1183 | if(!CheckInt(pErrorMsg: "m_Force" , Value: pMsg->m_Force, Min: 0, Max: 1)) break; |
| 1184 | } break; |
| 1185 | |
| 1186 | case NETMSGTYPE_SV_SKINCHANGE: |
| 1187 | { |
| 1188 | CNetMsg_Sv_SkinChange *pMsg = (CNetMsg_Sv_SkinChange *)m_aMsgData; |
| 1189 | (void)pMsg; |
| 1190 | pMsg->m_ClientId = pUnpacker->GetInt(); |
| 1191 | pMsg->m_apSkinPartNames[0] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1192 | pMsg->m_apSkinPartNames[1] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1193 | pMsg->m_apSkinPartNames[2] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1194 | pMsg->m_apSkinPartNames[3] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1195 | pMsg->m_apSkinPartNames[4] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1196 | pMsg->m_apSkinPartNames[5] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1197 | pMsg->m_aUseCustomColors[0] = pUnpacker->GetInt(); |
| 1198 | pMsg->m_aUseCustomColors[1] = pUnpacker->GetInt(); |
| 1199 | pMsg->m_aUseCustomColors[2] = pUnpacker->GetInt(); |
| 1200 | pMsg->m_aUseCustomColors[3] = pUnpacker->GetInt(); |
| 1201 | pMsg->m_aUseCustomColors[4] = pUnpacker->GetInt(); |
| 1202 | pMsg->m_aUseCustomColors[5] = pUnpacker->GetInt(); |
| 1203 | pMsg->m_aSkinPartColors[0] = pUnpacker->GetInt(); |
| 1204 | pMsg->m_aSkinPartColors[1] = pUnpacker->GetInt(); |
| 1205 | pMsg->m_aSkinPartColors[2] = pUnpacker->GetInt(); |
| 1206 | pMsg->m_aSkinPartColors[3] = pUnpacker->GetInt(); |
| 1207 | pMsg->m_aSkinPartColors[4] = pUnpacker->GetInt(); |
| 1208 | pMsg->m_aSkinPartColors[5] = pUnpacker->GetInt(); |
| 1209 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pMsg->m_ClientId, Min: 0, Max: MAX_CLIENTS-1)) break; |
| 1210 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[0]" , Value: pMsg->m_aUseCustomColors[0], Min: 0, Max: 1)) break; |
| 1211 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[1]" , Value: pMsg->m_aUseCustomColors[1], Min: 0, Max: 1)) break; |
| 1212 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[2]" , Value: pMsg->m_aUseCustomColors[2], Min: 0, Max: 1)) break; |
| 1213 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[3]" , Value: pMsg->m_aUseCustomColors[3], Min: 0, Max: 1)) break; |
| 1214 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[4]" , Value: pMsg->m_aUseCustomColors[4], Min: 0, Max: 1)) break; |
| 1215 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[5]" , Value: pMsg->m_aUseCustomColors[5], Min: 0, Max: 1)) break; |
| 1216 | } break; |
| 1217 | |
| 1218 | case NETMSGTYPE_CL_SKINCHANGE: |
| 1219 | { |
| 1220 | CNetMsg_Cl_SkinChange *pMsg = (CNetMsg_Cl_SkinChange *)m_aMsgData; |
| 1221 | (void)pMsg; |
| 1222 | pMsg->m_apSkinPartNames[0] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1223 | pMsg->m_apSkinPartNames[1] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1224 | pMsg->m_apSkinPartNames[2] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1225 | pMsg->m_apSkinPartNames[3] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1226 | pMsg->m_apSkinPartNames[4] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1227 | pMsg->m_apSkinPartNames[5] = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1228 | pMsg->m_aUseCustomColors[0] = pUnpacker->GetInt(); |
| 1229 | pMsg->m_aUseCustomColors[1] = pUnpacker->GetInt(); |
| 1230 | pMsg->m_aUseCustomColors[2] = pUnpacker->GetInt(); |
| 1231 | pMsg->m_aUseCustomColors[3] = pUnpacker->GetInt(); |
| 1232 | pMsg->m_aUseCustomColors[4] = pUnpacker->GetInt(); |
| 1233 | pMsg->m_aUseCustomColors[5] = pUnpacker->GetInt(); |
| 1234 | pMsg->m_aSkinPartColors[0] = pUnpacker->GetInt(); |
| 1235 | pMsg->m_aSkinPartColors[1] = pUnpacker->GetInt(); |
| 1236 | pMsg->m_aSkinPartColors[2] = pUnpacker->GetInt(); |
| 1237 | pMsg->m_aSkinPartColors[3] = pUnpacker->GetInt(); |
| 1238 | pMsg->m_aSkinPartColors[4] = pUnpacker->GetInt(); |
| 1239 | pMsg->m_aSkinPartColors[5] = pUnpacker->GetInt(); |
| 1240 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[0]" , Value: pMsg->m_aUseCustomColors[0], Min: 0, Max: 1)) break; |
| 1241 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[1]" , Value: pMsg->m_aUseCustomColors[1], Min: 0, Max: 1)) break; |
| 1242 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[2]" , Value: pMsg->m_aUseCustomColors[2], Min: 0, Max: 1)) break; |
| 1243 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[3]" , Value: pMsg->m_aUseCustomColors[3], Min: 0, Max: 1)) break; |
| 1244 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[4]" , Value: pMsg->m_aUseCustomColors[4], Min: 0, Max: 1)) break; |
| 1245 | if(!CheckInt(pErrorMsg: "m_aUseCustomColors[5]" , Value: pMsg->m_aUseCustomColors[5], Min: 0, Max: 1)) break; |
| 1246 | } break; |
| 1247 | |
| 1248 | case NETMSGTYPE_SV_RACEFINISH: |
| 1249 | { |
| 1250 | CNetMsg_Sv_RaceFinish *pMsg = (CNetMsg_Sv_RaceFinish *)m_aMsgData; |
| 1251 | (void)pMsg; |
| 1252 | pMsg->m_ClientId = pUnpacker->GetInt(); |
| 1253 | pMsg->m_Time = pUnpacker->GetInt(); |
| 1254 | pMsg->m_Diff = pUnpacker->GetInt(); |
| 1255 | pMsg->m_RecordPersonal = pUnpacker->GetInt(); |
| 1256 | pMsg->m_RecordServer = pUnpacker->GetIntOrDefault(Default: 0); |
| 1257 | if(!CheckInt(pErrorMsg: "m_ClientId" , Value: pMsg->m_ClientId, Min: 0, Max: MAX_CLIENTS-1)) break; |
| 1258 | if(!CheckInt(pErrorMsg: "m_Time" , Value: pMsg->m_Time, Min: -1, Max: max_int)) break; |
| 1259 | if(!CheckInt(pErrorMsg: "m_RecordPersonal" , Value: pMsg->m_RecordPersonal, Min: 0, Max: 1)) break; |
| 1260 | if(!CheckInt(pErrorMsg: "m_RecordServer" , Value: pMsg->m_RecordServer, Min: 0, Max: 1)) break; |
| 1261 | } break; |
| 1262 | |
| 1263 | case NETMSGTYPE_SV_CHECKPOINT: |
| 1264 | { |
| 1265 | CNetMsg_Sv_Checkpoint *pMsg = (CNetMsg_Sv_Checkpoint *)m_aMsgData; |
| 1266 | (void)pMsg; |
| 1267 | pMsg->m_Diff = pUnpacker->GetInt(); |
| 1268 | } break; |
| 1269 | |
| 1270 | case NETMSGTYPE_SV_COMMANDINFO: |
| 1271 | { |
| 1272 | CNetMsg_Sv_CommandInfo *pMsg = (CNetMsg_Sv_CommandInfo *)m_aMsgData; |
| 1273 | (void)pMsg; |
| 1274 | pMsg->m_pName = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1275 | pMsg->m_pArgsFormat = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1276 | pMsg->m_pHelpText = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1277 | } break; |
| 1278 | |
| 1279 | case NETMSGTYPE_SV_COMMANDINFOREMOVE: |
| 1280 | { |
| 1281 | CNetMsg_Sv_CommandInfoRemove *pMsg = (CNetMsg_Sv_CommandInfoRemove *)m_aMsgData; |
| 1282 | (void)pMsg; |
| 1283 | pMsg->m_pName = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1284 | } break; |
| 1285 | |
| 1286 | case NETMSGTYPE_CL_COMMAND: |
| 1287 | { |
| 1288 | CNetMsg_Cl_Command *pMsg = (CNetMsg_Cl_Command *)m_aMsgData; |
| 1289 | (void)pMsg; |
| 1290 | pMsg->m_pName = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1291 | pMsg->m_pArguments = pUnpacker->GetString(SanitizeType: CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES); |
| 1292 | } break; |
| 1293 | |
| 1294 | default: |
| 1295 | m_pMsgFailedOn = "(type out of range)" ; |
| 1296 | break; |
| 1297 | } |
| 1298 | |
| 1299 | if(pUnpacker->Error()) |
| 1300 | m_pMsgFailedOn = "(unpack error)" ; |
| 1301 | |
| 1302 | if(m_pMsgFailedOn || m_pObjFailedOn) { |
| 1303 | if(!m_pMsgFailedOn) |
| 1304 | m_pMsgFailedOn = "" ; |
| 1305 | if(!m_pObjFailedOn) |
| 1306 | m_pObjFailedOn = "" ; |
| 1307 | return 0; |
| 1308 | } |
| 1309 | m_pMsgFailedOn = "" ; |
| 1310 | m_pObjFailedOn = "" ; |
| 1311 | return m_aMsgData; |
| 1312 | }; |
| 1313 | } |
| 1314 | |
| 1315 | |