Quake II RTX doxygen  1.0 dev
parse.c File Reference
#include "client.h"

Go to the source code of this file.

Functions

static void CL_ParseDeltaEntity (server_frame_t *frame, int newnum, entity_state_t *old, int bits)
 
static void CL_ParsePacketEntities (server_frame_t *oldframe, server_frame_t *frame)
 
static void CL_ParseFrame (int extrabits)
 
static void CL_ParseConfigstring (int index)
 
static void CL_ParseBaseline (int index, int bits)
 
static void CL_ParseGamestate (void)
 
static void CL_ParseServerData (void)
 
static void CL_ParseTEntPacket (void)
 
static void CL_ParseMuzzleFlashPacket (int mask)
 
static void CL_ParseStartSoundPacket (void)
 
static void CL_ParseReconnect (void)
 
static void CL_CheckForIP (const char *s)
 
static void CL_ParsePrint (void)
 
static void CL_ParseCenterPrint (void)
 
static void CL_ParseStuffText (void)
 
static void CL_ParseLayout (void)
 
static void CL_ParseInventory (void)
 
static void CL_ParseDownload (int cmd)
 
static void CL_ParseZPacket (void)
 
static void CL_ParseSetting (void)
 
void CL_ParseServerMessage (void)
 
void CL_SeekDemoMessage (void)
 

Variables

tent_params_t te
 
mz_params_t mz
 
snd_params_t snd
 

Function Documentation

◆ CL_CheckForIP()

static void CL_CheckForIP ( const char *  s)
static

Definition at line 900 of file parse.c.

901 {
902  unsigned b1, b2, b3, b4, port;
903  netadr_t *a;
904  char *p;
905 
906  while (*s) {
907  if (sscanf(s, "%3u.%3u.%3u.%3u", &b1, &b2, &b3, &b4) == 4 &&
908  b1 < 256 && b2 < 256 && b3 < 256 && b4 < 256) {
909  p = strchr(s, ':');
910  if (p) {
911  port = strtoul(p + 1, NULL, 10);
912  if (port < 1024 || port > 65535) {
913  break; // privileged or invalid port
914  }
915  } else {
916  port = PORT_SERVER;
917  }
918 
920  a->type = NA_IP;
921  a->ip.u8[0] = b1;
922  a->ip.u8[1] = b2;
923  a->ip.u8[2] = b3;
924  a->ip.u8[3] = b4;
925  a->port = BigShort(port);
926  break;
927  }
928 
929  s++;
930  }
931 }

Referenced by CL_ParsePrint().

◆ CL_ParseBaseline()

static void CL_ParseBaseline ( int  index,
int  bits 
)
static

Definition at line 442 of file parse.c.

443 {
444  if (index < 1 || index >= MAX_EDICTS) {
445  Com_Error(ERR_DROP, "%s: bad index: %d", __func__, index);
446  }
447 #ifdef _DEBUG
448  if (cl_shownet->integer > 2) {
449  MSG_ShowDeltaEntityBits(bits);
450  Com_LPrintf(PRINT_DEVELOPER, "\n");
451  }
452 #endif
453  MSG_ParseDeltaEntity(NULL, &cl.baselines[index], index, bits, cl.esFlags);
454 }

Referenced by CL_ParseGamestate(), and CL_ParseServerMessage().

◆ CL_ParseCenterPrint()

static void CL_ParseCenterPrint ( void  )
static

Definition at line 995 of file parse.c.

996 {
997  char s[MAX_STRING_CHARS];
998 
999  MSG_ReadString(s, sizeof(s));
1000  SHOWNET(2, " \"%s\"\n", s);
1001  SCR_CenterPrint(s);
1002 
1003  if (!cls.demo.playback && cl.serverstate != ss_broadcast) {
1004  COM_strclr(s);
1005  Cmd_ExecTrigger(s);
1006  }
1007 }

Referenced by CL_ParseServerMessage().

◆ CL_ParseConfigstring()

static void CL_ParseConfigstring ( int  index)
static

Definition at line 408 of file parse.c.

409 {
410  size_t len, maxlen;
411  char *s;
412 
413  if (index < 0 || index >= MAX_CONFIGSTRINGS) {
414  Com_Error(ERR_DROP, "%s: bad index: %d", __func__, index);
415  }
416 
417  s = cl.configstrings[index];
418  maxlen = CS_SIZE(index);
419  len = MSG_ReadString(s, maxlen);
420 
421  SHOWNET(2, " %d \"%s\"\n", index, s);
422 
423  if (len >= maxlen) {
424  Com_WPrintf(
425  "%s: index %d overflowed: %"PRIz" > %"PRIz"\n",
426  __func__, index, len, maxlen - 1);
427  }
428 
429  if (cls.demo.seeking) {
430  Q_SetBit(cl.dcs, index);
431  return;
432  }
433 
434  if (cls.demo.recording && cls.demo.paused) {
435  Q_SetBit(cl.dcs, index);
436  }
437 
438  // do something apropriate
439  CL_UpdateConfigstring(index);
440 }

Referenced by CL_ParseGamestate(), CL_ParseServerMessage(), and CL_SeekDemoMessage().

◆ CL_ParseDeltaEntity()

static void CL_ParseDeltaEntity ( server_frame_t frame,
int  newnum,
entity_state_t *  old,
int  bits 
)
inlinestatic

Definition at line 30 of file parse.c.

34 {
35  entity_state_t *state;
36 
37  // suck up to MAX_EDICTS for servers that don't cap at MAX_PACKET_ENTITIES
38  if (frame->numEntities >= MAX_EDICTS) {
39  Com_Error(ERR_DROP, "%s: MAX_EDICTS exceeded", __func__);
40  }
41 
42  state = &cl.entityStates[cl.numEntityStates & PARSE_ENTITIES_MASK];
44  frame->numEntities++;
45 
46 #ifdef _DEBUG
47  if (cl_shownet->integer > 2 && bits) {
48  MSG_ShowDeltaEntityBits(bits);
49  Com_LPrintf(PRINT_DEVELOPER, "\n");
50  }
51 #endif
52 
53  MSG_ParseDeltaEntity(old, state, newnum, bits, cl.esFlags);
54 
55  // shuffle previous origin to old
56  if (!(bits & U_OLDORIGIN) && !(state->renderfx & RF_BEAM))
57  VectorCopy(old->origin, state->old_origin);
58 }

Referenced by CL_ParsePacketEntities().

◆ CL_ParseDownload()

static void CL_ParseDownload ( int  cmd)
static

Definition at line 1033 of file parse.c.

1034 {
1035  int size, percent, compressed;
1036  byte *data;
1037 
1038  if (!cls.download.temp[0]) {
1039  Com_Error(ERR_DROP, "%s: no download requested", __func__);
1040  }
1041 
1042  // read the data
1043  size = MSG_ReadShort();
1044  percent = MSG_ReadByte();
1045  if (size == -1) {
1046  CL_HandleDownload(NULL, size, percent, qfalse);
1047  return;
1048  }
1049 
1050  // read optional uncompressed packet size
1051  if (cmd == svc_zdownload) {
1052  if (cls.serverProtocol == PROTOCOL_VERSION_R1Q2) {
1053  compressed = MSG_ReadShort();
1054  } else {
1055  compressed = -1;
1056  }
1057  } else {
1058  compressed = 0;
1059  }
1060 
1061  if (size < 0) {
1062  Com_Error(ERR_DROP, "%s: bad size: %d", __func__, size);
1063  }
1064 
1065  if (msg_read.readcount + size > msg_read.cursize) {
1066  Com_Error(ERR_DROP, "%s: read past end of message", __func__);
1067  }
1068 
1069  data = msg_read.data + msg_read.readcount;
1070  msg_read.readcount += size;
1071 
1072  CL_HandleDownload(data, size, percent, compressed);
1073 }

