protocol.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. // protocol.h -- communications protocols
  16. #define PROTOCOL_VERSION 15
  17. // if the high bit of the servercmd is set, the low bits are fast update flags:
  18. #define U_MOREBITS (1<<0)
  19. #define U_ORIGIN1 (1<<1)
  20. #define U_ORIGIN2 (1<<2)
  21. #define U_ORIGIN3 (1<<3)
  22. #define U_ANGLE2 (1<<4)
  23. #define U_NOLERP (1<<5) // don't interpolate movement
  24. #define U_FRAME (1<<6)
  25. #define U_SIGNAL (1<<7) // just differentiates from other updates
  26. // svc_update can pass all of the fast update bits, plus more
  27. #define U_ANGLE1 (1<<8)
  28. #define U_ANGLE3 (1<<9)
  29. #define U_MODEL (1<<10)
  30. #define U_COLORMAP (1<<11)
  31. #define U_SKIN (1<<12)
  32. #define U_EFFECTS (1<<13)
  33. #define U_LONGENTITY (1<<14)
  34. #define SU_VIEWHEIGHT (1<<0)
  35. #define SU_IDEALPITCH (1<<1)
  36. #define SU_PUNCH1 (1<<2)
  37. #define SU_PUNCH2 (1<<3)
  38. #define SU_PUNCH3 (1<<4)
  39. #define SU_VELOCITY1 (1<<5)
  40. #define SU_VELOCITY2 (1<<6)
  41. #define SU_VELOCITY3 (1<<7)
  42. //define SU_AIMENT (1<<8) AVAILABLE BIT
  43. #define SU_ITEMS (1<<9)
  44. #define SU_ONGROUND (1<<10) // no data follows, the bit is it
  45. #define SU_INWATER (1<<11) // no data follows, the bit is it
  46. #define SU_WEAPONFRAME (1<<12)
  47. #define SU_ARMOR (1<<13)
  48. #define SU_WEAPON (1<<14)
  49. // a sound with no channel is a local only sound
  50. #define SND_VOLUME (1<<0) // a byte
  51. #define SND_ATTENUATION (1<<1) // a byte
  52. #define SND_LOOPING (1<<2) // a long
  53. // defaults for clientinfo messages
  54. #define DEFAULT_VIEWHEIGHT 22
  55. // game types sent by serverinfo
  56. // these determine which intermission screen plays
  57. #define GAME_COOP 0
  58. #define GAME_DEATHMATCH 1
  59. //==================
  60. // note that there are some defs.qc that mirror to these numbers
  61. // also related to svc_strings[] in cl_parse
  62. //==================
  63. //
  64. // server to client
  65. //
  66. #define svc_bad 0
  67. #define svc_nop 1
  68. #define svc_disconnect 2
  69. #define svc_updatestat 3 // [byte] [long]
  70. #define svc_version 4 // [long] server version
  71. #define svc_setview 5 // [short] entity number
  72. #define svc_sound 6 // <see code>
  73. #define svc_time 7 // [float] server time
  74. #define svc_print 8 // [string] null terminated string
  75. #define svc_stufftext 9 // [string] stuffed into client's console buffer
  76. // the string should be \n terminated
  77. #define svc_setangle 10 // [angle3] set the view angle to this absolute value
  78. #define svc_serverinfo 11 // [long] version
  79. // [string] signon string
  80. // [string]..[0]model cache
  81. // [string]...[0]sounds cache
  82. #define svc_lightstyle 12 // [byte] [string]
  83. #define svc_updatename 13 // [byte] [string]
  84. #define svc_updatefrags 14 // [byte] [short]
  85. #define svc_clientdata 15 // <shortbits + data>
  86. #define svc_stopsound 16 // <see code>
  87. #define svc_updatecolors 17 // [byte] [byte]
  88. #define svc_particle 18 // [vec3] <variable>
  89. #define svc_damage 19
  90. #define svc_spawnstatic 20
  91. // svc_spawnbinary 21
  92. #define svc_spawnbaseline 22
  93. #define svc_temp_entity 23
  94. #define svc_setpause 24 // [byte] on / off
  95. #define svc_signonnum 25 // [byte] used for the signon sequence
  96. #define svc_centerprint 26 // [string] to put in center of the screen
  97. #define svc_killedmonster 27
  98. #define svc_foundsecret 28
  99. #define svc_spawnstaticsound 29 // [coord3] [byte] samp [byte] vol [byte] aten
  100. #define svc_intermission 30 // [string] music
  101. #define svc_finale 31 // [string] music [string] text
  102. #define svc_cdtrack 32 // [byte] track [byte] looptrack
  103. #define svc_sellscreen 33
  104. #define svc_cutscene 34
  105. //
  106. // client to server
  107. //
  108. #define clc_bad 0
  109. #define clc_nop 1
  110. #define clc_disconnect 2
  111. #define clc_move 3 // [usercmd_t]
  112. #define clc_stringcmd 4 // [string] message
  113. //
  114. // temp entity events
  115. //
  116. #define TE_SPIKE 0
  117. #define TE_SUPERSPIKE 1
  118. #define TE_GUNSHOT 2
  119. #define TE_EXPLOSION 3
  120. #define TE_TAREXPLOSION 4
  121. #define TE_LIGHTNING1 5
  122. #define TE_LIGHTNING2 6
  123. #define TE_WIZSPIKE 7
  124. #define TE_KNIGHTSPIKE 8
  125. #define TE_LIGHTNING3 9
  126. #define TE_LAVASPLASH 10
  127. #define TE_TELEPORT 11
  128. #define TE_EXPLOSION2 12
  129. // PGM 01/21/97
  130. #define TE_BEAM 13
  131. // PGM 01/21/97
  132. #ifdef QUAKE2
  133. #define TE_IMPLOSION 14
  134. #define TE_RAILTRAIL 15
  135. #endif