1 // COMMIT-TODO: Update if necessary before committing
2 // Revision 1: additional statistics sent (flag caps, returns, deaths)
3 // Revision 2: Mapvote preview pictures
4 // Revision 3: optimized map vote protocol
5 // Revision 4: CSQC config var system
6 // Revision 5: mapvote time fix
7 // Revision 6: more robust against packet loss/delays, also show not yet connected clients
8 // Revision 7: packet loss column
10 // Revision 9: race delta
11 // Revision 10: scoreboard force
12 // Revision 11: scoreboard unforce; spectator support beginning
13 // Revision 12: smaller scores updates (SERVER: requires new engine)
14 // Revision 13: pointparticles
17 // Revision 16: multi-weapons
18 // Revision 17: multi-weaponimpulses
19 // Revision 18: warmup
21 // Revision 20: naggers
22 // Revision 21: entcs for players optimized (position data down from 12 to 7 bytes); waypointsprites in csqc for team radar
23 // Revision 22: hook shot origin
24 #define CSQC_REVISION 22
26 const float AS_STRING = 1;
27 const float AS_INT = 2;
28 const float AS_FLOAT_TRUNCATED = 2;
29 const float AS_FLOAT = 8;
31 const float TE_CSQC_PICTURE = 100;
32 const float TE_CSQC_RACE = 101;
33 const float TE_CSQC_VORTEXBEAMPARTICLE = 103;
34 const float TE_CSQC_ARC = 104;
35 const float TE_CSQC_TEAMNAGGER = 105;
36 const float TE_CSQC_PINGPLREPORT = 106;
37 const float TE_CSQC_TARGET_MUSIC = 107;
38 const float TE_CSQC_WEAPONCOMPLAIN = 108;
39 const float TE_CSQC_VORTEX_SCOPE = 109;
40 const float TE_CSQC_MINELAYER_MAXMINES = 110;
41 const float TE_CSQC_HAGAR_MAXROCKETS = 111;
42 const float TE_CSQC_VEHICLESETUP = 112;
43 const float TE_CSQC_SVNOTICE = 113;
44 const float TE_CSQC_SHOCKWAVEPARTICLE = 114;
46 const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
47 const float RACE_NET_CHECKPOINT_CLEAR = 1;
48 const float RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder
49 const float RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent
50 const float RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent
51 const float RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder
52 const float RACE_NET_PENALTY_RACE = 6; // byte penaltytime, string reason
53 const float RACE_NET_PENALTY_QUALIFYING = 7; // byte penaltytime, string reason
54 const float RACE_NET_SERVER_RECORD = 8; // server record, sent to client
55 const float RACE_NET_SPEED_AWARD = 9; // speed award, sent to client
56 const float RACE_NET_SPEED_AWARD_BEST = 10; // all time best speed award, sent to client
57 const float RACE_NET_SERVER_RANKINGS = 11;
58 const float RACE_NET_SERVER_STATUS = 12;
59 const float RANKINGS_CNT = 15;
61 const float ENT_CLIENT = 0;
62 const float ENT_CLIENT_DEAD = 1;
63 const float ENT_CLIENT_ENTCS = 2;
64 const float ENT_CLIENT_SCORES_INFO = 3;
65 const float ENT_CLIENT_SCORES = 4;
66 const float ENT_CLIENT_TEAMSCORES = 5;
67 const float ENT_CLIENT_POINTPARTICLES = 6;
68 const float ENT_CLIENT_RAINSNOW = 7;
69 const float ENT_CLIENT_LASER = 8;
70 const float ENT_CLIENT_NAGGER = 9; // flags [votecalledvote]
71 const float ENT_CLIENT_WAYPOINT = 10; // flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable]
72 const float ENT_CLIENT_RADARLINK = 11; // flags [startorigin] [endorigin] [startcolor+16*endcolor]
73 const float ENT_CLIENT_PROJECTILE = 12;
74 const float ENT_CLIENT_GIBSPLASH = 13;
75 const float ENT_CLIENT_DAMAGEINFO = 14;
76 const float ENT_CLIENT_CASING = 15;
77 const float ENT_CLIENT_INIT = 16;
78 const float ENT_CLIENT_MAPVOTE = 17;
79 const float ENT_CLIENT_CLIENTDATA = 18;
80 const float ENT_CLIENT_RANDOMSEED = 19;
81 const float ENT_CLIENT_WALL = 20;
82 const float ENT_CLIENT_SPIDERBOT = 21;
83 const float ENT_CLIENT_MODELEFFECT = 22;
84 const float ENT_CLIENT_TUBANOTE = 23;
85 const float ENT_CLIENT_WARPZONE = 24;
86 const float ENT_CLIENT_WARPZONE_CAMERA = 25;
87 const float ENT_CLIENT_TRIGGER_MUSIC = 26;
88 const float ENT_CLIENT_HOOK = 27;
89 const float ENT_CLIENT_ARC_BEAM = 29; // WEAPONTODO: fix numbers
90 const float ENT_CLIENT_ACCURACY = 30;
91 const float ENT_CLIENT_SHOWNAMES = 31;
92 const float ENT_CLIENT_WARPZONE_TELEPORTED = 32;
93 const float ENT_CLIENT_MODEL = 33;
94 const float ENT_CLIENT_ITEM = 34;
95 const float ENT_CLIENT_BUMBLE_RAYGUN = 35;
96 const float ENT_CLIENT_SPAWNPOINT = 36;
97 const float ENT_CLIENT_SPAWNEVENT = 37;
98 const float ENT_CLIENT_NOTIFICATION = 38;
99 const float ENT_CLIENT_ELIMINATEDPLAYERS = 39;
100 const float ENT_CLIENT_TURRET = 40;
101 const float ENT_CLIENT_AUXILIARYXHAIR = 50;
102 const float ENT_CLIENT_VEHICLE = 60;
103 const float ENT_CLIENT_GENERATOR = 70;
104 const float ENT_CLIENT_CONTROLPOINT_ICON = 71;
106 const float ENT_CLIENT_HEALING_ORB = 80;
108 const float SPRITERULE_DEFAULT = 0;
109 const float SPRITERULE_TEAMPLAY = 1;
111 const float RADARICON_NONE = 0;
112 const float RADARICON_FLAG = 1;
113 const float RADARICON_FLAGCARRIER = 1;
114 const float RADARICON_HERE = 1; // TODO make these 3 and 4, and make images for them
115 const float RADARICON_DANGER = 1;
116 const float RADARICON_WAYPOINT = 1;
117 const float RADARICON_HELPME = 1;
118 const float RADARICON_CONTROLPOINT = 1;
119 const float RADARICON_GENERATOR = 1;
120 const float RADARICON_OBJECTIVE = 1;
121 const float RADARICON_DOMPOINT = 1;
122 const float RADARICON_POWERUP = 1;
123 const float RADARICON_TAGGED = 1;
125 ///////////////////////////
127 const float KEY_FORWARD = 1;
128 const float KEY_BACKWARD = 2;
129 const float KEY_LEFT = 4;
130 const float KEY_RIGHT = 8;
131 const float KEY_JUMP = 16;
132 const float KEY_CROUCH = 32;
133 const float KEY_ATCK = 64;
134 const float KEY_ATCK2 = 128;
136 ///////////////////////////
139 const float CVAR_SAVE = 1;
140 const float CVAR_NOTIFY = 2;
141 const float CVAR_READONLY = 4;
143 ///////////////////////////
144 // csqc communication stuff
146 const float CTF_STATE_ATTACK = 1;
147 const float CTF_STATE_DEFEND = 2;
148 const float CTF_STATE_COMMANDER = 3;
150 const float HUD_NORMAL = 0;
151 const float HUD_VEHICLE_FIRST = 10;
152 const float HUD_SPIDERBOT = 10;
153 const float HUD_WAKIZASHI = 11;
154 const float HUD_RAPTOR = 12;
155 const float HUD_BUMBLEBEE = 13;
156 const float HUD_BUMBLEBEE_GUN = 14;
157 const float HUD_VEHICLE_LAST = 14;
159 const vector eX = '1 0 0';
160 const vector eY = '0 1 0';
161 const vector eZ = '0 0 1';
163 // moved that here so the client knows the max.
164 // # of maps, I'll use arrays for them :P
165 #define MAPVOTE_COUNT 30
168 * Lower scores are better (e.g. suicides)
170 #define SFL_LOWER_IS_BETTER 1
173 * Don't show zero values as scores
175 #define SFL_HIDE_ZERO 2
178 * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
180 #define SFL_ALLOW_HIDE 16
183 * Display as a rank (with st, nd, rd, th suffix)
188 * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
192 // not an extra constant yet
193 #define SFL_ZERO_IS_WORST SFL_TIME
196 * Scoring priority (NOTE: PRIMARY is used for fraglimit)
198 #define SFL_SORT_PRIO_SECONDARY 4
199 #define SFL_SORT_PRIO_PRIMARY 8
200 #define SFL_SORT_PRIO_MASK 12
206 #define MAX_TEAMSCORE 2
211 #define SP_SUICIDES 2
213 // game mode specific indices are not in common/, but in server/scores_rules.qc!
215 const float CH_INFO = 0;
216 const float CH_TRIGGER = -3;
217 const float CH_WEAPON_A = -1;
218 const float CH_WEAPON_SINGLE = 1;
219 const float CH_VOICE = -2;
220 const float CH_BGM_SINGLE = 8;
221 const float CH_AMBIENT = -9;
222 const float CH_TRIGGER_SINGLE = 3;
223 const float CH_SHOTS = -4;
224 const float CH_SHOTS_SINGLE = 4;
225 const float CH_WEAPON_B = -1;
226 const float CH_PAIN = -6;
227 const float CH_PAIN_SINGLE = 6;
228 const float CH_PLAYER = -7;
229 const float CH_PLAYER_SINGLE = 7;
230 const float CH_TUBA_SINGLE = 5;
232 const float ATTEN_NONE = 0;
233 const float ATTEN_MIN = 0.015625;
234 const float ATTEN_NORM = 0.5;
235 const float ATTEN_LARGE = 1;
236 const float ATTEN_IDLE = 2;
237 const float ATTEN_STATIC = 3;
238 const float ATTEN_MAX = 3.984375;
241 #define VOL_BASEVOICE 1.0
243 // WEAPONTODO: move this into separate/new projectile handling code // this sets sounds and other properties of the projectiles in csqc
244 const float PROJECTILE_ELECTRO = 1;
245 const float PROJECTILE_ROCKET = 2;
246 const float PROJECTILE_TAG = 3;
247 const float PROJECTILE_CRYLINK = 5;
248 const float PROJECTILE_ELECTRO_BEAM = 6;
249 const float PROJECTILE_GRENADE = 7;
250 const float PROJECTILE_GRENADE_BOUNCING = 8;
251 const float PROJECTILE_MINE = 9;
252 const float PROJECTILE_BLASTER = 10;
253 const float PROJECTILE_HLAC = 11;
254 const float PROJECTILE_SEEKER = 12;
255 const float PROJECTILE_FLAC = 13;
256 const float PROJECTILE_PORTO_RED = 14;
257 const float PROJECTILE_PORTO_BLUE = 15;
258 const float PROJECTILE_HOOKBOMB = 16;
259 const float PROJECTILE_HAGAR = 17;
260 const float PROJECTILE_HAGAR_BOUNCING = 18;
261 const float PROJECTILE_CRYLINK_BOUNCING = 20;
262 const float PROJECTILE_FIREBALL = 21;
263 const float PROJECTILE_FIREMINE = 22;
265 const float PROJECTILE_RAPTORCANNON = 24;
266 const float PROJECTILE_RAPTORBOMB = 25;
267 const float PROJECTILE_RAPTORBOMBLET = 26;
268 const float PROJECTILE_SPIDERROCKET = 27;
269 const float PROJECTILE_WAKIROCKET = 28;
270 const float PROJECTILE_WAKICANNON = 29;
272 const float PROJECTILE_BUMBLE_GUN = 30;
273 const float PROJECTILE_BUMBLE_BEAM = 31;
275 const float PROJECTILE_MAGE_SPIKE = 32;
276 const float PROJECTILE_SHAMBLER_LIGHTNING = 33;
278 const float PROJECTILE_RPC = 60;
280 const float SPECIES_HUMAN = 0;
281 const float SPECIES_ROBOT_SOLID = 1;
282 const float SPECIES_ALIEN = 2;
283 const float SPECIES_ANIMAL = 3;
284 const float SPECIES_ROBOT_RUSTY = 4;
285 const float SPECIES_ROBOT_SHINY = 5;
286 const float SPECIES_RESERVED = 15;
288 #define FRAGS_PLAYER 0
289 #define FRAGS_SPECTATOR -666
290 #define FRAGS_LMS_LOSER -616
291 #define FRAGS_PLAYER_NONSOLID -616
292 // we can use this frags value for both
295 const float WATERLEVEL_NONE = 0;
296 const float WATERLEVEL_WETFEET = 1;
297 const float WATERLEVEL_SWIMMING = 2;
298 const float WATERLEVEL_SUBMERGED = 3;
299 #define SERVERFLAG_ALLOW_FULLBRIGHT 1
300 #define SERVERFLAG_TEAMPLAY 2
301 #define SERVERFLAG_PLAYERSTATS 4
303 // FIXME/EXPLAINME: why?
304 noref var vector autocvar_sv_player_maxs = '16 16 45';
305 noref var vector autocvar_sv_player_mins = '-16 -16 -24';
306 noref var vector autocvar_sv_player_viewoffset = '0 0 20';
307 noref var vector autocvar_sv_player_crouch_maxs = '16 16 25';
308 noref var vector autocvar_sv_player_crouch_mins = '-16 -16 -24';
309 noref var vector autocvar_sv_player_crouch_viewoffset = '0 0 20';
310 noref var vector autocvar_sv_player_headsize = '24 24 12';
312 #define PL_VIEW_OFS autocvar_sv_player_viewoffset
313 #define PL_MIN autocvar_sv_player_mins
314 #define PL_MAX autocvar_sv_player_maxs
315 #define PL_CROUCH_VIEW_OFS autocvar_sv_player_crouch_viewoffset
316 #define PL_CROUCH_MIN autocvar_sv_player_crouch_mins
317 #define PL_CROUCH_MAX autocvar_sv_player_crouch_maxs
318 #define PL_HEAD autocvar_sv_player_headsize
321 #define PL_VIEW_OFS_z autocvar_sv_player_viewoffset_z
322 #define PL_MIN_z autocvar_sv_player_mins_z
323 #define PL_MAX_z autocvar_sv_player_maxs_z
324 #define PL_CROUCH_VIEW_OFS_z autocvar_sv_player_crouch_viewoffset_z
325 #define PL_CROUCH_MIN_z autocvar_sv_player_mins_z
326 #define PL_HEAD_x autocvar_sv_player_headsize_x
327 #define PL_HEAD_y autocvar_sv_player_headsize_y
328 #define PL_HEAD_z autocvar_sv_player_headsize_z
331 #define SPAWN_PRIO_NEAR_TEAMMATE_FOUND 200
332 #define SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM 100
333 #define SPAWN_PRIO_RACE_PREVIOUS_SPAWN 50
334 #define SPAWN_PRIO_GOOD_DISTANCE 10
337 #define URI_GET_DISCARD 0
338 #define URI_GET_IPBAN 1
339 #define URI_GET_IPBAN_END 16
340 #define URI_GET_CURL 17
341 #define URI_GET_CURL_END 32
342 #define URI_GET_UPDATENOTIFICATION 33
343 #define URI_GET_URLLIB 128
344 #define URI_GET_URLLIB_END 191
347 #define GTV_AVAILABLE 0
348 // for later use in per-map gametype filtering
349 #define GTV_FORBIDDEN 2