Referenced by CL_ParseServerMessage().

◆ CL_ParseFrame()

static void CL_ParseFrame ( int  extrabits)
static

Definition at line 189 of file parse.c.

190 {
191  uint32_t bits, extraflags;
192  int currentframe, deltaframe,
193  delta, suppressed;
194  server_frame_t frame, *oldframe;
195  player_state_t *from;
196  int length;
197 
198  memset(&frame, 0, sizeof(frame));
199 
200  cl.frameflags = 0;
201 
202  extraflags = 0;
203  if (cls.serverProtocol > PROTOCOL_VERSION_DEFAULT) {
204  bits = MSG_ReadLong();
205 
206  currentframe = bits & FRAMENUM_MASK;
207  delta = bits >> FRAMENUM_BITS;
208 
209  if (delta == 31) {
210  deltaframe = -1;
211  } else {
212  deltaframe = currentframe - delta;
213  }
214 
215  bits = MSG_ReadByte();
216 
217  suppressed = bits & SUPPRESSCOUNT_MASK;
218  if (cls.serverProtocol == PROTOCOL_VERSION_Q2PRO) {
219  if (suppressed & FF_CLIENTPRED) {
220  // CLIENTDROP is implied, don't draw both
221  suppressed &= ~FF_CLIENTDROP;
222  }
223  cl.frameflags |= suppressed;
224  } else if (suppressed) {
225  cl.frameflags |= FF_SUPPRESSED;
226  }
227  extraflags = (extrabits << 4) | (bits >> SUPPRESSCOUNT_BITS);
228  } else {
229  currentframe = MSG_ReadLong();
230  deltaframe = MSG_ReadLong();
231 
232  // BIG HACK to let old demos continue to work
233  if (cls.serverProtocol != PROTOCOL_VERSION_OLD) {
234  suppressed = MSG_ReadByte();
235  if (suppressed) {
236  cl.frameflags |= FF_SUPPRESSED;
237  }
238  }
239  }
240 
241  frame.number = currentframe;
242  frame.delta = deltaframe;
243 
244  if (cls.netchan && cls.netchan->dropped) {
246  }
247 
248  // if the frame is delta compressed from data that we no longer have
249  // available, we must suck up the rest of the frame, but not use it, then
250  // ask for a non-compressed message
251  if (deltaframe > 0) {
252  oldframe = &cl.frames[deltaframe & UPDATE_MASK];
253  from = &oldframe->ps;
254  if (deltaframe == currentframe) {
255  // old servers may cause this on map change
256  Com_DPrintf("%s: delta from current frame\n", __func__);
258  } else if (oldframe->number != deltaframe) {
259  // the frame that the server did the delta from
260  // is too old, so we can't reconstruct it properly.
261  Com_DPrintf("%s: delta frame was never received or too old\n", __func__);
263  } else if (!oldframe->valid) {
264  // should never happen
265  Com_DPrintf("%s: delta from invalid frame\n", __func__);
267  } else if (cl.numEntityStates - oldframe->firstEntity >
268  MAX_PARSE_ENTITIES - MAX_PACKET_ENTITIES) {
269  Com_DPrintf("%s: delta entities too old\n", __func__);
271  } else {
272  frame.valid = qtrue; // valid delta parse
273  }
274  if (!frame.valid && cl.frame.valid && cls.demo.playback) {
275  Com_DPrintf("%s: recovering broken demo\n", __func__);
276  oldframe = &cl.frame;
277  from = &oldframe->ps;
278  frame.valid = qtrue;
279  }
280  } else {
281  oldframe = NULL;
282  from = NULL;
283  frame.valid = qtrue; // uncompressed frame
285  }
286 
287  // read areabits
288  length = MSG_ReadByte();
289  if (length) {
290  if (length < 0 || msg_read.readcount + length > msg_read.cursize) {
291  Com_Error(ERR_DROP, "%s: read past end of message", __func__);
292  }
293  if (length > sizeof(frame.areabits)) {
294  Com_Error(ERR_DROP, "%s: invalid areabits length", __func__);
295  }
296  memcpy(frame.areabits, msg_read.data + msg_read.readcount, length);
297  msg_read.readcount += length;
298  frame.areabytes = length;
299  } else {
300  frame.areabytes = 0;
301  }
302 
303  if (cls.serverProtocol <= PROTOCOL_VERSION_DEFAULT) {
304  if (MSG_ReadByte() != svc_playerinfo) {
305  Com_Error(ERR_DROP, "%s: not playerinfo", __func__);
306  }
307  }
308 
309  SHOWNET(2, "%3"PRIz":playerinfo\n", msg_read.readcount - 1);
310 
311  // parse playerstate
312  bits = MSG_ReadShort();
313  if (cls.serverProtocol > PROTOCOL_VERSION_DEFAULT) {
314  MSG_ParseDeltaPlayerstate_Enhanced(from, &frame.ps, bits, extraflags);
315 #ifdef _DEBUG
316  if (cl_shownet->integer > 2 && (bits || extraflags)) {
317  MSG_ShowDeltaPlayerstateBits_Enhanced(bits, extraflags);
318  Com_LPrintf(PRINT_DEVELOPER, "\n");
319  }
320 #endif
321  if (cls.serverProtocol == PROTOCOL_VERSION_Q2PRO) {
322  // parse clientNum
323  if (extraflags & EPS_CLIENTNUM) {
324  frame.clientNum = MSG_ReadByte();
325  } else if (oldframe) {
326  frame.clientNum = oldframe->clientNum;
327  }
328  } else {
329  frame.clientNum = cl.clientNum;
330  }
331  } else {
332  MSG_ParseDeltaPlayerstate_Default(from, &frame.ps, bits);
333 #ifdef _DEBUG
334  if (cl_shownet->integer > 2 && bits) {
335  MSG_ShowDeltaPlayerstateBits_Default(bits);
336  Com_LPrintf(PRINT_DEVELOPER, "\n");
337  }
338 #endif
339  frame.clientNum = cl.clientNum;
340  }
341 
342  // parse packetentities
343  if (cls.serverProtocol <= PROTOCOL_VERSION_DEFAULT) {
344  if (MSG_ReadByte() != svc_packetentities) {
345  Com_Error(ERR_DROP, "%s: not packetentities", __func__);
346  }
347  }
348 
349  SHOWNET(2, "%3"PRIz":packetentities\n", msg_read.readcount - 1);
350 
351  CL_ParsePacketEntities(oldframe, &frame);
352 
353  // save the frame off in the backup array for later delta comparisons
354  cl.frames[currentframe & UPDATE_MASK] = frame;
355 
356 #ifdef _DEBUG
357  if (cl_shownet->integer > 2) {
358  int rtt = 0;
359  if (cls.netchan) {
360  int seq = cls.netchan->incoming_acknowledged & CMD_MASK;
361  rtt = cls.realtime - cl.history[seq].sent;
362  }
363  Com_LPrintf(PRINT_DEVELOPER, "%3"PRIz":frame:%d delta:%d rtt:%d\n",
364  msg_read.readcount - 1, frame.number, frame.delta, rtt);
365  }
366 #endif
367 
368  if (!frame.valid) {
369  cl.frame.valid = qfalse;
370 #if USE_FPS
371  cl.keyframe.valid = qfalse;
372 #endif
373  return; // do not change anything
374  }
375 
376  if (!frame.ps.fov) {
377  // fail out early to prevent spurious errors later
378  Com_Error(ERR_DROP, "%s: bad fov", __func__);
379  }
380 
381  if (cls.state < ca_precached)
382  return;
383 
384  cl.oldframe = cl.frame;
385  cl.frame = frame;
386 
387 #if USE_FPS
388  if (CL_FRAMESYNC) {
389  cl.oldkeyframe = cl.keyframe;
390  cl.keyframe = cl.frame;
391  }
392 #endif
393 
394  cls.demo.frames_read++;
395 
396  if (!cls.demo.seeking)
397  CL_DeltaFrame();
398 }

