icculus quake2 doxygen  1.0 dev
sv_ents.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 1997-2001 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 
21 #include "server.h"
22 
23 /*
24 =============================================================================
25 
26 Encode a client frame onto the network channel
27 
28 =============================================================================
29 */
30 
31 #if 0
32 
33 // because there can be a lot of projectiles, there is a special
34 // network protocol for them
35 #define MAX_PROJECTILES 64
36 edict_t *projectiles[MAX_PROJECTILES];
37 int numprojs;
38 cvar_t *sv_projectiles;
39 
40 qboolean SV_AddProjectileUpdate (edict_t *ent)
41 {
42  if (!sv_projectiles)
43  sv_projectiles = Cvar_Get("sv_projectiles", "1", 0);
44 
45  if (!sv_projectiles->value)
46  return false;
47 
48  if (!(ent->svflags & SVF_PROJECTILE))
49  return false;
50  if (numprojs == MAX_PROJECTILES)
51  return true;
52 
53  projectiles[numprojs++] = ent;
54  return true;
55 }
56 
57 void SV_EmitProjectileUpdate (sizebuf_t *msg)
58 {
59  byte bits[16]; // [modelindex] [48 bits] xyz p y 12 12 12 8 8 [entitynum] [e2]
60  int n, i;
61  edict_t *ent;
62  int x, y, z, p, yaw;
63  int len;
64 
65  if (!numprojs)
66  return;
67 
68  MSG_WriteByte (msg, numprojs);
69 
70  for (n=0 ; n<numprojs ; n++)
71  {
72  ent = projectiles[n];
73  x = (int)(ent->s.origin[0]+4096)>>1;
74  y = (int)(ent->s.origin[1]+4096)>>1;
75  z = (int)(ent->s.origin[2]+4096)>>1;
76  p = (int)(256*ent->s.angles[0]/360)&255;
77  yaw = (int)(256*ent->s.angles[1]/360)&255;
78 
79  len = 0;
80  bits[len++] = x;
81  bits[len++] = (x>>8) | (y<<4);
82  bits[len++] = (y>>4);
83  bits[len++] = z;
84  bits[len++] = (z>>8);
85  if (ent->s.effects & EF_BLASTER)
86  bits[len-1] |= 64;
87 
88  if (ent->s.old_origin[0] != ent->s.origin[0] ||
89  ent->s.old_origin[1] != ent->s.origin[1] ||
90  ent->s.old_origin[2] != ent->s.origin[2]) {
91  bits[len-1] |= 128;
92  x = (int)(ent->s.old_origin[0]+4096)>>1;
93  y = (int)(ent->s.old_origin[1]+4096)>>1;
94  z = (int)(ent->s.old_origin[2]+4096)>>1;
95  bits[len++] = x;
96  bits[len++] = (x>>8) | (y<<4);
97  bits[len++] = (y>>4);
98  bits[len++] = z;
99  bits[len++] = (z>>8);
100  }
101 
102  bits[len++] = p;
103  bits[len++] = yaw;
104  bits[len++] = ent->s.modelindex;
105 
106  bits[len++] = (ent->s.number & 0x7f);
107  if (ent->s.number > 255) {
108  bits[len-1] |= 128;
109  bits[len++] = (ent->s.number >> 7);
110  }
111 
112  for (i=0 ; i<len ; i++)
113  MSG_WriteByte (msg, bits[i]);
114  }
115 }
116 #endif
117 
118 /*
119 =============
120 SV_EmitPacketEntities
121 
122 Writes a delta update of an entity_state_t list to the message.
123 =============
124 */
126 {
127  entity_state_t *oldent, *newent;
128  int oldindex, newindex;
129  int oldnum, newnum;
130  int from_num_entities;
131  int bits;
132 
133 #if 0
134  if (numprojs)
135  MSG_WriteByte (msg, svc_packetentities2);
136  else
137 #endif
139 
140  if (!from)
141  from_num_entities = 0;
142  else
143  from_num_entities = from->num_entities;
144 
145  newindex = 0;
146  oldindex = 0;
147  newent = NULL;
148  oldent = NULL;
149  while (newindex < to->num_entities || oldindex < from_num_entities)
150  {
151  if (newindex >= to->num_entities)
152  newnum = 9999;
153  else
154  {
155  newent = &svs.client_entities[(to->first_entity+newindex)%svs.num_client_entities];
156  newnum = newent->number;
157  }
158 
159  if (oldindex >= from_num_entities)
160  oldnum = 9999;
161  else
162  {
163  oldent = &svs.client_entities[(from->first_entity+oldindex)%svs.num_client_entities];
164  oldnum = oldent->number;
165  }
166 
167  if (newnum == oldnum)
168  { // delta update from old position
169  // because the force parm is false, this will not result
170  // in any bytes being emited if the entity has not changed at all
171  // note that players are always 'newentities', this updates their oldorigin always
172  // and prevents warping
173  MSG_WriteDeltaEntity (oldent, newent, msg, false, newent->number <= maxclients->value);
174  oldindex++;
175  newindex++;
176  continue;
177  }
178 
179  if (newnum < oldnum)
180  { // this is a new entity, send it from the baseline
181  MSG_WriteDeltaEntity (&sv.baselines[newnum], newent, msg, true, true);
182  newindex++;
183  continue;
184  }
185 
186  if (newnum > oldnum)
187  { // the old entity isn't present in the new message
188  bits = U_REMOVE;
189  if (oldnum >= 256)
190  bits |= U_NUMBER16 | U_MOREBITS1;
191 
192  MSG_WriteByte (msg, bits&255 );
193  if (bits & 0x0000ff00)
194  MSG_WriteByte (msg, (bits>>8)&255 );
195 
196  if (bits & U_NUMBER16)
197  MSG_WriteShort (msg, oldnum);
198  else
199  MSG_WriteByte (msg, oldnum);
200 
201  oldindex++;
202  continue;
203  }
204  }
205 
206  MSG_WriteShort (msg, 0); // end of packetentities
207 
208 #if 0
209  if (numprojs)
210  SV_EmitProjectileUpdate(msg);
211 #endif
212 }
213 
214 
215 
216 /*
217 =============
218 SV_WritePlayerstateToClient
219 
220 =============
221 */
223 {
224  int i;
225  int pflags;
226  player_state_t *ps, *ops;
227  player_state_t dummy;
228  int statbits;
229 
230  ps = &to->ps;
231  if (!from)
232  {
233  memset (&dummy, 0, sizeof(dummy));
234  ops = &dummy;
235  }
236  else
237  ops = &from->ps;
238 
239  //
240  // determine what needs to be sent
241  //
242  pflags = 0;
243 
244  if (ps->pmove.pm_type != ops->pmove.pm_type)
245  pflags |= PS_M_TYPE;
246 
247  if (ps->pmove.origin[0] != ops->pmove.origin[0]
248  || ps->pmove.origin[1] != ops->pmove.origin[1]
249  || ps->pmove.origin[2] != ops->pmove.origin[2] )
250  pflags |= PS_M_ORIGIN;
251 
252  if (ps->pmove.velocity[0] != ops->pmove.velocity[0]
253  || ps->pmove.velocity[1] != ops->pmove.velocity[1]
254  || ps->pmove.velocity[2] != ops->pmove.velocity[2] )
255  pflags |= PS_M_VELOCITY;
256 
257  if (ps->pmove.pm_time != ops->pmove.pm_time)
258  pflags |= PS_M_TIME;
259 
260  if (ps->pmove.pm_flags != ops->pmove.pm_flags)
261  pflags |= PS_M_FLAGS;
262 
263  if (ps->pmove.gravity != ops->pmove.gravity)
264  pflags |= PS_M_GRAVITY;
265 
266  if (ps->pmove.delta_angles[0] != ops->pmove.delta_angles[0]
267  || ps->pmove.delta_angles[1] != ops->pmove.delta_angles[1]
268  || ps->pmove.delta_angles[2] != ops->pmove.delta_angles[2] )
269  pflags |= PS_M_DELTA_ANGLES;
270 
271 
272  if (ps->viewoffset[0] != ops->viewoffset[0]
273  || ps->viewoffset[1] != ops->viewoffset[1]
274  || ps->viewoffset[2] != ops->viewoffset[2] )
275  pflags |= PS_VIEWOFFSET;
276 
277  if (ps->viewangles[0] != ops->viewangles[0]
278  || ps->viewangles[1] != ops->viewangles[1]
279  || ps->viewangles[2] != ops->viewangles[2] )
280  pflags |= PS_VIEWANGLES;
281 
282  if (ps->kick_angles[0] != ops->kick_angles[0]
283  || ps->kick_angles[1] != ops->kick_angles[1]
284  || ps->kick_angles[2] != ops->kick_angles[2] )
285  pflags |= PS_KICKANGLES;
286 
287  if (ps->blend[0] != ops->blend[0]
288  || ps->blend[1] != ops->blend[1]
289  || ps->blend[2] != ops->blend[2]
290  || ps->blend[3] != ops->blend[3] )
291  pflags |= PS_BLEND;
292 
293  if (ps->fov != ops->fov)
294  pflags |= PS_FOV;
295 
296  if (ps->rdflags != ops->rdflags)
297  pflags |= PS_RDFLAGS;
298 
299  if (ps->gunframe != ops->gunframe)
300  pflags |= PS_WEAPONFRAME;
301 
302  pflags |= PS_WEAPONINDEX;
303 
304  //
305  // write it
306  //
308  MSG_WriteShort (msg, pflags);
309 
310  //
311  // write the pmove_state_t
312  //
313  if (pflags & PS_M_TYPE)
315 
316  if (pflags & PS_M_ORIGIN)
317  {
318  MSG_WriteShort (msg, ps->pmove.origin[0]);
319  MSG_WriteShort (msg, ps->pmove.origin[1]);
320  MSG_WriteShort (msg, ps->pmove.origin[2]);
321  }
322 
323  if (pflags & PS_M_VELOCITY)
324  {
325  MSG_WriteShort (msg, ps->pmove.velocity[0]);
326  MSG_WriteShort (msg, ps->pmove.velocity[1]);
327  MSG_WriteShort (msg, ps->pmove.velocity[2]);
328  }
329 
330  if (pflags & PS_M_TIME)
332 
333  if (pflags & PS_M_FLAGS)
335 
336  if (pflags & PS_M_GRAVITY)
338 
339  if (pflags & PS_M_DELTA_ANGLES)
340  {
344  }
345 
346  //
347  // write the rest of the player_state_t
348  //
349  if (pflags & PS_VIEWOFFSET)
350  {
351  MSG_WriteChar (msg, ps->viewoffset[0]*4);
352  MSG_WriteChar (msg, ps->viewoffset[1]*4);
353  MSG_WriteChar (msg, ps->viewoffset[2]*4);
354  }
355 
356  if (pflags & PS_VIEWANGLES)
357  {
358  MSG_WriteAngle16 (msg, ps->viewangles[0]);
359  MSG_WriteAngle16 (msg, ps->viewangles[1]);
360  MSG_WriteAngle16 (msg, ps->viewangles[2]);
361  }
362 
363  if (pflags & PS_KICKANGLES)
364  {
365  MSG_WriteChar (msg, ps->kick_angles[0]*4);
366  MSG_WriteChar (msg, ps->kick_angles[1]*4);
367  MSG_WriteChar (msg, ps->kick_angles[2]*4);
368  }
369 
370  if (pflags & PS_WEAPONINDEX)
371  {
372  MSG_WriteByte (msg, ps->gunindex);
373  }
374 
375  if (pflags & PS_WEAPONFRAME)
376  {
377  MSG_WriteByte (msg, ps->gunframe);
378  MSG_WriteChar (msg, ps->gunoffset[0]*4);
379  MSG_WriteChar (msg, ps->gunoffset[1]*4);
380  MSG_WriteChar (msg, ps->gunoffset[2]*4);
381  MSG_WriteChar (msg, ps->gunangles[0]*4);
382  MSG_WriteChar (msg, ps->gunangles[1]*4);
383  MSG_WriteChar (msg, ps->gunangles[2]*4);
384  }
385 
386  if (pflags & PS_BLEND)
387  {
388  MSG_WriteByte (msg, ps->blend[0]*255);
389  MSG_WriteByte (msg, ps->blend[1]*255);
390  MSG_WriteByte (msg, ps->blend[2]*255);
391  MSG_WriteByte (msg, ps->blend[3]*255);
392  }
393  if (pflags & PS_FOV)
394  MSG_WriteByte (msg, ps->fov);
395  if (pflags & PS_RDFLAGS)
396  MSG_WriteByte (msg, ps->rdflags);
397 
398  // send stats
399  statbits = 0;
400  for (i=0 ; i<MAX_STATS ; i++)
401  if (ps->stats[i] != ops->stats[i])
402  statbits |= 1<<i;
403  MSG_WriteLong (msg, statbits);
404  for (i=0 ; i<MAX_STATS ; i++)
405  if (statbits & (1<<i) )
406  MSG_WriteShort (msg, ps->stats[i]);
407 }
408 
409 
410 /*
411 ==================
412 SV_WriteFrameToClient
413 ==================
414 */
416 {
417  client_frame_t *frame, *oldframe;
418  int lastframe;
419 
420 //Com_Printf ("%i -> %i\n", client->lastframe, sv.framenum);
421  // this is the frame we are creating
422  frame = &client->frames[sv.framenum & UPDATE_MASK];
423 
424  if (client->lastframe <= 0)
425  { // client is asking for a retransmit
426  oldframe = NULL;
427  lastframe = -1;
428  }
429  else if (sv.framenum - client->lastframe >= (UPDATE_BACKUP - 3) )
430  { // client hasn't gotten a good message through in a long time
431 // Com_Printf ("%s: Delta request from out-of-date packet.\n", client->name);
432  oldframe = NULL;
433  lastframe = -1;
434  }
435  else
436  { // we have a valid message to delta from
437  oldframe = &client->frames[client->lastframe & UPDATE_MASK];
438  lastframe = client->lastframe;
439  }
440 
443  MSG_WriteLong (msg, lastframe); // what we are delta'ing from
444  MSG_WriteByte (msg, client->surpressCount); // rate dropped packets
445  client->surpressCount = 0;
446 
447  // send over the areabits
448  MSG_WriteByte (msg, frame->areabytes);
449  SZ_Write (msg, frame->areabits, frame->areabytes);
450 
451  // delta encode the playerstate
452  SV_WritePlayerstateToClient (oldframe, frame, msg);
453 
454  // delta encode the entities
455  SV_EmitPacketEntities (oldframe, frame, msg);
456 }
457 
458 
459 /*
460 =============================================================================
461 
462 Build a client frame structure
463 
464 =============================================================================
465 */
466 
467 byte fatpvs[65536/8]; // 32767 is MAX_MAP_LEAFS
468 
469 /*
470 ============
471 SV_FatPVS
472 
473 The client will interpolate the view position,
474 so we can't use a single PVS point
475 ===========
476 */
477 void SV_FatPVS (vec3_t org)
478 {
479  int leafs[64];
480  int i, j, count;
481  int longs;
482  byte *src;
483  vec3_t mins, maxs;
484 
485  for (i=0 ; i<3 ; i++)
486  {
487  mins[i] = org[i] - 8;
488  maxs[i] = org[i] + 8;
489  }
490 
491  count = CM_BoxLeafnums (mins, maxs, leafs, 64, NULL);
492  if (count < 1)
493  Com_Error (ERR_FATAL, "SV_FatPVS: count < 1");
494  longs = (CM_NumClusters()+31)>>5;
495 
496  // convert leafs to clusters
497  for (i=0 ; i<count ; i++)
498  leafs[i] = CM_LeafCluster(leafs[i]);
499 
500  memcpy (fatpvs, CM_ClusterPVS(leafs[0]), longs<<2);
501  // or in all the other leaf bits
502  for (i=1 ; i<count ; i++)
503  {
504  for (j=0 ; j<i ; j++)
505  if (leafs[i] == leafs[j])
506  break;
507  if (j != i)
508  continue; // already have the cluster we want
509  src = CM_ClusterPVS(leafs[i]);
510  for (j=0 ; j<longs ; j++)
511  ((long *)fatpvs)[j] |= ((long *)src)[j];
512  }
513 }
514 
515 
516 /*
517 =============
518 SV_BuildClientFrame
519 
520 Decides which entities are going to be visible to the client, and
521 copies off the playerstat and areabits.
522 =============
523 */
525 {
526  int e, i;
527  vec3_t org;
528  edict_t *ent;
529  edict_t *clent;
530  client_frame_t *frame;
531  entity_state_t *state;
532  int l;
533  int clientarea, clientcluster;
534  int leafnum;
535  int c_fullsend;
536  byte *clientphs;
537  byte *bitvector;
538 
539  clent = client->edict;
540  if (!clent->client)
541  return; // not in game yet
542 
543 #if 0
544  numprojs = 0; // no projectiles yet
545 #endif
546 
547  // this is the frame we are creating
548  frame = &client->frames[sv.framenum & UPDATE_MASK];
549 
550  frame->senttime = svs.realtime; // save it for ping calc later
551 
552  // find the client's PVS
553  for (i=0 ; i<3 ; i++)
554  org[i] = clent->client->ps.pmove.origin[i]*0.125 + clent->client->ps.viewoffset[i];
555 
556  leafnum = CM_PointLeafnum (org);
557  clientarea = CM_LeafArea (leafnum);
558  clientcluster = CM_LeafCluster (leafnum);
559 
560  // calculate the visible areas
561  frame->areabytes = CM_WriteAreaBits (frame->areabits, clientarea);
562 
563  // grab the current player_state_t
564  frame->ps = clent->client->ps;
565 
566 
567  SV_FatPVS (org);
568  clientphs = CM_ClusterPHS (clientcluster);
569 
570  // build up the list of visible entities
571  frame->num_entities = 0;
573 
574  c_fullsend = 0;
575 
576  for (e=1 ; e<ge->num_edicts ; e++)
577  {
578  ent = EDICT_NUM(e);
579 
580  // ignore ents without visible models
581  if (ent->svflags & SVF_NOCLIENT)
582  continue;
583 
584  // ignore ents without visible models unless they have an effect
585  if (!ent->s.modelindex && !ent->s.effects && !ent->s.sound
586  && !ent->s.event)
587  continue;
588 
589  // ignore if not touching a PV leaf
590  if (ent != clent)
591  {
592  // check area
593  if (!CM_AreasConnected (clientarea, ent->areanum))
594  { // doors can legally straddle two areas, so
595  // we may need to check another one
596  if (!ent->areanum2
597  || !CM_AreasConnected (clientarea, ent->areanum2))
598  continue; // blocked by a door
599  }
600 
601  // beams just check one point for PHS
602  if (ent->s.renderfx & RF_BEAM)
603  {
604  l = ent->clusternums[0];
605  if ( !(clientphs[l >> 3] & (1 << (l&7) )) )
606  continue;
607  }
608  else
609  {
610  // FIXME: if an ent has a model and a sound, but isn't
611  // in the PVS, only the PHS, clear the model
612  if (ent->s.sound)
613  {
614  bitvector = fatpvs; //clientphs;
615  }
616  else
617  bitvector = fatpvs;
618 
619  if (ent->num_clusters == -1)
620  { // too many leafs for individual check, go by headnode
621  if (!CM_HeadnodeVisible (ent->headnode, bitvector))
622  continue;
623  c_fullsend++;
624  }
625  else
626  { // check individual leafs
627  for (i=0 ; i < ent->num_clusters ; i++)
628  {
629  l = ent->clusternums[i];
630  if (bitvector[l >> 3] & (1 << (l&7) ))
631  break;
632  }
633  if (i == ent->num_clusters)
634  continue; // not visible
635  }
636 
637  if (!ent->s.modelindex)
638  { // don't send sounds if they will be attenuated away
639  vec3_t delta;
640  float len;
641 
642  VectorSubtract (org, ent->s.origin, delta);
643  len = VectorLength (delta);
644  if (len > 400)
645  continue;
646  }
647  }
648  }
649 
650 #if 0
651  if (SV_AddProjectileUpdate(ent))
652  continue; // added as a special projectile
653 #endif
654 
655  // add it to the circular client_entities array
657  if (ent->s.number != e)
658  {
659  Com_DPrintf ("FIXING ENT->S.NUMBER!!!\n");
660  ent->s.number = e;
661  }
662  *state = ent->s;
663 
664  // don't mark players missiles as solid
665  if (ent->owner == client->edict)
666  state->solid = 0;
667 
669  frame->num_entities++;
670  }
671 }
672 
673 
674 /*
675 ==================
676 SV_RecordDemoMessage
677 
678 Save everything in the world out without deltas.
679 Used for recording footage for merged or assembled demos
680 ==================
681 */
683 {
684  int e;
685  edict_t *ent;
686  entity_state_t nostate;
687  sizebuf_t buf;
688  byte buf_data[32768];
689  int len;
690 
691  if (!svs.demofile)
692  return;
693 
694  memset (&nostate, 0, sizeof(nostate));
695  SZ_Init (&buf, buf_data, sizeof(buf_data));
696 
697  // write a frame message that doesn't contain a player_state_t
698  MSG_WriteByte (&buf, svc_frame);
699  MSG_WriteLong (&buf, sv.framenum);
700 
702 
703  e = 1;
704  ent = EDICT_NUM(e);
705  while (e < ge->num_edicts)
706  {
707  // ignore ents without visible models unless they have an effect
708  if (ent->inuse &&
709  ent->s.number &&
710  (ent->s.modelindex || ent->s.effects || ent->s.sound || ent->s.event) &&
711  !(ent->svflags & SVF_NOCLIENT))
712  MSG_WriteDeltaEntity (&nostate, &ent->s, &buf, false, true);
713 
714  e++;
715  ent = EDICT_NUM(e);
716  }
717 
718  MSG_WriteShort (&buf, 0); // end of packetentities
719 
720  // now add the accumulated multicast information
723 
724  // now write the entire message to the file, prefixed by the length
725  len = LittleLong (buf.cursize);
726  fwrite (&len, 4, 1, svs.demofile);
727  fwrite (buf.data, buf.cursize, 1, svs.demofile);
728 }
729 
client_s::lastframe
int lastframe
Definition: server.h:101
entity_state_s::old_origin
vec3_t old_origin
Definition: q_shared.h:1175
server_t::framenum
int framenum
Definition: server.h:51
sv
server_t sv
Definition: sv_init.c:24
edict_s::s
entity_state_t s
Definition: g_local.h:964
client_frame_t::num_entities
int num_entities
Definition: server.h:87
sizebuf_s
Definition: qcommon.h:75
client_frame_t::areabits
byte areabits[MAX_MAP_AREAS/8]
Definition: server.h:85
player_state_t::gunframe
int gunframe
Definition: q_shared.h:1212
entity_state_s::solid
int solid
Definition: q_shared.h:1182
client_frame_t::ps
player_state_t ps
Definition: server.h:86
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
VectorSubtract
#define VectorSubtract(a, b, c)
Definition: q_shared.h:156
PS_M_ORIGIN
#define PS_M_ORIGIN
Definition: qcommon.h:251
svc_frame
@ svc_frame
Definition: qcommon.h:229
maxclients
cvar_t * maxclients
Definition: g_main.c:44
PS_M_FLAGS
#define PS_M_FLAGS
Definition: qcommon.h:254
SV_FatPVS
void SV_FatPVS(vec3_t org)
Definition: sv_ents.c:477
entity_state_s::renderfx
int renderfx
Definition: q_shared.h:1181
SV_WritePlayerstateToClient
void SV_WritePlayerstateToClient(client_frame_t *from, client_frame_t *to, sizebuf_t *msg)
Definition: sv_ents.c:222
player_state_t::gunangles
vec3_t gunangles
Definition: q_shared.h:1209
entity_state_s
Definition: q_shared.h:1169
entity_state_s::origin
vec3_t origin
Definition: q_shared.h:1173
PS_M_VELOCITY
#define PS_M_VELOCITY
Definition: qcommon.h:252
PS_M_DELTA_ANGLES
#define PS_M_DELTA_ANGLES
Definition: qcommon.h:256
player_state_t::gunoffset
vec3_t gunoffset
Definition: q_shared.h:1210
SVF_NOCLIENT
#define SVF_NOCLIENT
Definition: game.h:27
UPDATE_BACKUP
#define UPDATE_BACKUP
Definition: qcommon.h:190
server_static_t::realtime
int realtime
Definition: server.h:161
qboolean
qboolean
Definition: q_shared.h:56
x
GLint GLenum GLint x
Definition: qgl_win.c:116
edict_s::inuse
qboolean inuse
Definition: g_local.h:970
edict_s::areanum2
int areanum2
Definition: g_local.h:979
z
GLdouble GLdouble z
Definition: qgl_win.c:283
pmove_state_t::gravity
short gravity
Definition: q_shared.h:498
i
int i
Definition: q_shared.c:305
SV_WriteFrameToClient
void SV_WriteFrameToClient(client_t *client, sizebuf_t *msg)
Definition: sv_ents.c:415
PS_KICKANGLES
#define PS_KICKANGLES
Definition: qcommon.h:260
CM_WriteAreaBits
int CM_WriteAreaBits(byte *buffer, int area)
Definition: cmodel.c:1686
edict_s::client
struct gclient_s * client
Definition: g_local.h:965
entity_state_s::event
int event
Definition: q_shared.h:1186
MSG_WriteLong
void MSG_WriteLong(sizebuf_t *sb, int c)
Definition: common.c:349
server_static_t::next_client_entities
int next_client_entities
Definition: server.h:170
client_frame_t::first_entity
int first_entity
Definition: server.h:88
SZ_Init
void SZ_Init(sizebuf_t *buf, byte *data, int length)
Definition: common.c:904
svc_playerinfo
@ svc_playerinfo
Definition: qcommon.h:226
PS_RDFLAGS
#define PS_RDFLAGS
Definition: qcommon.h:265
pmove_state_t::velocity
short velocity[3]
Definition: q_shared.h:495
sizebuf_s::data
byte * data
Definition: qcommon.h:79
edict_s::clusternums
int clusternums[MAX_ENT_CLUSTERS]
Definition: g_local.h:977
player_state_t::fov
float fov
Definition: q_shared.h:1216
PS_M_TIME
#define PS_M_TIME
Definition: qcommon.h:253
SV_RecordDemoMessage
void SV_RecordDemoMessage(void)
Definition: sv_ents.c:682
Cvar_Get
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
Definition: cvar.c:127
player_state_t::rdflags
int rdflags
Definition: q_shared.h:1218
SZ_Write
void SZ_Write(sizebuf_t *buf, void *data, int length)
Definition: common.c:940
cvar_s
Definition: q_shared.h:317
SZ_Clear
void SZ_Clear(sizebuf_t *buf)
Definition: common.c:911
PS_WEAPONINDEX
#define PS_WEAPONINDEX
Definition: qcommon.h:263
edict_s::areanum
int areanum
Definition: g_local.h:979
SV_EmitPacketEntities
void SV_EmitPacketEntities(client_frame_t *from, client_frame_t *to, sizebuf_t *msg)
Definition: sv_ents.c:125
CM_LeafArea
int CM_LeafArea(int leafnum)
Definition: cmodel.c:681
entity_state_s::effects
unsigned int effects
Definition: q_shared.h:1180
j
GLint j
Definition: qgl_win.c:150
entity_state_s::sound
int sound
Definition: q_shared.h:1185
server_t::baselines
entity_state_t baselines[MAX_EDICTS]
Definition: server.h:57
msg
cvar_t * msg
Definition: cl_main.c:98
server_static_t::client_entities
entity_state_t * client_entities
Definition: server.h:171
RF_BEAM
#define RF_BEAM
Definition: q_shared.h:620
edict_s::svflags
int svflags
Definition: g_local.h:983
MAX_STATS
#define MAX_STATS
Definition: q_shared.h:1044
SV_BuildClientFrame
void SV_BuildClientFrame(client_t *client)
Definition: sv_ents.c:524
client_frame_t::areabytes
int areabytes
Definition: server.h:84
edict_s
Definition: g_local.h:962
CM_ClusterPVS
byte * CM_ClusterPVS(int cluster)
Definition: cmodel.c:1575
server_static_t::num_client_entities
int num_client_entities
Definition: server.h:169
pmove_state_t::pm_type
pmtype_t pm_type
Definition: q_shared.h:492
CM_AreasConnected
qboolean CM_AreasConnected(int area1, int area2)
Definition: cmodel.c:1662
LittleLong
int LittleLong(int l)
Definition: q_shared.c:948
player_state_t::viewangles
vec3_t viewangles
Definition: q_shared.h:1204
ge
game_export_t * ge
Definition: sv_game.c:24
EF_BLASTER
#define EF_BLASTER
Definition: q_shared.h:560
VectorLength
vec_t VectorLength(vec3_t v)
Definition: q_shared.c:762
player_state_t::pmove
pmove_state_t pmove
Definition: q_shared.h:1200
client_s::frames
client_frame_t frames[UPDATE_BACKUP]
Definition: server.h:123
U_MOREBITS1
#define U_MOREBITS1
Definition: qcommon.h:305
edict_s::owner
edict_t * owner
Definition: g_local.h:988
player_state_t::kick_angles
vec3_t kick_angles
Definition: q_shared.h:1206
fatpvs
byte fatpvs[65536/8]
Definition: sv_ents.c:467
player_state_t::viewoffset
vec3_t viewoffset
Definition: q_shared.h:1205
player_state_t::blend
float blend[4]
Definition: q_shared.h:1214
cvar_s::value
float value
Definition: q_shared.h:324
pmove_state_t::delta_angles
short delta_angles[3]
Definition: q_shared.h:499
gclient_s::ps
player_state_t ps
Definition: g_local.h:880
PS_M_TYPE
#define PS_M_TYPE
Definition: qcommon.h:250
entity_state_s::number
int number
Definition: q_shared.h:1171
NULL
#define NULL
Definition: q_shared.h:60
MSG_WriteShort
void MSG_WriteShort(sizebuf_t *sb, int c)
Definition: common.c:335
MSG_WriteByte
void MSG_WriteByte(sizebuf_t *sb, int c)
Definition: common.c:322
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:203
U_REMOVE
#define U_REMOVE
Definition: qcommon.h:304
CM_NumClusters
int CM_NumClusters(void)
Definition: cmodel.c:652
client_frame_t
Definition: server.h:82
svs
server_static_t svs
Definition: sv_init.c:23
MSG_WriteChar
void MSG_WriteChar(sizebuf_t *sb, int c)
Definition: common.c:309
CM_BoxLeafnums
int CM_BoxLeafnums(vec3_t mins, vec3_t maxs, int *list, int listsize, int *topnode)
Definition: cmodel.c:903
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:735
y
GLint y
Definition: qgl_win.c:115
client_frame_t::senttime
int senttime
Definition: server.h:89
client_s::surpressCount
int surpressCount
Definition: server.h:112
CM_ClusterPHS
byte * CM_ClusterPHS(int cluster)
Definition: cmodel.c:1584
CM_LeafCluster
int CM_LeafCluster(int leafnum)
Definition: cmodel.c:674
entity_state_s::modelindex
int modelindex
Definition: q_shared.h:1176
sizebuf_s::cursize
int cursize
Definition: qcommon.h:81
edict_s::num_clusters
int num_clusters
Definition: g_local.h:976
Com_DPrintf
void Com_DPrintf(char *fmt,...)
Definition: common.c:155
client_s
Definition: server.h:95
svc_packetentities
@ svc_packetentities
Definition: qcommon.h:227
edict_s::headnode
int headnode
Definition: g_local.h:978
pmove_state_t::origin
short origin[3]
Definition: q_shared.h:494
U_NUMBER16
#define U_NUMBER16
Definition: qcommon.h:308
EDICT_NUM
#define EDICT_NUM(n)
Definition: server.h:69
player_state_t
Definition: q_shared.h:1198
MSG_WriteAngle16
void MSG_WriteAngle16(sizebuf_t *sb, float f)
Definition: common.c:400
server.h
PS_M_GRAVITY
#define PS_M_GRAVITY
Definition: qcommon.h:255
MSG_WriteDeltaEntity
void MSG_WriteDeltaEntity(entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qboolean force, qboolean newentity)
Definition: common.c:502
PS_VIEWANGLES
#define PS_VIEWANGLES
Definition: qcommon.h:259
server_static_t::demo_multicast
sizebuf_t demo_multicast
Definition: server.h:179
player_state_t::gunindex
int gunindex
Definition: q_shared.h:1211
UPDATE_MASK
#define UPDATE_MASK
Definition: qcommon.h:192
entity_state_s::angles
vec3_t angles
Definition: q_shared.h:1174
CM_HeadnodeVisible
qboolean CM_HeadnodeVisible(int nodenum, byte *visbits)
Definition: cmodel.c:1748
PS_FOV
#define PS_FOV
Definition: qcommon.h:262
pmove_state_t::pm_flags
byte pm_flags
Definition: q_shared.h:496
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:127
PS_BLEND
#define PS_BLEND
Definition: qcommon.h:261
CM_PointLeafnum
int CM_PointLeafnum(vec3_t p)
Definition: cmodel.c:826
pmove_state_t::pm_time
byte pm_time
Definition: q_shared.h:497
game_export_t::num_edicts
int num_edicts
Definition: game.h:231
player_state_t::stats
short stats[MAX_STATS]
Definition: q_shared.h:1220
server_static_t::demofile
FILE * demofile
Definition: server.h:178
count
GLint GLsizei count
Definition: qgl_win.c:128
PS_WEAPONFRAME
#define PS_WEAPONFRAME
Definition: qcommon.h:264
PS_VIEWOFFSET
#define PS_VIEWOFFSET
Definition: qcommon.h:258
client_s::edict
edict_t * edict
Definition: server.h:114