Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #ifndef GAME_GENERATED_PROTOCOL_H
  2. #define GAME_GENERATED_PROTOCOL_H
  3.  
  4.  
  5. #include <engine/message.h>
  6. #include <engine/shared/protocol_ex.h>
  7.  
  8. enum
  9. {
  10.     INPUT_STATE_MASK=0x3f
  11. };
  12.  
  13. enum
  14. {
  15.     TEAM_SPECTATORS=-1,
  16.     TEAM_RED,
  17.     TEAM_BLUE,
  18.  
  19.     FLAG_MISSING=-3,
  20.     FLAG_ATSTAND,
  21.     FLAG_TAKEN,
  22.  
  23.     SPEC_FREEVIEW=-1,
  24.     SPEC_FOLLOW=-2,
  25. };
  26.  
  27. enum
  28. {
  29.     EMOTE_NORMAL,
  30.     EMOTE_PAIN,
  31.     EMOTE_HAPPY,
  32.     EMOTE_SURPRISE,
  33.     EMOTE_ANGRY,
  34.     EMOTE_BLINK,
  35.     NUM_EMOTES
  36. };
  37.  
  38. enum
  39. {
  40.     POWERUP_HEALTH,
  41.     POWERUP_ARMOR,
  42.     POWERUP_WEAPON,
  43.     POWERUP_NINJA,
  44.     NUM_POWERUPS
  45. };
  46.  
  47. enum
  48. {
  49.     EMOTICON_OOP,
  50.     EMOTICON_EXCLAMATION,
  51.     EMOTICON_HEARTS,
  52.     EMOTICON_DROP,
  53.     EMOTICON_DOTDOT,
  54.     EMOTICON_MUSIC,
  55.     EMOTICON_SORRY,
  56.     EMOTICON_GHOST,
  57.     EMOTICON_SUSHI,
  58.     EMOTICON_SPLATTEE,
  59.     EMOTICON_DEVILTEE,
  60.     EMOTICON_ZOMG,
  61.     EMOTICON_ZZZ,
  62.     EMOTICON_WTF,
  63.     EMOTICON_EYES,
  64.     EMOTICON_QUESTION,
  65.     NUM_EMOTICONS
  66. };
  67.  
  68. enum
  69. {
  70.     PLAYERFLAG_PLAYING = 1<<0,
  71.     PLAYERFLAG_IN_MENU = 1<<1,
  72.     PLAYERFLAG_CHATTING = 1<<2,
  73.     PLAYERFLAG_SCOREBOARD = 1<<3,
  74.     PLAYERFLAG_AIM = 1<<4,
  75. };
  76.  
  77. enum
  78. {
  79.     GAMEFLAG_TEAMS = 1<<0,
  80.     GAMEFLAG_FLAGS = 1<<1,
  81. };
  82.  
  83. enum
  84. {
  85.     GAMESTATEFLAG_GAMEOVER = 1<<0,
  86.     GAMESTATEFLAG_SUDDENDEATH = 1<<1,
  87.     GAMESTATEFLAG_PAUSED = 1<<2,
  88.     GAMESTATEFLAG_RACETIME = 1<<3,
  89. };
  90.  
  91. enum
  92. {
  93.     NETOBJTYPE_EX,
  94.     NETOBJTYPE_PLAYERINPUT,
  95.     NETOBJTYPE_PROJECTILE,
  96.     NETOBJTYPE_LASER,
  97.     NETOBJTYPE_PICKUP,
  98.     NETOBJTYPE_FLAG,
  99.     NETOBJTYPE_GAMEINFO,
  100.     NETOBJTYPE_GAMEDATA,
  101.     NETOBJTYPE_CHARACTERCORE,
  102.     NETOBJTYPE_CHARACTER,
  103.     NETOBJTYPE_PLAYERINFO,
  104.     NETOBJTYPE_CLIENTINFO,
  105.     NETOBJTYPE_SPECTATORINFO,
  106.     NETEVENTTYPE_COMMON,
  107.     NETEVENTTYPE_EXPLOSION,
  108.     NETEVENTTYPE_SPAWN,
  109.     NETEVENTTYPE_HAMMERHIT,
  110.     NETEVENTTYPE_DEATH,
  111.     NETEVENTTYPE_SOUNDGLOBAL,
  112.     NETEVENTTYPE_SOUNDWORLD,
  113.     NETEVENTTYPE_DAMAGEIND,
  114.     NUM_NETOBJTYPES
  115. };
  116. enum
  117. {
  118.     __NETOBJTYPE_UUID_HELPER=OFFSET_GAME_UUID-1,
  119.     NETOBJTYPE_MYOWNOBJECT,
  120.     NETOBJTYPE_MYOWNEVENT,
  121.     OFFSET_NETMSGTYPE_UUID
  122. };
  123.  
  124. enum
  125. {
  126.     NETMSGTYPE_EX,
  127.     NETMSGTYPE_SV_MOTD,
  128.     NETMSGTYPE_SV_BROADCAST,
  129.     NETMSGTYPE_SV_CHAT,
  130.     NETMSGTYPE_SV_KILLMSG,
  131.     NETMSGTYPE_SV_SOUNDGLOBAL,
  132.     NETMSGTYPE_SV_TUNEPARAMS,
  133.     NETMSGTYPE_SV_EXTRAPROJECTILE,
  134.     NETMSGTYPE_SV_READYTOENTER,
  135.     NETMSGTYPE_SV_WEAPONPICKUP,
  136.     NETMSGTYPE_SV_EMOTICON,
  137.     NETMSGTYPE_SV_VOTECLEAROPTIONS,
  138.     NETMSGTYPE_SV_VOTEOPTIONLISTADD,
  139.     NETMSGTYPE_SV_VOTEOPTIONADD,
  140.     NETMSGTYPE_SV_VOTEOPTIONREMOVE,
  141.     NETMSGTYPE_SV_VOTESET,
  142.     NETMSGTYPE_SV_VOTESTATUS,
  143.     NETMSGTYPE_CL_SAY,
  144.     NETMSGTYPE_CL_SETTEAM,
  145.     NETMSGTYPE_CL_SETSPECTATORMODE,
  146.     NETMSGTYPE_CL_STARTINFO,
  147.     NETMSGTYPE_CL_CHANGEINFO,
  148.     NETMSGTYPE_CL_KILL,
  149.     NETMSGTYPE_CL_EMOTICON,
  150.     NETMSGTYPE_CL_VOTE,
  151.     NETMSGTYPE_CL_CALLVOTE,
  152.     NETMSGTYPE_CL_ISDDNET,
  153.     NETMSGTYPE_SV_DDRACETIME,
  154.     NETMSGTYPE_SV_RECORD,
  155.     NETMSGTYPE_SV_PLAYERTIME,
  156.     NETMSGTYPE_SV_TEAMSSTATE,
  157.     NETMSGTYPE_CL_SHOWOTHERS,
  158.     NUM_NETMSGTYPES
  159. };
  160.  
  161. enum
  162. {
  163.     __NETMSGTYPE_UUID_HELPER=OFFSET_NETMSGTYPE_UUID-1,
  164.     NETMSGTYPE_SV_MYOWNMESSAGE,
  165.     END_NETMSGTYPE_UUID
  166. };
  167.  
  168. struct CNetObj_PlayerInput
  169. {
  170.     int m_Direction;
  171.     int m_TargetX;
  172.     int m_TargetY;
  173.     int m_Jump;
  174.     int m_Fire;
  175.     int m_Hook;
  176.     int m_PlayerFlags;
  177.     int m_WantedWeapon;
  178.     int m_NextWeapon;
  179.     int m_PrevWeapon;
  180. };
  181.  
  182. struct CNetObj_Projectile
  183. {
  184.     int m_X;
  185.     int m_Y;
  186.     int m_VelX;
  187.     int m_VelY;
  188.     int m_Type;
  189.     int m_StartTick;
  190. };
  191.  
  192. struct CNetObj_Laser
  193. {
  194.     int m_X;
  195.     int m_Y;
  196.     int m_FromX;
  197.     int m_FromY;
  198.     int m_StartTick;
  199. };
  200.  
  201. struct CNetObj_Pickup
  202. {
  203.     int m_X;
  204.     int m_Y;
  205.     int m_Type;
  206.     int m_Subtype;
  207. };
  208.  
  209. struct CNetObj_Flag
  210. {
  211.     int m_X;
  212.     int m_Y;
  213.     int m_Team;
  214. };
  215.  
  216. struct CNetObj_GameInfo
  217. {
  218.     int m_GameFlags;
  219.     int m_GameStateFlags;
  220.     int m_RoundStartTick;
  221.     int m_WarmupTimer;
  222.     int m_ScoreLimit;
  223.     int m_TimeLimit;
  224.     int m_RoundNum;
  225.     int m_RoundCurrent;
  226. };
  227.  
  228. struct CNetObj_GameData
  229. {
  230.     int m_TeamscoreRed;
  231.     int m_TeamscoreBlue;
  232.     int m_FlagCarrierRed;
  233.     int m_FlagCarrierBlue;
  234. };
  235.  
  236. struct CNetObj_CharacterCore
  237. {
  238.     int m_Tick;
  239.     int m_X;
  240.     int m_Y;
  241.     int m_VelX;
  242.     int m_VelY;
  243.     int m_Angle;
  244.     int m_Direction;
  245.     int m_Jumped;
  246.     int m_HookedPlayer;
  247.     int m_HookState;
  248.     int m_HookTick;
  249.     int m_HookX;
  250.     int m_HookY;
  251.     int m_HookDx;
  252.     int m_HookDy;
  253. };
  254.  
  255. struct CNetObj_Character : public CNetObj_CharacterCore
  256. {
  257.     int m_PlayerFlags;
  258.     int m_Health;
  259.     int m_Armor;
  260.     int m_AmmoCount;
  261.     int m_Weapon;
  262.     int m_Emote;
  263.     int m_AttackTick;
  264. };
  265.  
  266. struct CNetObj_PlayerInfo
  267. {
  268.     int m_Local;
  269.     int m_ClientID;
  270.     int m_Team;
  271.     int m_Score;
  272.     int m_Latency;
  273. };
  274.  
  275. struct CNetObj_ClientInfo
  276. {
  277.     int m_Name0;
  278.     int m_Name1;
  279.     int m_Name2;
  280.     int m_Name3;
  281.     int m_Clan0;
  282.     int m_Clan1;
  283.     int m_Clan2;
  284.     int m_Country;
  285.     int m_Skin0;
  286.     int m_Skin1;
  287.     int m_Skin2;
  288.     int m_Skin3;
  289.     int m_Skin4;
  290.     int m_Skin5;
  291.     int m_UseCustomColor;
  292.     int m_ColorBody;
  293.     int m_ColorFeet;
  294. };
  295.  
  296. struct CNetObj_SpectatorInfo
  297. {
  298.     int m_SpectatorID;
  299.     int m_X;
  300.     int m_Y;
  301. };
  302.  
  303. struct CNetObj_MyOwnObject
  304. {
  305.     int m_Test;
  306. };
  307.  
  308. struct CNetEvent_Common
  309. {
  310.     int m_X;
  311.     int m_Y;
  312. };
  313.  
  314. struct CNetEvent_Explosion : public CNetEvent_Common
  315. {
  316. };
  317.  
  318. struct CNetEvent_Spawn : public CNetEvent_Common
  319. {
  320. };
  321.  
  322. struct CNetEvent_HammerHit : public CNetEvent_Common
  323. {
  324. };
  325.  
  326. struct CNetEvent_Death : public CNetEvent_Common
  327. {
  328.     int m_ClientID;
  329. };
  330.  
  331. struct CNetEvent_SoundGlobal : public CNetEvent_Common
  332. {
  333.     int m_SoundID;
  334. };
  335.  
  336. struct CNetEvent_SoundWorld : public CNetEvent_Common
  337. {
  338.     int m_SoundID;
  339. };
  340.  
  341. struct CNetEvent_DamageInd : public CNetEvent_Common
  342. {
  343.     int m_Angle;
  344. };
  345.  
  346. struct CNetObj_MyOwnEvent
  347. {
  348.     int m_Test;
  349. };
  350.  
  351. struct CNetMsg_Sv_Motd
  352. {
  353.     const char *m_pMessage;
  354.     int MsgID() const { return NETMSGTYPE_SV_MOTD; }
  355.    
  356.     bool Pack(CMsgPacker *pPacker)
  357.     {
  358.         pPacker->AddString(m_pMessage, -1);
  359.         return pPacker->Error() != 0;
  360.     }
  361. };
  362.  
  363. struct CNetMsg_Sv_Broadcast
  364. {
  365.     const char *m_pMessage;
  366.     int MsgID() const { return NETMSGTYPE_SV_BROADCAST; }
  367.    
  368.     bool Pack(CMsgPacker *pPacker)
  369.     {
  370.         pPacker->AddString(m_pMessage, -1);
  371.         return pPacker->Error() != 0;
  372.     }
  373. };
  374.  
  375. struct CNetMsg_Sv_Chat
  376. {
  377.     int m_Team;
  378.     int m_ClientID;
  379.     const char *m_pMessage;
  380.     int MsgID() const { return NETMSGTYPE_SV_CHAT; }
  381.    
  382.     bool Pack(CMsgPacker *pPacker)
  383.     {
  384.         pPacker->AddInt(m_Team);
  385.         pPacker->AddInt(m_ClientID);
  386.         pPacker->AddString(m_pMessage, -1);
  387.         return pPacker->Error() != 0;
  388.     }
  389. };
  390.  
  391. struct CNetMsg_Sv_KillMsg
  392. {
  393.     int m_Killer;
  394.     int m_Victim;
  395.     int m_Weapon;
  396.     int m_ModeSpecial;
  397.     int MsgID() const { return NETMSGTYPE_SV_KILLMSG; }
  398.    
  399.     bool Pack(CMsgPacker *pPacker)
  400.     {
  401.         pPacker->AddInt(m_Killer);
  402.         pPacker->AddInt(m_Victim);
  403.         pPacker->AddInt(m_Weapon);
  404.         pPacker->AddInt(m_ModeSpecial);
  405.         return pPacker->Error() != 0;
  406.     }
  407. };
  408.  
  409. struct CNetMsg_Sv_SoundGlobal
  410. {
  411.     int m_SoundID;
  412.     int MsgID() const { return NETMSGTYPE_SV_SOUNDGLOBAL; }
  413.    
  414.     bool Pack(CMsgPacker *pPacker)
  415.     {
  416.         pPacker->AddInt(m_SoundID);
  417.         return pPacker->Error() != 0;
  418.     }
  419. };
  420.  
  421. struct CNetMsg_Sv_TuneParams
  422. {
  423.     int MsgID() const { return NETMSGTYPE_SV_TUNEPARAMS; }
  424.    
  425.     bool Pack(CMsgPacker *pPacker)
  426.     {
  427.         return pPacker->Error() != 0;
  428.     }
  429. };
  430.  
  431. struct CNetMsg_Sv_ExtraProjectile
  432. {
  433.     int MsgID() const { return NETMSGTYPE_SV_EXTRAPROJECTILE; }
  434.    
  435.     bool Pack(CMsgPacker *pPacker)
  436.     {
  437.         return pPacker->Error() != 0;
  438.     }
  439. };
  440.  
  441. struct CNetMsg_Sv_ReadyToEnter
  442. {
  443.     int MsgID() const { return NETMSGTYPE_SV_READYTOENTER; }
  444.    
  445.     bool Pack(CMsgPacker *pPacker)
  446.     {
  447.         return pPacker->Error() != 0;
  448.     }
  449. };
  450.  
  451. struct CNetMsg_Sv_WeaponPickup
  452. {
  453.     int m_Weapon;
  454.     int MsgID() const { return NETMSGTYPE_SV_WEAPONPICKUP; }
  455.    
  456.     bool Pack(CMsgPacker *pPacker)
  457.     {
  458.         pPacker->AddInt(m_Weapon);
  459.         return pPacker->Error() != 0;
  460.     }
  461. };
  462.  
  463. struct CNetMsg_Sv_Emoticon
  464. {
  465.     int m_ClientID;
  466.     int m_Emoticon;
  467.     int MsgID() const { return NETMSGTYPE_SV_EMOTICON; }
  468.    
  469.     bool Pack(CMsgPacker *pPacker)
  470.     {
  471.         pPacker->AddInt(m_ClientID);
  472.         pPacker->AddInt(m_Emoticon);
  473.         return pPacker->Error() != 0;
  474.     }
  475. };
  476.  
  477. struct CNetMsg_Sv_VoteClearOptions
  478. {
  479.     int MsgID() const { return NETMSGTYPE_SV_VOTECLEAROPTIONS; }
  480.    
  481.     bool Pack(CMsgPacker *pPacker)
  482.     {
  483.         return pPacker->Error() != 0;
  484.     }
  485. };
  486.  
  487. struct CNetMsg_Sv_VoteOptionListAdd
  488. {
  489.     int m_NumOptions;
  490.     const char *m_pDescription0;
  491.     const char *m_pDescription1;
  492.     const char *m_pDescription2;
  493.     const char *m_pDescription3;
  494.     const char *m_pDescription4;
  495.     const char *m_pDescription5;
  496.     const char *m_pDescription6;
  497.     const char *m_pDescription7;
  498.     const char *m_pDescription8;
  499.     const char *m_pDescription9;
  500.     const char *m_pDescription10;
  501.     const char *m_pDescription11;
  502.     const char *m_pDescription12;
  503.     const char *m_pDescription13;
  504.     const char *m_pDescription14;
  505.     int MsgID() const { return NETMSGTYPE_SV_VOTEOPTIONLISTADD; }
  506.    
  507.     bool Pack(CMsgPacker *pPacker)
  508.     {
  509.         pPacker->AddInt(m_NumOptions);
  510.         pPacker->AddString(m_pDescription0, -1);
  511.         pPacker->AddString(m_pDescription1, -1);
  512.         pPacker->AddString(m_pDescription2, -1);
  513.         pPacker->AddString(m_pDescription3, -1);
  514.         pPacker->AddString(m_pDescription4, -1);
  515.         pPacker->AddString(m_pDescription5, -1);
  516.         pPacker->AddString(m_pDescription6, -1);
  517.         pPacker->AddString(m_pDescription7, -1);
  518.         pPacker->AddString(m_pDescription8, -1);
  519.         pPacker->AddString(m_pDescription9, -1);
  520.         pPacker->AddString(m_pDescription10, -1);
  521.         pPacker->AddString(m_pDescription11, -1);
  522.         pPacker->AddString(m_pDescription12, -1);
  523.         pPacker->AddString(m_pDescription13, -1);
  524.         pPacker->AddString(m_pDescription14, -1);
  525.         return pPacker->Error() != 0;
  526.     }
  527. };
  528.  
  529. struct CNetMsg_Sv_VoteOptionAdd
  530. {
  531.     const char *m_pDescription;
  532.     int MsgID() const { return NETMSGTYPE_SV_VOTEOPTIONADD; }
  533.    
  534.     bool Pack(CMsgPacker *pPacker)
  535.     {
  536.         pPacker->AddString(m_pDescription, -1);
  537.         return pPacker->Error() != 0;
  538.     }
  539. };
  540.  
  541. struct CNetMsg_Sv_VoteOptionRemove
  542. {
  543.     const char *m_pDescription;
  544.     int MsgID() const { return NETMSGTYPE_SV_VOTEOPTIONREMOVE; }
  545.    
  546.     bool Pack(CMsgPacker *pPacker)
  547.     {
  548.         pPacker->AddString(m_pDescription, -1);
  549.         return pPacker->Error() != 0;
  550.     }
  551. };
  552.  
  553. struct CNetMsg_Sv_VoteSet
  554. {
  555.     int m_Timeout;
  556.     const char *m_pDescription;
  557.     const char *m_pReason;
  558.     int MsgID() const { return NETMSGTYPE_SV_VOTESET; }
  559.    
  560.     bool Pack(CMsgPacker *pPacker)
  561.     {
  562.         pPacker->AddInt(m_Timeout);
  563.         pPacker->AddString(m_pDescription, -1);
  564.         pPacker->AddString(m_pReason, -1);
  565.         return pPacker->Error() != 0;
  566.     }
  567. };
  568.  
  569. struct CNetMsg_Sv_VoteStatus
  570. {
  571.     int m_Yes;
  572.     int m_No;
  573.     int m_Pass;
  574.     int m_Total;
  575.     int MsgID() const { return NETMSGTYPE_SV_VOTESTATUS; }
  576.    
  577.     bool Pack(CMsgPacker *pPacker)
  578.     {
  579.         pPacker->AddInt(m_Yes);
  580.         pPacker->AddInt(m_No);
  581.         pPacker->AddInt(m_Pass);
  582.         pPacker->AddInt(m_Total);
  583.         return pPacker->Error() != 0;
  584.     }
  585. };
  586.  
  587. struct CNetMsg_Cl_Say
  588. {
  589.     int m_Team;
  590.     const char *m_pMessage;
  591.     int MsgID() const { return NETMSGTYPE_CL_SAY; }
  592.    
  593.     bool Pack(CMsgPacker *pPacker)
  594.     {
  595.         pPacker->AddInt(m_Team);
  596.         pPacker->AddString(m_pMessage, -1);
  597.         return pPacker->Error() != 0;
  598.     }
  599. };
  600.  
  601. struct CNetMsg_Cl_SetTeam
  602. {
  603.     int m_Team;
  604.     int MsgID() const { return NETMSGTYPE_CL_SETTEAM; }
  605.    
  606.     bool Pack(CMsgPacker *pPacker)
  607.     {
  608.         pPacker->AddInt(m_Team);
  609.         return pPacker->Error() != 0;
  610.     }
  611. };
  612.  
  613. struct CNetMsg_Cl_SetSpectatorMode
  614. {
  615.     int m_SpectatorID;
  616.     int MsgID() const { return NETMSGTYPE_CL_SETSPECTATORMODE; }
  617.    
  618.     bool Pack(CMsgPacker *pPacker)
  619.     {
  620.         pPacker->AddInt(m_SpectatorID);
  621.         return pPacker->Error() != 0;
  622.     }
  623. };
  624.  
  625. struct CNetMsg_Cl_StartInfo
  626. {
  627.     const char *m_pName;
  628.     const char *m_pClan;
  629.     int m_Country;
  630.     const char *m_pSkin;
  631.     int m_UseCustomColor;
  632.     int m_ColorBody;
  633.     int m_ColorFeet;
  634.     int MsgID() const { return NETMSGTYPE_CL_STARTINFO; }
  635.    
  636.     bool Pack(CMsgPacker *pPacker)
  637.     {
  638.         pPacker->AddString(m_pName, -1);
  639.         pPacker->AddString(m_pClan, -1);
  640.         pPacker->AddInt(m_Country);
  641.         pPacker->AddString(m_pSkin, -1);
  642.         pPacker->AddInt(m_UseCustomColor);
  643.         pPacker->AddInt(m_ColorBody);
  644.         pPacker->AddInt(m_ColorFeet);
  645.         return pPacker->Error() != 0;
  646.     }
  647. };
  648.  
  649. struct CNetMsg_Cl_ChangeInfo
  650. {
  651.     const char *m_pName;
  652.     const char *m_pClan;
  653.     int m_Country;
  654.     const char *m_pSkin;
  655.     int m_UseCustomColor;
  656.     int m_ColorBody;
  657.     int m_ColorFeet;
  658.     int MsgID() const { return NETMSGTYPE_CL_CHANGEINFO; }
  659.    
  660.     bool Pack(CMsgPacker *pPacker)
  661.     {
  662.         pPacker->AddString(m_pName, -1);
  663.         pPacker->AddString(m_pClan, -1);
  664.         pPacker->AddInt(m_Country);
  665.         pPacker->AddString(m_pSkin, -1);
  666.         pPacker->AddInt(m_UseCustomColor);
  667.         pPacker->AddInt(m_ColorBody);
  668.         pPacker->AddInt(m_ColorFeet);
  669.         return pPacker->Error() != 0;
  670.     }
  671. };
  672.  
  673. struct CNetMsg_Cl_Kill
  674. {
  675.     int MsgID() const { return NETMSGTYPE_CL_KILL; }
  676.    
  677.     bool Pack(CMsgPacker *pPacker)
  678.     {
  679.         return pPacker->Error() != 0;
  680.     }
  681. };
  682.  
  683. struct CNetMsg_Cl_Emoticon
  684. {
  685.     int m_Emoticon;
  686.     int MsgID() const { return NETMSGTYPE_CL_EMOTICON; }
  687.    
  688.     bool Pack(CMsgPacker *pPacker)
  689.     {
  690.         pPacker->AddInt(m_Emoticon);
  691.         return pPacker->Error() != 0;
  692.     }
  693. };
  694.  
  695. struct CNetMsg_Cl_Vote
  696. {
  697.     int m_Vote;
  698.     int MsgID() const { return NETMSGTYPE_CL_VOTE; }
  699.    
  700.     bool Pack(CMsgPacker *pPacker)
  701.     {
  702.         pPacker->AddInt(m_Vote);
  703.         return pPacker->Error() != 0;
  704.     }
  705. };
  706.  
  707. struct CNetMsg_Cl_CallVote
  708. {
  709.     const char *m_Type;
  710.     const char *m_Value;
  711.     const char *m_Reason;
  712.     int MsgID() const { return NETMSGTYPE_CL_CALLVOTE; }
  713.    
  714.     bool Pack(CMsgPacker *pPacker)
  715.     {
  716.         pPacker->AddString(m_Type, -1);
  717.         pPacker->AddString(m_Value, -1);
  718.         pPacker->AddString(m_Reason, -1);
  719.         return pPacker->Error() != 0;
  720.     }
  721. };
  722.  
  723. struct CNetMsg_Cl_IsDDNet
  724. {
  725.     int MsgID() const { return NETMSGTYPE_CL_ISDDNET; }
  726.    
  727.     bool Pack(CMsgPacker *pPacker)
  728.     {
  729.         return pPacker->Error() != 0;
  730.     }
  731. };
  732.  
  733. struct CNetMsg_Sv_DDRaceTime
  734. {
  735.     int m_Time;
  736.     int m_Check;
  737.     int m_Finish;
  738.     int MsgID() const { return NETMSGTYPE_SV_DDRACETIME; }
  739.    
  740.     bool Pack(CMsgPacker *pPacker)
  741.     {
  742.         pPacker->AddInt(m_Time);
  743.         pPacker->AddInt(m_Check);
  744.         pPacker->AddInt(m_Finish);
  745.         return pPacker->Error() != 0;
  746.     }
  747. };
  748.  
  749. struct CNetMsg_Sv_Record
  750. {
  751.     int m_ServerTimeBest;
  752.     int m_PlayerTimeBest;
  753.     int MsgID() const { return NETMSGTYPE_SV_RECORD; }
  754.    
  755.     bool Pack(CMsgPacker *pPacker)
  756.     {
  757.         pPacker->AddInt(m_ServerTimeBest);
  758.         pPacker->AddInt(m_PlayerTimeBest);
  759.         return pPacker->Error() != 0;
  760.     }
  761. };
  762.  
  763. struct CNetMsg_Sv_PlayerTime
  764. {
  765.     int m_Time;
  766.     int m_ClientID;
  767.     int MsgID() const { return NETMSGTYPE_SV_PLAYERTIME; }
  768.    
  769.     bool Pack(CMsgPacker *pPacker)
  770.     {
  771.         pPacker->AddInt(m_Time);
  772.         pPacker->AddInt(m_ClientID);
  773.         return pPacker->Error() != 0;
  774.     }
  775. };
  776.  
  777. struct CNetMsg_Sv_TeamsState
  778. {
  779.     int MsgID() const { return NETMSGTYPE_SV_TEAMSSTATE; }
  780.    
  781.     bool Pack(CMsgPacker *pPacker)
  782.     {
  783.         return pPacker->Error() != 0;
  784.     }
  785. };
  786.  
  787. struct CNetMsg_Cl_ShowOthers
  788. {
  789.     int m_Show;
  790.     int MsgID() const { return NETMSGTYPE_CL_SHOWOTHERS; }
  791.    
  792.     bool Pack(CMsgPacker *pPacker)
  793.     {
  794.         pPacker->AddInt(m_Show);
  795.         return pPacker->Error() != 0;
  796.     }
  797. };
  798.  
  799. struct CNetMsg_Sv_MyOwnMessage
  800. {
  801.     int m_Test;
  802.     int MsgID() const { return NETMSGTYPE_SV_MYOWNMESSAGE; }
  803.    
  804.     bool Pack(CMsgPacker *pPacker)
  805.     {
  806.         pPacker->AddInt(m_Test);
  807.         return pPacker->Error() != 0;
  808.     }
  809. };
  810.  
  811. enum
  812. {
  813.     SOUND_GUN_FIRE=0,
  814.     SOUND_SHOTGUN_FIRE,
  815.     SOUND_GRENADE_FIRE,
  816.     SOUND_HAMMER_FIRE,
  817.     SOUND_HAMMER_HIT,
  818.     SOUND_NINJA_FIRE,
  819.     SOUND_GRENADE_EXPLODE,
  820.     SOUND_NINJA_HIT,
  821.     SOUND_RIFLE_FIRE,
  822.     SOUND_RIFLE_BOUNCE,
  823.     SOUND_WEAPON_SWITCH,
  824.     SOUND_PLAYER_PAIN_SHORT,
  825.     SOUND_PLAYER_PAIN_LONG,
  826.     SOUND_BODY_LAND,
  827.     SOUND_PLAYER_AIRJUMP,
  828.     SOUND_PLAYER_JUMP,
  829.     SOUND_PLAYER_DIE,
  830.     SOUND_PLAYER_SPAWN,
  831.     SOUND_PLAYER_SKID,
  832.     SOUND_TEE_CRY,
  833.     SOUND_HOOK_LOOP,
  834.     SOUND_HOOK_ATTACH_GROUND,
  835.     SOUND_HOOK_ATTACH_PLAYER,
  836.     SOUND_HOOK_NOATTACH,
  837.     SOUND_PICKUP_HEALTH,
  838.     SOUND_PICKUP_ARMOR,
  839.     SOUND_PICKUP_GRENADE,
  840.     SOUND_PICKUP_SHOTGUN,
  841.     SOUND_PICKUP_NINJA,
  842.     SOUND_WEAPON_SPAWN,
  843.     SOUND_WEAPON_NOAMMO,
  844.     SOUND_HIT,
  845.     SOUND_CHAT_SERVER,
  846.     SOUND_CHAT_CLIENT,
  847.     SOUND_CHAT_HIGHLIGHT,
  848.     SOUND_CTF_DROP,
  849.     SOUND_CTF_RETURN,
  850.     SOUND_CTF_GRAB_PL,
  851.     SOUND_CTF_GRAB_EN,
  852.     SOUND_CTF_CAPTURE,
  853.     SOUND_MENU,
  854.     NUM_SOUNDS
  855. };
  856. enum
  857. {
  858.     WEAPON_HAMMER=0,
  859.     WEAPON_GUN,
  860.     WEAPON_SHOTGUN,
  861.     WEAPON_GRENADE,
  862.     WEAPON_RIFLE,
  863.     WEAPON_NINJA,
  864.     NUM_WEAPONS
  865. };
  866.  
  867.  
  868. class CNetObjHandler
  869. {
  870.     const char *m_pMsgFailedOn;
  871.     const char *m_pObjCorrectedOn;
  872.     char m_aMsgData[1024];
  873.     int m_NumObjCorrections;
  874.     int ClampInt(const char *pErrorMsg, int Value, int Min, int Max);
  875.  
  876.     static const char *ms_apObjNames[];
  877.     static int ms_aObjSizes[];
  878.     static const char *ms_apMsgNames[];
  879.  
  880. public:
  881.     CNetObjHandler();
  882.  
  883.     int ValidateObj(int Type, void *pData, int Size);
  884.     const char *GetObjName(int Type);
  885.     int GetObjSize(int Type);
  886.     int NumObjCorrections();
  887.     const char *CorrectedObjOn();
  888.  
  889.     const char *GetMsgName(int Type);
  890.     void *SecureUnpackMsg(int Type, CUnpacker *pUnpacker);
  891.     const char *FailedMsgOn();
  892. };
  893.  
  894.  
  895. #endif // GAME_GENERATED_PROTOCOL_H