Referenced by CL_ParseServerMessage(), and CL_SeekDemoMessage().

◆ CL_ParseGamestate()

static void CL_ParseGamestate ( void  )
static

Definition at line 458 of file parse.c.

459 {
460  int index, bits;
461 
462  while (msg_read.readcount < msg_read.cursize) {
463  index = MSG_ReadShort();
464  if (index == MAX_CONFIGSTRINGS) {
465  break;
466  }
467  CL_ParseConfigstring(index);
468  }
469 
470  while (msg_read.readcount < msg_read.cursize) {
471  index = MSG_ParseEntityBits(&bits);
472  if (!index) {
473  break;
474  }
475  CL_ParseBaseline(index, bits);
476  }
477 }

Referenced by CL_ParseServerMessage().

◆ CL_ParseInventory()

static void CL_ParseInventory ( void  )
static

Definition at line 1024 of file parse.c.

1025 {
1026  int i;
1027 
1028  for (i = 0; i < MAX_ITEMS; i++) {
1029  cl.inventory[i] = MSG_ReadShort();
1030  }
1031 }

Referenced by CL_ParseServerMessage(), and CL_SeekDemoMessage().

◆ CL_ParseLayout()

static void CL_ParseLayout ( void  )
static

Definition at line 1018 of file parse.c.

1019 {
1020  MSG_ReadString(cl.layout, sizeof(cl.layout));
1021  SHOWNET(2, " \"%s\"\n", cl.layout);
1022 }

Referenced by CL_ParseServerMessage(), and CL_SeekDemoMessage().

◆ CL_ParseMuzzleFlashPacket()

static void CL_ParseMuzzleFlashPacket ( int  mask)
static

Definition at line 788 of file parse.c.

789 {
790  int entity, weapon;
791 
792  entity = MSG_ReadShort();
793  if (entity < 1 || entity >= MAX_EDICTS)
794  Com_Error(ERR_DROP, "%s: bad entity", __func__);
795 
796  weapon = MSG_ReadByte();
797  mz.silenced = weapon & mask;
798  mz.weapon = weapon & ~mask;
799  mz.entity = entity;
800 }

Referenced by CL_ParseServerMessage(), and CL_SeekDemoMessage().

◆ CL_ParsePacketEntities()

static void CL_ParsePacketEntities ( server_frame_t oldframe,
server_frame_t frame 
)
static

Definition at line 60 of file parse.c.

62 {
63  int newnum;
64  int bits;
65  entity_state_t *oldstate;
66  int oldindex, oldnum;
67  int i;
68 
70  frame->numEntities = 0;
71 
72  // delta from the entities present in oldframe
73  oldindex = 0;
74  oldstate = NULL;
75  if (!oldframe) {
76  oldnum = 99999;
77  } else {
78  if (oldindex >= oldframe->numEntities) {
79  oldnum = 99999;
80  } else {
81  i = oldframe->firstEntity + oldindex;
82  oldstate = &cl.entityStates[i & PARSE_ENTITIES_MASK];
83  oldnum = oldstate->number;
84  }
85  }
86 
87  while (1) {
88  newnum = MSG_ParseEntityBits(&bits);
89  if (newnum < 0 || newnum >= MAX_EDICTS) {
90  Com_Error(ERR_DROP, "%s: bad number: %d", __func__, newnum);
91  }
92 
93  if (msg_read.readcount > msg_read.cursize) {
94  Com_Error(ERR_DROP, "%s: read past end of message", __func__);
95  }
96 
97  if (!newnum) {
98  break;
99  }
100 
101  while (oldnum < newnum) {
102  // one or more entities from the old packet are unchanged
103  SHOWNET(3, " unchanged: %i\n", oldnum);
104  CL_ParseDeltaEntity(frame, oldnum, oldstate, 0);
105 
106  oldindex++;
107 
108  if (oldindex >= oldframe->numEntities) {
109  oldnum = 99999;
110  } else {
111  i = oldframe->firstEntity + oldindex;
112  oldstate = &cl.entityStates[i & PARSE_ENTITIES_MASK];
113  oldnum = oldstate->number;
114  }
115  }
116 
117  if (bits & U_REMOVE) {
118  // the entity present in oldframe is not in the current frame
119  SHOWNET(2, " remove: %i\n", newnum);
120  if (oldnum != newnum) {
121  Com_DPrintf("U_REMOVE: oldnum != newnum\n");
122  }
123  if (!oldframe) {
124  Com_Error(ERR_DROP, "%s: U_REMOVE with NULL oldframe", __func__);
125  }
126 
127  oldindex++;
128 
129  if (oldindex >= oldframe->numEntities) {
130  oldnum = 99999;
131  } else {
132  i = oldframe->firstEntity + oldindex;
133  oldstate = &cl.entityStates[i & PARSE_ENTITIES_MASK];
134  oldnum = oldstate->number;
135  }
136  continue;
137  }
138 
139  if (oldnum == newnum) {
140  // delta from previous state
141  SHOWNET(2, " delta: %i ", newnum);
142  CL_ParseDeltaEntity(frame, newnum, oldstate, bits);
143  if (!bits) {
144  SHOWNET(2, "\n");
145  }
146 
147  oldindex++;
148 
149  if (oldindex >= oldframe->numEntities) {
150  oldnum = 99999;
151  } else {
152  i = oldframe->firstEntity + oldindex;
153  oldstate = &cl.entityStates[i & PARSE_ENTITIES_MASK];
154  oldnum = oldstate->number;
155  }
156  continue;
157  }
158 
159  if (oldnum > newnum) {
160  // delta from baseline
161  SHOWNET(2, " baseline: %i ", newnum);
162  CL_ParseDeltaEntity(frame, newnum, &cl.baselines[newnum], bits);
163  if (!bits) {
164  SHOWNET(2, "\n");
165  }
166  continue;
167  }
168 
169  }
170 
171  // any remaining entities in the old frame are copied over
172  while (oldnum != 99999) {
173  // one or more entities from the old packet are unchanged
174  SHOWNET(3, " unchanged: %i\n", oldnum);
175  CL_ParseDeltaEntity(frame, oldnum, oldstate, 0);
176 
177  oldindex++;
178 
179  if (oldindex >= oldframe->numEntities) {
180  oldnum = 99999;
181  } else {
182  i = oldframe->firstEntity + oldindex;
183  oldstate = &cl.entityStates[i & PARSE_ENTITIES_MASK];
184  oldnum = oldstate->number;
185  }
186  }
187 }

Referenced by CL_ParseFrame().

◆ CL_ParsePrint()

static void CL_ParsePrint ( void  )
static

Definition at line 933 of file parse.c.

