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