934 {
935  int level;
936  char s[MAX_STRING_CHARS];
937  const char *fmt;
938 
939  level = MSG_ReadByte();
940  MSG_ReadString(s, sizeof(s));
941 
942  SHOWNET(2, " %i \"%s\"\n", level, s);
943 
944  if (level != PRINT_CHAT) {
945  Com_Printf("%s", s);
946  if (!cls.demo.playback && cl.serverstate != ss_broadcast) {
947  COM_strclr(s);
948  Cmd_ExecTrigger(s);
949  }
950  return;
951  }
952 
953  if (CL_CheckForIgnore(s)) {
954  return;
955  }
956 
957 #if USE_AUTOREPLY
958  if (!cls.demo.playback && cl.serverstate != ss_broadcast) {
959  CL_CheckForVersion(s);
960  }
961 #endif
962 
963  CL_CheckForIP(s);
964 
965  // disable notify
966  if (!cl_chat_notify->integer) {
967  Con_SkipNotify(qtrue);
968  }
969 
970  // filter text
971  if (cl_chat_filter->integer) {
972  COM_strclr(s);
973  fmt = "%s\n";
974  } else {
975  fmt = "%s";
976  }
977 
978  Com_LPrintf(PRINT_TALK, fmt, s);
979 
980  Con_SkipNotify(qfalse);
981 
982  SCR_AddToChatHUD(s);
983 
984  // silence MVD spectator chat
985  if (cl.serverstate == ss_broadcast && !strncmp(s, "[MVD] ", 6))
986  return;
987 
988  // play sound
989  if (cl_chat_sound->integer > 1)
990  S_StartLocalSound_("misc/talk1.wav");
991  else if (cl_chat_sound->integer > 0)
992  S_StartLocalSound_("misc/talk.wav");
993 }

Referenced by CL_ParseServerMessage().

◆ CL_ParseReconnect()

static void CL_ParseReconnect ( void  )
static

Definition at line 851 of file parse.c.

852 {
853  if (cls.demo.playback) {
854  Com_Error(ERR_DISCONNECT, "Server disconnected");
855  }
856 
857  Com_Printf("Server disconnected, reconnecting\n");
858 
859  // free netchan now to prevent `disconnect'
860  // message from being sent to server
861  if (cls.netchan) {
863  cls.netchan = NULL;
864  }
865 
866  CL_Disconnect(ERR_RECONNECT);
867 
870  cls.connect_count = 0;
871 
873 }

Referenced by CL_ParseServerMessage().

◆ CL_ParseServerData()

static void CL_ParseServerData ( void  )
static

Definition at line 479 of file parse.c.

480 {
481  char levelname[MAX_QPATH];
482  int i, protocol, attractloop q_unused;
483  size_t len;
484 
485  Cbuf_Execute(&cl_cmdbuf); // make sure any stuffed commands are done
486 
487  // wipe the client_state_t struct
488  CL_ClearState();
489 
490  // parse protocol version number
491  protocol = MSG_ReadLong();
493  attractloop = MSG_ReadByte();
494 
495  Com_DPrintf("Serverdata packet received "
496  "(protocol=%d, servercount=%d, attractloop=%d)\n",
497  protocol, cl.servercount, attractloop);
498 
499  // check protocol
500  if (cls.serverProtocol != protocol) {
501  if (!cls.demo.playback) {
502  Com_Error(ERR_DROP, "Requested protocol version %d, but server returned %d.",
503  cls.serverProtocol, protocol);
504  }
505  // BIG HACK to let demos from release work with the 3.0x patch!!!
506  if (protocol < PROTOCOL_VERSION_OLD || protocol > PROTOCOL_VERSION_Q2PRO) {
507  Com_Error(ERR_DROP, "Demo uses unsupported protocol version %d.", protocol);
508  }
509  cls.serverProtocol = protocol;
510  }
511 
512  // game directory
513  len = MSG_ReadString(cl.gamedir, sizeof(cl.gamedir));
514  if (len >= sizeof(cl.gamedir)) {
515  Com_Error(ERR_DROP, "Oversize gamedir string");
516  }
517 
518  // never allow demos to change gamedir
519  // do not change gamedir if connected to local sever either,
520  // as it was already done by SV_InitGame, and changing it
521  // here will not work since server is now running
522  if (!cls.demo.playback && !sv_running->integer) {
523  // pretend it has been set by user, so that 'changed' hook
524  // gets called and filesystem is restarted
525  Cvar_UserSet("game", cl.gamedir);
526 
527  // protect it from modifications while we are connected
528  fs_game->flags |= CVAR_ROM;
529  }
530 
531  // parse player entity number
533 
534  // get the full level name
535  MSG_ReadString(levelname, sizeof(levelname));
536 
537  // setup default pmove parameters
538  PmoveInit(&cl.pmp);
539 
540 #if USE_FPS
541  // setup default frame times
542  cl.frametime = BASE_FRAMETIME;
543  cl.frametime_inv = BASE_1_FRAMETIME;
544  cl.framediv = 1;
545 #endif
546 
547  // setup default server state
548  cl.serverstate = ss_game;
549 
550  if (cls.serverProtocol == PROTOCOL_VERSION_R1Q2) {
551  i = MSG_ReadByte();
552  if (i) {
553  Com_Error(ERR_DROP, "'Enhanced' R1Q2 servers are not supported");
554  }
555  i = MSG_ReadShort();
556  // for some reason, R1Q2 servers always report the highest protocol
557  // version they support, while still using the lower version
558  // client specified in the 'connect' packet. oh well...
559  if (!R1Q2_SUPPORTED(i)) {
560  Com_WPrintf(
561  "R1Q2 server reports unsupported protocol version %d.\n"
562  "Assuming it really uses our current client version %d.\n"
563  "Things will break if it does not!\n", i, PROTOCOL_VERSION_R1Q2_CURRENT);
564  clamp(i, PROTOCOL_VERSION_R1Q2_MINIMUM, PROTOCOL_VERSION_R1Q2_CURRENT);
565  }
566  Com_DPrintf("Using minor R1Q2 protocol version %d\n", i);
567  cls.protocolVersion = i;
568  MSG_ReadByte(); // used to be advanced deltas
569  i = MSG_ReadByte();
570  if (i) {
571  Com_DPrintf("R1Q2 strafejump hack enabled\n");
572  cl.pmp.strafehack = qtrue;
573  }
574  cl.esFlags |= MSG_ES_BEAMORIGIN;
575  if (cls.protocolVersion >= PROTOCOL_VERSION_R1Q2_LONG_SOLID) {
576  cl.esFlags |= MSG_ES_LONGSOLID;
577  }
578  cl.pmp.speedmult = 2;
579  } else if (cls.serverProtocol == PROTOCOL_VERSION_Q2PRO) {
580  i = MSG_ReadShort();
581  if (!Q2PRO_SUPPORTED(i)) {
582  Com_Error(ERR_DROP,
583  "Q2PRO server reports unsupported protocol version %d.\n"
584  "Current client version is %d.", i, PROTOCOL_VERSION_Q2PRO_CURRENT);
585  }
586  Com_DPrintf("Using minor Q2PRO protocol version %d\n", i);
587  cls.protocolVersion = i;
588  i = MSG_ReadByte();
589  if (cls.protocolVersion >= PROTOCOL_VERSION_Q2PRO_SERVER_STATE) {
590  Com_DPrintf("Q2PRO server state %d\n", i);
591  cl.serverstate = i;
592  }
593  i = MSG_ReadByte();
594  if (i) {
595  Com_DPrintf("Q2PRO strafejump hack enabled\n");
596  cl.pmp.strafehack = qtrue;
597  }
598  i = MSG_ReadByte(); //atu QWMod
599  if (i) {
600  Com_DPrintf("Q2PRO QW mode enabled\n");
601  PmoveEnableQW(&cl.pmp);
602  }
603  cl.esFlags |= MSG_ES_UMASK;
604  if (cls.protocolVersion >= PROTOCOL_VERSION_Q2PRO_LONG_SOLID) {
605  cl.esFlags |= MSG_ES_LONGSOLID;
606  }
607  if (cls.protocolVersion >= PROTOCOL_VERSION_Q2PRO_BEAM_ORIGIN) {
608  cl.esFlags |= MSG_ES_BEAMORIGIN;
609  }
610  if (cls.protocolVersion >= PROTOCOL_VERSION_Q2PRO_SHORT_ANGLES) {
611  cl.esFlags |= MSG_ES_SHORTANGLES;
612  }
613  if (cls.protocolVersion >= PROTOCOL_VERSION_Q2PRO_WATERJUMP_HACK) {
614  i = MSG_ReadByte();
615  if (i) {
616  Com_DPrintf("Q2PRO waterjump hack enabled\n");
617  cl.pmp.waterhack = qtrue;
618  }
619  }
620  cl.pmp.speedmult = 2;
621  cl.pmp.flyhack = qtrue; // fly hack is unconditionally enabled
622  cl.pmp.flyfriction = 4;
623  }
624 
625  if (cl.clientNum == -1) {
626  SCR_PlayCinematic(levelname);
627  } else {
628  // seperate the printfs so the server message can have a color
629  Con_Printf(
630  "\n\n"
631  "\35\36\36\36\36\36\36\36\36\36\36\36"
632  "\36\36\36\36\36\36\36\36\36\36\36\36"
633  "\36\36\36\36\36\36\36\36\36\36\36\37"
634  "\n\n");
635 
636  Com_SetColor(COLOR_ALT);
637  Com_Printf("%s\n", levelname);
638  Com_SetColor(COLOR_NONE);
639 
640  // make sure clientNum is in range
641  if (cl.clientNum < 0 || cl.clientNum >= MAX_CLIENTS) {
642  cl.clientNum = CLIENTNUM_NONE;
643  }
644  }
645 }

Referenced by CL_ParseServerMessage().

◆ CL_ParseServerMessage()

void CL_ParseServerMessage ( void  )

Definition at line 1168 of file parse.c.

1169 {
1170  int cmd, extrabits;
1171  size_t readcount;
1172  int index, bits;
1173 
1174 #ifdef _DEBUG
1175  if (cl_shownet->integer == 1) {
1176  Com_LPrintf(PRINT_DEVELOPER, "%"PRIz" ", msg_read.cursize);
1177  } else if (cl_shownet->integer > 1) {
1178  Com_LPrintf(PRINT_DEVELOPER, "------------------\n");
1179  }
1180 #endif
1181 
1182 //
1183 // parse the message
1184 //
1185  while (1) {
1186  if (msg_read.readcount > msg_read.cursize) {
1187  Com_Error(ERR_DROP, "%s: read past end of server message", __func__);
1188  }
1189 
1190  readcount = msg_read.readcount;
1191 
1192  if ((cmd = MSG_ReadByte()) == -1) {
1193  SHOWNET(1, "%3"PRIz":END OF MESSAGE\n", msg_read.readcount - 1);
1194  break;
1195  }
1196 
1197  extrabits = cmd >> SVCMD_BITS;
1198  cmd &= SVCMD_MASK;
1199 
1200 #ifdef _DEBUG
1201  if (cl_shownet->integer > 1) {
1202  MSG_ShowSVC(cmd);
1203  }
1204 #endif
1205 
1206  // other commands
1207  switch (cmd) {
1208  default:
1209 badbyte:
1210  Com_Error(ERR_DROP, "%s: illegible server message: %d", __func__, cmd);
1211  break;
1212 
1213  case svc_nop:
1214  break;
1215 
1216  case svc_disconnect:
1217  Com_Error(ERR_DISCONNECT, "Server disconnected");
1218  break;
1219 
1220  case svc_reconnect:
1222  return;
1223 
1224  case svc_print:
1225  CL_ParsePrint();
1226  break;
1227 
1228  case svc_centerprint:
1230  break;
1231 
1232  case svc_stufftext:
1234  break;
1235 
1236  case svc_serverdata:
1238  continue;
1239 
1240  case svc_configstring:
1241  index = MSG_ReadShort();
1242  CL_ParseConfigstring(index);
1243  break;
1244 
1245  case svc_sound:
1248  break;
1249 
1250  case svc_spawnbaseline:
1251  index = MSG_ParseEntityBits(&bits);
1252  CL_ParseBaseline(index, bits);
1253  break;
1254 
1255  case svc_temp_entity:
1257  CL_ParseTEnt();
1258  break;
1259 
1260  case svc_muzzleflash:
1261  CL_ParseMuzzleFlashPacket(MZ_SILENCED);
1262  CL_MuzzleFlash();
1263  break;
1264 
1265  case svc_muzzleflash2:
1267  CL_MuzzleFlash2();
1268  break;
1269 
1270  case svc_download:
1271  CL_ParseDownload(cmd);
1272  continue;
1273 
1274  case svc_frame:
1275  CL_ParseFrame(extrabits);
1276  continue;
1277 
1278  case svc_inventory:
1280  break;
1281 
1282  case svc_layout:
1283  CL_ParseLayout();
1284  break;
1285 
1286  case svc_zpacket:
1287  if (cls.serverProtocol < PROTOCOL_VERSION_R1Q2) {
1288  goto badbyte;
1289  }
1290  CL_ParseZPacket();
1291  continue;
1292 
1293  case svc_zdownload:
1294  if (cls.serverProtocol < PROTOCOL_VERSION_R1Q2) {
1295  goto badbyte;
1296  }
1297  CL_ParseDownload(cmd);
1298  continue;
1299 
1300  case svc_gamestate:
1301  if (cls.serverProtocol != PROTOCOL_VERSION_Q2PRO) {
1302  goto badbyte;
1303  }
1305  continue;
1306 
1307  case svc_setting:
1308  if (cls.serverProtocol < PROTOCOL_VERSION_R1Q2) {
1309  goto badbyte;
1310  }
1311  CL_ParseSetting();
1312  continue;
1313  }
1314 
1315  // if recording demos, copy off protocol invariant stuff
1316  if (cls.demo.recording && !cls.demo.paused) {
1317  size_t len = msg_read.readcount - readcount;
1318 
1319  // it is very easy to overflow standard 1390 bytes
1320  // demo frame with modern servers... attempt to preserve
1321  // reliable messages at least, assuming they come first
1322  if (cls.demo.buffer.cursize + len < cls.demo.buffer.maxsize) {
1323  SZ_Write(&cls.demo.buffer, msg_read.data + readcount, len);
1324  } else {
1326  }
1327  }
1328 
1329  // if running GTV server, add current message
1330  CL_GTV_WriteMessage(msg_read.data + readcount,
1331  msg_read.readcount - readcount);
1332  }
1333 }

Referenced by CL_PacketEvent(), CL_ParseZPacket(), CL_PlayDemo_f(), and parse_next_message().

◆ CL_ParseSetting()

static void CL_ParseSetting ( void  )
static

Definition at line 1144 of file parse.c.

1145 {
1146  int index q_unused;
1147  int value q_unused;
1148 
1149  index = MSG_ReadLong();
1150  value = MSG_ReadLong();
1151 
1152  switch (index) {
1153 #if USE_FPS
1154  case SVS_FPS:
1155  set_server_fps(value);
1156  break;
1157 #endif
1158  default:
1159  break;
1160  }
1161 }

Referenced by CL_ParseServerMessage().

◆ CL_ParseStartSoundPacket()

static void CL_ParseStartSoundPacket ( void  )
static

Definition at line 802 of file parse.c.

803 {
804  int flags, channel, entity;
805 
806  flags = MSG_ReadByte();
807  if ((flags & (SND_ENT | SND_POS)) == 0)
808  Com_Error(ERR_DROP, "%s: neither SND_ENT nor SND_POS set", __func__);
809 
810  snd.index = MSG_ReadByte();
811  if (snd.index == -1)
812  Com_Error(ERR_DROP, "%s: read past end of message", __func__);
813 
814  if (flags & SND_VOLUME)
815  snd.volume = MSG_ReadByte() / 255.0f;
816  else
817  snd.volume = DEFAULT_SOUND_PACKET_VOLUME;
818 
819  if (flags & SND_ATTENUATION)
820  snd.attenuation = MSG_ReadByte() / 64.0f;
821  else
822  snd.attenuation = DEFAULT_SOUND_PACKET_ATTENUATION;
823 
824  if (flags & SND_OFFSET)
825  snd.timeofs = MSG_ReadByte() / 1000.0f;
826  else
827  snd.timeofs = 0;
828 
829  if (flags & SND_ENT) {
830  // entity relative
831  channel = MSG_ReadShort();
832  entity = channel >> 3;
833  if (entity < 0 || entity >= MAX_EDICTS)
834  Com_Error(ERR_DROP, "%s: bad entity: %d", __func__, entity);
835  snd.entity = entity;
836  snd.channel = channel & 7;
837  } else {
838  snd.entity = 0;
839  snd.channel = 0;
840  }
841 
842  // positioned in space
843  if (flags & SND_POS)
845 
846  snd.flags = flags;
847 
848  SHOWNET(2, " %s\n", cl.configstrings[CS_SOUNDS + snd.index]);
849 }

Referenced by CL_ParseServerMessage(), and CL_SeekDemoMessage().

◆ CL_ParseStuffText()

static void CL_ParseStuffText ( void  )
static

Definition at line 1009 of file parse.c.

1010 {
1011  char s[MAX_STRING_CHARS];
1012 
1013  MSG_ReadString(s, sizeof(s));
1014  SHOWNET(2, " \"%s\"\n", s);
1015  Cbuf_AddText(&cl_cmdbuf, s);
1016 }

Referenced by CL_ParseServerMessage().

◆ CL_ParseTEntPacket()

static void CL_ParseTEntPacket ( void  )
static

Definition at line 659 of file parse.c.

660 {
661  te.type = MSG_ReadByte();
662 
663  switch (te.type) {
664  case TE_BLOOD:
665  case TE_GUNSHOT:
666  case TE_SPARKS:
667  case TE_BULLET_SPARKS:
668  case TE_SCREEN_SPARKS:
669  case TE_SHIELD_SPARKS:
670  case TE_SHOTGUN:
671  case TE_BLASTER:
672  case TE_GREENBLOOD:
673  case TE_BLASTER2:
674  case TE_FLECHETTE:
675  case TE_HEATBEAM_SPARKS:
676  case TE_HEATBEAM_STEAM:
677  case TE_MOREBLOOD:
678  case TE_ELECTRIC_SPARKS:
680  MSG_ReadDir(te.dir);
681  break;
682 
683  case TE_SPLASH:
684  case TE_LASER_SPARKS:
685  case TE_WELDING_SPARKS:
686  case TE_TUNNEL_SPARKS:
687  te.count = MSG_ReadByte();
689  MSG_ReadDir(te.dir);
690  te.color = MSG_ReadByte();
691  break;
692 
693  case TE_BLUEHYPERBLASTER:
694  case TE_RAILTRAIL:
695  case TE_BUBBLETRAIL:
696  case TE_DEBUGTRAIL:
697  case TE_BUBBLETRAIL2:
698  case TE_BFG_LASER:
701  break;
702 
703  case TE_GRENADE_EXPLOSION:
704  case TE_GRENADE_EXPLOSION_WATER:
705  case TE_EXPLOSION2:
706  case TE_PLASMA_EXPLOSION:
707  case TE_ROCKET_EXPLOSION:
708  case TE_ROCKET_EXPLOSION_WATER:
709  case TE_EXPLOSION1:
710  case TE_EXPLOSION1_NP:
711  case TE_EXPLOSION1_BIG:
712  case TE_BFG_EXPLOSION:
713  case TE_BFG_BIGEXPLOSION:
714  case TE_BOSSTPORT:
715  case TE_PLAIN_EXPLOSION:
716  case TE_CHAINFIST_SMOKE:
717  case TE_TRACKER_EXPLOSION:
718  case TE_TELEPORT_EFFECT:
719  case TE_DBALL_GOAL:
720  case TE_WIDOWSPLASH:
721  case TE_NUKEBLAST:
723  break;
724 
725  case TE_PARASITE_ATTACK:
726  case TE_MEDIC_CABLE_ATTACK:
727  case TE_HEATBEAM:
728  case TE_MONSTER_HEATBEAM:
732  break;
733 
734  case TE_GRAPPLE_CABLE:
739  break;
740 
741  case TE_LIGHTNING:
746  break;
747 
748  case TE_FLASHLIGHT:
751  break;
752 
753  case TE_FORCEWALL:
756  te.color = MSG_ReadByte();
757  break;
758 
759  case TE_STEAM:
761  te.count = MSG_ReadByte();
763  MSG_ReadDir(te.dir);
764  te.color = MSG_ReadByte();
766  if (te.entity1 != -1) {
767  te.time = MSG_ReadLong();
768  }
769  break;
770 
771  case TE_WIDOWBEAMOUT:
774  break;
775 
776  case TE_FLARE:
778  te.count = MSG_ReadByte();
780  MSG_ReadDir(te.dir);
781  break;
782 
783  default:
784  Com_Error(ERR_DROP, "%s: bad type", __func__);
785  }
786 }

Referenced by CL_ParseServerMessage(), and CL_SeekDemoMessage().

◆ CL_ParseZPacket()

static void CL_ParseZPacket ( void  )
static

Definition at line 1075 of file parse.c.

1076 {
1077 #if USE_ZLIB
1078  sizebuf_t temp;
1079  byte buffer[MAX_MSGLEN];
1080  int inlen, outlen;
1081 
1082  if (msg_read.data != msg_read_buffer) {
1083  Com_Error(ERR_DROP, "%s: recursively entered", __func__);
1084  }
1085 
1086  inlen = MSG_ReadWord();
1087  outlen = MSG_ReadWord();
1088 
1089  if (inlen == -1 || outlen == -1 || msg_read.readcount + inlen > msg_read.cursize) {
1090  Com_Error(ERR_DROP, "%s: read past end of message", __func__);
1091  }
1092 
1093  if (outlen > MAX_MSGLEN) {
1094  Com_Error(ERR_DROP, "%s: invalid output length", __func__);
1095  }
1096 
1097  inflateReset(&cls.z);
1098 
1099  cls.z.next_in = msg_read.data + msg_read.readcount;
1100  cls.z.avail_in = (uInt)inlen;
1101  cls.z.next_out = buffer;
1102  cls.z.avail_out = (uInt)outlen;
1103  if (inflate(&cls.z, Z_FINISH) != Z_STREAM_END) {
1104  Com_Error(ERR_DROP, "%s: inflate() failed: %s", __func__, cls.z.msg);
1105  }
1106 
1107  msg_read.readcount += inlen;
1108 
1109  temp = msg_read;
1110  SZ_Init(&msg_read, buffer, outlen);
1111  msg_read.cursize = outlen;
1112 
1114 
1115  msg_read = temp;
1116 #else
1117  Com_Error(ERR_DROP, "Compressed server packet received, "
1118  "but no zlib support linked in.");
1119 #endif
1120 }

Referenced by CL_ParseServerMessage().

◆ CL_SeekDemoMessage()

void CL_SeekDemoMessage ( void  )

Definition at line 1343 of file parse.c.

1344 {
1345  int cmd, extrabits;
1346  int index;
1347 
1348 #ifdef _DEBUG
1349  if (cl_shownet->integer == 1) {
1350  Com_LPrintf(PRINT_DEVELOPER, "%"PRIz" ", msg_read.cursize);
1351  } else if (cl_shownet->integer > 1) {
1352  Com_LPrintf(PRINT_DEVELOPER, "------------------\n");
1353  }
1354 #endif
1355 
1356 //
1357 // parse the message
1358 //
1359  while (1) {
1360  if (msg_read.readcount > msg_read.cursize) {
1361  Com_Error(ERR_DROP, "%s: read past end of server message", __func__);
1362  }
1363 
1364  if ((cmd = MSG_ReadByte()) == -1) {
1365  SHOWNET(1, "%3"PRIz":END OF MESSAGE\n", msg_read.readcount - 1);
1366  break;
1367  }
1368 
1369  extrabits = cmd >> SVCMD_BITS;
1370  cmd &= SVCMD_MASK;
1371 
1372 #ifdef _DEBUG
1373  if (cl_shownet->integer > 1) {
1374  MSG_ShowSVC(cmd);
1375  }
1376 #endif
1377 
1378  // other commands
1379  switch (cmd) {
1380  default:
1381  Com_Error(ERR_DROP, "%s: illegible server message: %d", __func__, cmd);
1382  break;
1383 
1384  case svc_nop:
1385  break;
1386 
1387  case svc_disconnect:
1388  case svc_reconnect:
1389  Com_Error(ERR_DISCONNECT, "Server disconnected");
1390  break;
1391 
1392  case svc_print:
1393  MSG_ReadByte();
1394  // fall thorugh
1395 
1396  case svc_centerprint:
1397  case svc_stufftext:
1398  MSG_ReadString(NULL, 0);
1399  break;
1400 
1401  case svc_configstring:
1402  index = MSG_ReadShort();
1403  CL_ParseConfigstring(index);
1404  break;
1405 
1406  case svc_sound:
1408  break;
1409 
1410  case svc_temp_entity:
1412  break;
1413 
1414  case svc_muzzleflash:
1415  case svc_muzzleflash2:
1417  break;
1418 
1419  case svc_frame:
1420  CL_ParseFrame(extrabits);
1421  continue;
1422 
1423  case svc_inventory:
1425  break;
1426 
1427  case svc_layout:
1428  CL_ParseLayout();
1429  break;
1430 
1431  }
1432  }
1433 }

Referenced by CL_Seek_f().

Variable Documentation

◆ mz

Definition at line 656 of file parse.c.

Referenced by CL_MuzzleFlash(), CL_MuzzleFlash2(), and CL_ParseMuzzleFlashPacket().

◆ snd

Definition at line 657 of file parse.c.

Referenced by CL_ParseStartSoundPacket(), and S_ParseStartSound().

◆ te

client_state_s::frame
server_frame_t frame
Definition: client.h:212
server_frame_t::valid
qboolean valid
Definition: client.h:129
tent_params_t::time
int time
Definition: client.h:669
client_static_s::connect_time
unsigned connect_time
Definition: client.h:411
client_state_s::configstrings
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
Definition: client.h:289
client_state_s::inventory
int inventory[MAX_ITEMS]
Definition: client.h:270
tent_params_t::offset
vec3_t offset
Definition: client.h:663
CL_ParseServerData
static void CL_ParseServerData(void)
Definition: parse.c:479
snd_params_t::flags
int flags
Definition: client.h:679
tent_params_t::pos1
vec3_t pos1
Definition: client.h:661
mz
mz_params_t mz
Definition: parse.c:656
cl_chat_filter
cvar_t * cl_chat_filter
Definition: main.c:55
PmoveEnableQW
void PmoveEnableQW(pmoveParams_t *pmp)
Definition: pmove.c:1250
CL_MuzzleFlash2
void CL_MuzzleFlash2(void)
Definition: effects.c:459
msg_read
sizebuf_t msg_read
Definition: msg.c:37
client_state_s::entityStates
entity_state_t entityStates[MAX_PARSE_ENTITIES]
Definition: client.h:204
CL_ParseReconnect
static void CL_ParseReconnect(void)
Definition: parse.c:851
msg_read_buffer
byte msg_read_buffer[MAX_MSGLEN]
Definition: msg.c:38
client_static_s::playback
qhandle_t playback
Definition: client.h:453
CL_ParseZPacket
static void CL_ParseZPacket(void)
Definition: parse.c:1075
FF_OLDFRAME
#define FF_OLDFRAME
Definition: client.h:147
CL_ParsePrint
static void CL_ParsePrint(void)
Definition: parse.c:933
FF_SERVERDROP
#define FF_SERVERDROP
Definition: client.h:145
client_static_s::demo
struct client_static_s::@3 demo
snd_params_t::entity
int entity
Definition: client.h:681
client_static_s::buffer
sizebuf_t buffer
Definition: client.h:466
CL_ParseBaseline
static void CL_ParseBaseline(int index, int bits)
Definition: parse.c:442
Con_SkipNotify
void Con_SkipNotify(qboolean skip)
Definition: console.c:99
tent_params_t::entity1
int entity1
Definition: client.h:667
tent_params_t::dir
vec3_t dir
Definition: client.h:664
cl_cmdbuf
cmdbuf_t cl_cmdbuf
Definition: main.c:104
CL_GTV_WriteMessage
void CL_GTV_WriteMessage(byte *data, size_t len)
Definition: gtv.c:217
client_state_s::serverstate
int serverstate
Definition: client.h:275
MSG_ReadWord
int MSG_ReadWord(void)
Definition: msg.c:1503
svc_muzzleflash2
#define svc_muzzleflash2
Definition: g_local.h:37
Cmd_ExecTrigger
void Cmd_ExecTrigger(const char *string)
Definition: cmd.c:576
snd_params_t::volume
float volume
Definition: client.h:684
te
tent_params_t te
Definition: parse.c:655
client_static_s::state
connstate_t state
Definition: client.h:375
client_state_s::gamedir
char gamedir[MAX_QPATH]
Definition: client.h:277
snd
snd_params_t snd
Definition: parse.c:657
Con_Printf
void Con_Printf(const char *fmt,...)
Definition: console.c:611
CL_HandleDownload
void CL_HandleDownload(byte *data, int size, int percent, int compressed)
Definition: download.c:424
client_state_s::dcs
byte dcs[CS_BITMAP_BYTES]
Definition: client.h:223
client_state_s::oldframe
server_frame_t oldframe
Definition: client.h:213
CL_MuzzleFlash
void CL_MuzzleFlash(void)
Definition: effects.c:257
client_static_s::connect_count
int connect_count
Definition: client.h:412
snd_params_t::attenuation
float attenuation
Definition: client.h:685
MSG_ReadPos
void MSG_ReadPos(vec3_t pos)
Definition: msg.c:1580
CL_ClearState
void CL_ClearState(void)
Definition: main.c:699
SHOWNET
#define SHOWNET(...)
Definition: parse.c:61
svc_muzzleflash
#define svc_muzzleflash
Definition: g_local.h:36
svc_stufftext
#define svc_stufftext
Definition: g_local.h:41
SZ_Init
void SZ_Init(sizebuf_t *buf, void *data, size_t size)
Definition: sizebuf.c:31
tent_params_t::entity2
int entity2
Definition: client.h:668
CL_Disconnect
void CL_Disconnect(error_type_t type)
Definition: main.c:740
server_frame_t::areabytes
int areabytes
Definition: client.h:135
client_static_s::recording
qhandle_t recording
Definition: client.h:454
client_state_s::servercount
int servercount
Definition: client.h:276
ca_precached
@ ca_precached
Definition: client.h:339
client_static_s::seeking
qboolean seeking
Definition: client.h:469
Com_Error
void Com_Error(error_type_t type, const char *fmt,...)
Definition: g_main.c:258
client_state_s::frameflags
unsigned frameflags
Definition: client.h:210
client_state_s::clientNum
int clientNum
Definition: client.h:278
FF_OLDENT
#define FF_OLDENT
Definition: client.h:148
client_static_s::others_dropped
int others_dropped
Definition: client.h:460
svc_temp_entity
#define svc_temp_entity
Definition: g_local.h:38
client_state_s::baselines
entity_state_t baselines[MAX_EDICTS]
Definition: client.h:202
CL_ParseGamestate
static void CL_ParseGamestate(void)
Definition: parse.c:458
client_static_s::frames_read
int frames_read
Definition: client.h:461
Cbuf_AddText
void Cbuf_AddText(cmdbuf_t *buf, const char *text)
Definition: cmd.c:95
client_static_s::serverProtocol
int serverProtocol
Definition: client.h:422
CL_ParseCenterPrint
static void CL_ParseCenterPrint(void)
Definition: parse.c:995
client_state_s::layout
char layout[MAX_NET_STRING]
Definition: client.h:269
server_frame_t::areabits
byte areabits[MAX_MAP_AREA_BYTES]
Definition: client.h:134
MSG_ReadLong
int MSG_ReadLong(void)
Definition: msg.c:1517
CL_ParseTEntPacket
static void CL_ParseTEntPacket(void)
Definition: parse.c:659
client_history_t::sent
unsigned sent
Definition: client.h:123
CL_ParseTEnt
void CL_ParseTEnt(void)
Definition: tent.c:1069
client_state_s::esFlags
msgEsFlags_t esFlags
Definition: client.h:207
fs_game
cvar_t * fs_game
Definition: files.c:202
S_StartLocalSound_
void S_StartLocalSound_(const char *sound)
Definition: main.c:919
CL_ParseMuzzleFlashPacket
static void CL_ParseMuzzleFlashPacket(int mask)
Definition: parse.c:788
Com_LPrintf
void Com_LPrintf(print_type_t type, const char *fmt,...)
Definition: g_main.c:242
CL_ParseDeltaEntity
static void CL_ParseDeltaEntity(server_frame_t *frame, int newnum, entity_state_t *old, int bits)
Definition: parse.c:30
cl_chat_notify
cvar_t * cl_chat_notify
Definition: main.c:53
server_frame_t
Definition: client.h:128
snd_params_t::index
int index
Definition: client.h:680
S_ParseStartSound
void S_ParseStartSound(void)
Definition: main.c:889
SCR_CenterPrint
void SCR_CenterPrint(const char *str)
Definition: screen.c:462
FF_BADFRAME
#define FF_BADFRAME
Definition: client.h:146
Cvar_UserSet
cvar_t * Cvar_UserSet(const char *var_name, const char *value)
Definition: cvar.c:476
CL_UpdateConfigstring
void CL_UpdateConfigstring(int index)
Definition: precache.c:417
cl
client_state_t cl
Definition: main.c:99
CL_ParseServerMessage
void CL_ParseServerMessage(void)
Definition: parse.c:1168
server_frame_t::clientNum
int clientNum
Definition: client.h:138
server_frame_t::delta
int delta
Definition: client.h:132
CL_ParseInventory
static void CL_ParseInventory(void)
Definition: parse.c:1024
cls
client_static_t cls
Definition: main.c:98
client_state_s::frames
server_frame_t frames[UPDATE_BACKUP]
Definition: client.h:209
CL_ParseFrame
static void CL_ParseFrame(int extrabits)
Definition: parse.c:189
SCR_PlayCinematic
void SCR_PlayCinematic(const char *name)
Definition: cin.c:477
client_state_s::numEntityStates
int numEntityStates
Definition: client.h:205
client_static_s::recent_addr
netadr_t recent_addr[RECENT_ADDR]
Definition: client.h:434
server_frame_t::numEntities
int numEntities
Definition: client.h:140
snd_params_t::pos
vec3_t pos
Definition: client.h:683
CL_ParsePacketEntities
static void CL_ParsePacketEntities(server_frame_t *oldframe, server_frame_t *frame)
Definition: parse.c:60
ca_challenging
@ ca_challenging
Definition: client.h:335
mz_params_t::silenced
int silenced
Definition: client.h:675
client_static_s::download
struct client_static_s::@2 download
MSG_ReadString
size_t MSG_ReadString(char *dest, size_t size)
Definition: msg.c:1531
svc_inventory
#define svc_inventory
Definition: g_local.h:40
server_frame_t::ps
player_state_t ps
Definition: client.h:137
PmoveInit
void PmoveInit(pmoveParams_t *pmp)
Definition: pmove.c:1237
level
level_locals_t level
Definition: g_main.c:22
CL_ParseConfigstring
static void CL_ParseConfigstring(int index)
Definition: parse.c:408
snd_params_t::timeofs
float timeofs
Definition: client.h:686
Com_SetColor
void Com_SetColor(color_index_t color)
Definition: common.c:373
client_static_s::recent_head
int recent_head
Definition: client.h:435
CL_CheckForResend
void CL_CheckForResend(void)
Definition: main.c:387
Cbuf_Execute
void Cbuf_Execute(cmdbuf_t *buf)
Definition: cmd.c:152
CL_DeltaFrame
void CL_DeltaFrame(void)
Definition: entities.c:358
CL_ParseStuffText
static void CL_ParseStuffText(void)
Definition: parse.c:1009
mz_params_t::weapon
int weapon
Definition: client.h:674
CL_CheckForIgnore
qboolean CL_CheckForIgnore(const char *s)
Definition: main.c:2043
server_frame_t::number
int number
Definition: client.h:131
client_static_s::realtime
unsigned realtime
Definition: client.h:389
client_static_s::temp
char temp[MAX_QPATH+4]
Definition: client.h:444
CL_ParseStartSoundPacket
static void CL_ParseStartSoundPacket(void)
Definition: parse.c:802
svc_layout
#define svc_layout
Definition: g_local.h:39
sv_running
cvar_t * sv_running
Definition: common.c:95
cl_chat_sound
cvar_t * cl_chat_sound
Definition: main.c:54
client_state_s::history
client_history_t history[CMD_BACKUP]
Definition: client.h:186
snd_params_t::channel
int channel
Definition: client.h:682
CONNECT_FAST
#define CONNECT_FAST
Definition: client.h:330
Netchan_Close
void Netchan_Close(netchan_t *netchan)
Definition: chan.c:866
MSG_ReadByte
int MSG_ReadByte(void)
Definition: msg.c:1475
tent_params_t::type
int type
Definition: client.h:660
MSG_ReadDir
void MSG_ReadDir(vec3_t dir)
Definition: msg.c:1597
RECENT_MASK
#define RECENT_MASK
Definition: client.h:432
CL_ParseDownload
static void CL_ParseDownload(int cmd)
Definition: parse.c:1033
client_static_s::protocolVersion
int protocolVersion
Definition: client.h:423
mz_params_t::entity
int entity
Definition: client.h:673
FF_NODELTA
#define FF_NODELTA
Definition: client.h:149
SCR_AddToChatHUD
void SCR_AddToChatHUD(const char *text)
Definition: screen.c:903
tent_params_t::count
int count
Definition: client.h:665
tent_params_t::color
int color
Definition: client.h:666
client_static_s::netchan
netchan_t * netchan
Definition: client.h:421
CL_ParseSetting
static void CL_ParseSetting(void)
Definition: parse.c:1144
tent_params_t::pos2
vec3_t pos2
Definition: client.h:662
server_frame_t::firstEntity
int firstEntity
Definition: client.h:141
CL_CheckForIP
static void CL_CheckForIP(const char *s)
Definition: parse.c:900
CL_FRAMESYNC
#define CL_FRAMESYNC
Definition: client.h:164
CL_ParseLayout
static void CL_ParseLayout(void)
Definition: parse.c:1018
client_state_s::pmp
pmoveParams_t pmp
Definition: client.h:280
MSG_ReadShort
int MSG_ReadShort(void)
Definition: msg.c:1489
COM_strclr
size_t COM_strclr(char *s)
Definition: shared.c:398
client_static_s::paused
qboolean paused
Definition: client.h:468