Quake II RTX doxygen  1.0 dev
gtv.c File Reference
#include "client.h"
#include "server/mvd/protocol.h"

Go to the source code of this file.

Functions

static void build_gamestate (void)
 
static void emit_gamestate (void)
 
void CL_GTV_EmitFrame (void)
 
static void drop_client (const char *reason)
 
static void write_stream (void *data, size_t len)
 
static void write_message (gtv_serverop_t op)
 
void CL_GTV_WriteMessage (byte *data, size_t len)
 
void CL_GTV_Resume (void)
 
void CL_GTV_Suspend (void)
 
void CL_GTV_Transmit (void)
 
static void parse_hello (void)
 
static void parse_ping (void)
 
static void parse_stream_start (void)
 
static void parse_stream_stop (void)
 
static qboolean parse_message (void)
 
void CL_GTV_Run (void)
 
static void CL_GTV_Start_f (void)
 
static void CL_GTV_Stop_f (void)
 
static void CL_GTV_Status_f (void)
 
void CL_GTV_Init (void)
 
void CL_GTV_Shutdown (void)
 

Variables

static byte gtv_recv_buffer [MAX_GTC_MSGLEN]
 
static byte gtv_send_buffer [MAX_GTS_MSGLEN *2]
 
static byte gtv_message_buffer [MAX_MSGLEN]
 

Function Documentation

◆ build_gamestate()

static void build_gamestate ( void  )
static

Definition at line 31 of file gtv.c.

32 {
33  centity_t *ent;
34  int i;
35 
36  memset(cls.gtv.entities, 0, sizeof(cls.gtv.entities));
37 
38  // set base player states
39  MSG_PackPlayer(&cls.gtv.ps, &cl.frame.ps);
40 
41  // set base entity states
42  for (i = 1; i < MAX_EDICTS; i++) {
43  ent = &cl_entities[i];
44 
45  if (ent->serverframe != cl.frame.number) {
46  continue;
47  }
48 
49  MSG_PackEntity(&cls.gtv.entities[i], &ent->current, qfalse);
50  }
51 }

Referenced by CL_GTV_Resume().

◆ CL_GTV_EmitFrame()

void CL_GTV_EmitFrame ( void  )

Definition at line 107 of file gtv.c.

108 {
109  player_packed_t newps;
110  entity_packed_t *oldes, newes;
111  centity_t *ent;
112  int i, flags;
113 
114  if (cls.gtv.state != ca_active)
115  return;
116 
117  if (!CL_FRAMESYNC)
118  return;
119 
120  if (!cl.frame.valid)
121  return;
122 
123  MSG_WriteByte(mvd_frame);
124 
125  // send portal bits
126  MSG_WriteByte(0);
127 
128  // send player state
129  MSG_PackPlayer(&newps, &cl.frame.ps);
130 
131  MSG_WriteDeltaPlayerstate_Packet(&cls.gtv.ps, &newps,
132  cl.clientNum, MSG_PS_FORCE);
133 
134  // shuffle current state to previous
135  cls.gtv.ps = newps;
136 
137  MSG_WriteByte(CLIENTNUM_NONE); // end of packetplayers
138 
139  // send entity states
140  for (i = 1; i < MAX_EDICTS; i++) {
141  oldes = &cls.gtv.entities[i];
142  ent = &cl_entities[i];
143 
144  if (ent->serverframe != cl.frame.number) {
145  if (oldes->number) {
146  // the old entity isn't present in the new message
147  MSG_WriteDeltaEntity(oldes, NULL, MSG_ES_FORCE);
148  oldes->number = 0;
149  }
150  continue;
151  }
152 
153  // calculate flags
154  flags = MSG_ES_UMASK;
155 
156  if (!oldes->number) {
157  // this is a new entity, send it from the last state
158  flags |= MSG_ES_FORCE | MSG_ES_NEWENTITY;
159  }
160 
161  // quantize
162  MSG_PackEntity(&newes, &ent->current, qfalse);
163 
164  MSG_WriteDeltaEntity(oldes, &newes, flags);
165 
166  // shuffle current state to previous
167  *oldes = newes;
168  }
169 
170  MSG_WriteShort(0); // end of packetentities
171 
172  SZ_Write(&cls.gtv.message, msg_write.data, msg_write.cursize);
174 }

Referenced by CL_DeltaFrame().

◆ CL_GTV_Init()

void CL_GTV_Init ( void  )

Definition at line 580 of file gtv.c.

581 {
582  Cmd_AddCommand("client_gtv_start", CL_GTV_Start_f);
583  Cmd_AddCommand("client_gtv_stop", CL_GTV_Stop_f);
584  Cmd_AddCommand("client_gtv_status", CL_GTV_Status_f);
585 }

Referenced by CL_InitLocal().

◆ CL_GTV_Resume()

void CL_GTV_Resume ( void  )

Definition at line 256 of file gtv.c.

257 {
258  if (cls.gtv.state != ca_active)
259  return;
260 
261  SZ_Init(&cls.gtv.message, gtv_message_buffer, sizeof(gtv_message_buffer));
262 
263  build_gamestate();
264  emit_gamestate();
265  write_message(GTS_STREAM_DATA);
267 }

Referenced by CL_DeltaFrame(), and parse_stream_start().

◆ CL_GTV_Run()

void CL_GTV_Run ( void  )

Definition at line 488 of file gtv.c.

489 {
490  neterr_t ret;
491 
492  if (!cls.gtv.state)
493  return;
494 
495  if (cls.gtv.state == ca_disconnected) {
496  ret = NET_Accept(&cls.gtv.stream);
497  if (ret != NET_OK)
498  return;
499 
500  Com_DPrintf("TCP client [%s] accepted\n",
501  NET_AdrToString(&cls.gtv.stream.address));
502 
503  cls.gtv.state = ca_connecting;
504  cls.gtv.stream.recv.data = gtv_recv_buffer;
505  cls.gtv.stream.recv.size = sizeof(gtv_recv_buffer);
506  cls.gtv.stream.send.data = gtv_send_buffer;
507  cls.gtv.stream.send.size = sizeof(gtv_send_buffer);
508  }
509 
510  ret = NET_RunStream(&cls.gtv.stream);
511  switch (ret) {
512  case NET_AGAIN:
513  break;
514  case NET_OK:
515  // parse the message
516  while (parse_message())
517  ;
518  NET_UpdateStream(&cls.gtv.stream);
519  break;
520  case NET_CLOSED:
521  drop_client("EOF from client");
522  break;
523  case NET_ERROR:
524  drop_client("connection reset by peer");
525  break;
526  }
527 }

Referenced by CL_ProcessEvents().

◆ CL_GTV_Shutdown()

void CL_GTV_Shutdown ( void  )

Definition at line 587 of file gtv.c.

588 {
589  if (cls.gtv.state)
590  CL_GTV_Stop_f();
591 }

Referenced by CL_Shutdown().

◆ CL_GTV_Start_f()

static void CL_GTV_Start_f ( void  )
static

Definition at line 529 of file gtv.c.

530 {
531  neterr_t ret;
532 
533  if (cls.gtv.state) {
534  Com_Printf("Client GTV already started.\n");
535  return;
536  }
537 
538  ret = NET_Listen(qtrue);
539  if (ret == NET_OK) {
540  Com_Printf("Listening for GTV connections.\n");
541  cls.gtv.state = ca_disconnected;
542  } else if (ret == NET_ERROR) {
543  Com_EPrintf("%s while opening client TCP port.\n", NET_ErrorString());
544  } else {
545  Com_EPrintf("Client TCP port already in use.\n");
546  }
547 }

Referenced by CL_GTV_Init().

◆ CL_GTV_Status_f()

static void CL_GTV_Status_f ( void  )
static

Definition at line 564 of file gtv.c.

565 {
566  if (!cls.gtv.state) {
567  Com_Printf("Client GTV not running.\n");
568  return;
569  }
570 
571  if (cls.gtv.state == ca_disconnected) {
572  Com_Printf("Listening for GTV connections.\n");
573  return;
574  }
575 
576  Com_Printf("TCP client [%s] connected (state %d)\n",
577  NET_AdrToString(&cls.gtv.stream.address), cls.gtv.state);
578 }

Referenced by CL_GTV_Init().

◆ CL_GTV_Stop_f()

static void CL_GTV_Stop_f ( void  )
static

Definition at line 549 of file gtv.c.

550 {
551  if (!cls.gtv.state) {
552  Com_Printf("Client GTV already stopped.\n");
553  return;
554  }
555 
556  NET_Listen(qfalse);
557 
558  write_message(GTS_DISCONNECT);
559  drop_client(NULL);
560 
561  memset(&cls.gtv, 0, sizeof(cls.gtv));
562 }

Referenced by CL_GTV_Init(), and CL_GTV_Shutdown().

◆ CL_GTV_Suspend()

void CL_GTV_Suspend ( void  )

Definition at line 269 of file gtv.c.

270 {
271  if (cls.gtv.state != ca_active)
272  return;
273 
274  // send stream suspend marker
275  write_message(GTS_STREAM_DATA);
276 }

Referenced by CL_Disconnect().

◆ CL_GTV_Transmit()

void CL_GTV_Transmit ( void  )

Definition at line 278 of file gtv.c.

279 {
280  byte header[3];
281  size_t total;
282 
283  if (cls.gtv.state != ca_active)
284  return;
285 
286  if (cls.state != ca_active)
287  return;
288 
289  if (!CL_FRAMESYNC)
290  return;
291 
292  if (cls.gtv.message.overflowed) {
293  Com_WPrintf("MVD message overflowed.\n");
294  goto clear;
295  }
296 
297  if (!cls.gtv.message.cursize)
298  return;
299 
300  // build message header
301  total = cls.gtv.message.cursize + 1;
302  header[0] = total & 255;
303  header[1] = (total >> 8) & 255;
304  header[2] = GTS_STREAM_DATA;
305 
306  // send frame to client
307  write_stream(header, sizeof(header));
308  write_stream(cls.gtv.message.data, cls.gtv.message.cursize);
309  NET_UpdateStream(&cls.gtv.stream);
310 
311 clear:
312  // clear datagram
313  SZ_Clear(&cls.gtv.message);
314 }

Referenced by CL_PacketEvent(), and parse_next_message().

◆ CL_GTV_WriteMessage()

void CL_GTV_WriteMessage ( byte *  data,
size_t  len 
)

Definition at line 217 of file gtv.c.

218 {
219  int bits;
220 
221  if (cls.gtv.state != ca_active)
222  return;
223 
224  if (cls.state != ca_active)
225  return;
226 
227  if (len == 0)
228  return;
229 
230  switch (data[0]) {
231  case svc_configstring:
232  SZ_WriteByte(&cls.gtv.message, mvd_configstring);
233  SZ_Write(&cls.gtv.message, data + 1, len - 1);
234  break;
235  case svc_print:
236  SZ_WriteByte(&cls.gtv.message, mvd_print);
237  SZ_Write(&cls.gtv.message, data + 1, len - 1);
238  break;
239  case svc_layout:
240  case svc_stufftext:
241  bits = ((len >> 8) & 7) << SVCMD_BITS;
242  SZ_WriteByte(&cls.gtv.message, mvd_unicast | bits);
243  SZ_WriteByte(&cls.gtv.message, len & 255);
244  SZ_WriteByte(&cls.gtv.message, cl.clientNum);
245  SZ_Write(&cls.gtv.message, data, len);
246  break;
247  default:
248  bits = ((len >> 8) & 7) << SVCMD_BITS;
249  SZ_WriteByte(&cls.gtv.message, mvd_multicast_all | bits);
250  SZ_WriteByte(&cls.gtv.message, len & 255);
251  SZ_Write(&cls.gtv.message, data, len);
252  break;
253  }
254 }

Referenced by CL_ParseServerMessage().

◆ drop_client()

static void drop_client ( const char *  reason)
static

Definition at line 176 of file gtv.c.

177 {
178  if (reason)
179  Com_Printf("MVD client [%s] dropped: %s\n",
180  NET_AdrToString(&cls.gtv.stream.address), reason);
181 
182  NET_UpdateStream(&cls.gtv.stream);
183 
184  NET_Sleep(0);
185 
186  NET_RunStream(&cls.gtv.stream);
187  NET_RunStream(&cls.gtv.stream);
188 
189  NET_CloseStream(&cls.gtv.stream);
190  cls.gtv.state = ca_disconnected;
191 }

Referenced by CL_GTV_Run(), CL_GTV_Stop_f(), parse_hello(), parse_message(), parse_stream_start(), parse_stream_stop(), and write_stream().

◆ emit_gamestate()

static void emit_gamestate ( void  )
static

Definition at line 53 of file gtv.c.

54 {
55  char *string;
56  int i, j;
57  entity_packed_t *es;
58  size_t length;
59  int flags;
60 
61  // send the serverdata
62  MSG_WriteByte(mvd_serverdata | (MVF_SINGLEPOV << SVCMD_BITS));
63  MSG_WriteLong(PROTOCOL_VERSION_MVD);
64  MSG_WriteShort(PROTOCOL_VERSION_MVD_CURRENT);
67  MSG_WriteShort(-1);
68 
69  // send configstrings
70  for (i = 0; i < MAX_CONFIGSTRINGS; i++) {
71  string = cl.configstrings[i];
72  if (!string[0]) {
73  continue;
74  }
75  length = strlen(string);
76  if (length > MAX_QPATH) {
77  length = MAX_QPATH;
78  }
79 
80  MSG_WriteShort(i);
81  MSG_WriteData(string, length);
82  MSG_WriteByte(0);
83  }
84  MSG_WriteShort(MAX_CONFIGSTRINGS);
85 
86  // send portal bits
87  MSG_WriteByte(0);
88 
89  // send player state
90  MSG_WriteDeltaPlayerstate_Packet(NULL, &cls.gtv.ps,
91  cl.clientNum, MSG_PS_FORCE);
92  MSG_WriteByte(CLIENTNUM_NONE);
93 
94  // send entity states
95  for (i = 1, es = cls.gtv.entities + 1; i < MAX_EDICTS; i++, es++) {
96  flags = MSG_ES_UMASK;
97  if ((j = es->number) == 0) {
98  flags |= MSG_ES_REMOVE;
99  }
100  es->number = i;
101  MSG_WriteDeltaEntity(NULL, es, flags);
102  es->number = j;
103  }
104  MSG_WriteShort(0);
105 }

Referenced by CL_GTV_Resume().

◆ parse_hello()

static void parse_hello ( void  )
static

Definition at line 316 of file gtv.c.

317 {
318  int protocol;
319 
320  if (cls.gtv.state >= ca_precached) {
321  drop_client("duplicated hello message");
322  return;
323  }
324 
325  protocol = MSG_ReadWord();
326  if (protocol != GTV_PROTOCOL_VERSION) {
327  write_message(GTS_BADREQUEST);
328  drop_client("bad protocol version");
329  return;
330  }
331 
332  MSG_ReadLong();
333  MSG_ReadLong();
334  MSG_ReadString(NULL, 0);
335  MSG_ReadString(NULL, 0);
336  MSG_ReadString(NULL, 0);
337 
338  // authorize access
339  if (!NET_IsLanAddress(&cls.gtv.stream.address)) {
340  write_message(GTS_NOACCESS);
341  drop_client("not authorized");
342  return;
343  }
344 
345  cls.gtv.state = ca_precached;
346 
347  // send hello
348  MSG_WriteLong(0);
349  write_message(GTS_HELLO);
351 
352  Com_Printf("Accepted MVD client [%s]\n",
353  NET_AdrToString(&cls.gtv.stream.address));
354 }

Referenced by parse_message().

◆ parse_message()

static qboolean parse_message ( void  )
static

Definition at line 409 of file gtv.c.

410 {
411  uint32_t magic;
412  uint16_t msglen;
413  int cmd;
414 
415  if (cls.gtv.state <= ca_disconnected) {
416  return qfalse;
417  }
418 
419  // check magic
420  if (cls.gtv.state < ca_connected) {
421  if (!FIFO_TryRead(&cls.gtv.stream.recv, &magic, 4)) {
422  return qfalse;
423  }
424  if (magic != MVD_MAGIC) {
425  drop_client("not a MVD/GTV stream");
426  return qfalse;
427  }
428  cls.gtv.state = ca_connected;
429 
430  // send it back
431  write_stream(&magic, 4);
432  return qfalse;
433  }
434 
435  // parse msglen
436  if (!cls.gtv.msglen) {
437  if (!FIFO_TryRead(&cls.gtv.stream.recv, &msglen, 2)) {
438  return qfalse;
439  }
440  msglen = LittleShort(msglen);
441  if (!msglen) {
442  drop_client("end of stream");
443  return qfalse;
444  }
445  if (msglen > MAX_GTC_MSGLEN) {
446  drop_client("oversize message");
447  return qfalse;
448  }
449  cls.gtv.msglen = msglen;
450  }
451 
452  // read this message
453  if (!FIFO_ReadMessage(&cls.gtv.stream.recv, cls.gtv.msglen)) {
454  return qfalse;
455  }
456 
457  cls.gtv.msglen = 0;
458 
459  cmd = MSG_ReadByte();
460  switch (cmd) {
461  case GTC_HELLO:
462  parse_hello();
463  break;
464  case GTC_PING:
465  parse_ping();
466  break;
467  case GTC_STREAM_START:
469  break;
470  case GTC_STREAM_STOP:
472  break;
473  case GTC_STRINGCMD:
474  break;
475  default:
476  drop_client("unknown command byte");
477  return qfalse;
478  }
479 
480  if (msg_read.readcount > msg_read.cursize) {
481  drop_client("read past end of message");
482  return qfalse;
483  }
484 
485  return qtrue;
486 }

Referenced by CL_GTV_Run().

◆ parse_ping()

static void parse_ping ( void  )
static

Definition at line 356 of file gtv.c.

357 {
358  if (cls.gtv.state < ca_precached) {
359  return;
360  }
361 
362  // send ping reply
363  write_message(GTS_PONG);
364 }

Referenced by parse_message().

◆ parse_stream_start()

static void parse_stream_start ( void  )
static

Definition at line 366 of file gtv.c.

367 {
368  if (cls.gtv.state != ca_precached) {
369  drop_client("unexpected stream start message");
370  return;
371  }
372 
373  // skip maxbuf
374  MSG_ReadShort();
375 
376  cls.gtv.state = ca_active;
377 
378  // tell the server we are recording
380 
381  // send ack to client
382  write_message(GTS_STREAM_START);
383 
384  // send gamestate if active
385  if (cls.state == ca_active) {
386  CL_GTV_Resume();
387  } else {
388  // send stream suspend marker
389  write_message(GTS_STREAM_DATA);
390  }
391 }

Referenced by parse_message().

◆ parse_stream_stop()

static void parse_stream_stop ( void  )
static

Definition at line 393 of file gtv.c.

394 {
395  if (cls.gtv.state != ca_active) {
396  drop_client("unexpected stream stop message");
397  return;
398  }
399 
400  cls.gtv.state = ca_precached;
401 
402  // tell the server we finished recording
404 
405  // send ack to client
406  write_message(GTS_STREAM_STOP);
407 }

Referenced by parse_message().

◆ write_message()

static void write_message ( gtv_serverop_t  op)
static

Definition at line 204 of file gtv.c.

205 {
206  byte header[3];
207  size_t len = msg_write.cursize + 1;
208 
209  header[0] = len & 255;
210  header[1] = (len >> 8) & 255;
211  header[2] = op;
212  write_stream(header, sizeof(header));
213 
214  write_stream(msg_write.data, msg_write.cursize);
215 }

Referenced by CL_GTV_Resume(), CL_GTV_Stop_f(), CL_GTV_Suspend(), parse_hello(), parse_ping(), parse_stream_start(), and parse_stream_stop().

◆ write_stream()

static void write_stream ( void data,
size_t  len 
)
static

Definition at line 193 of file gtv.c.

194 {
195  if (cls.gtv.state <= ca_disconnected) {
196  return;
197  }
198 
199  if (FIFO_Write(&cls.gtv.stream.send, data, len) != len) {
200  drop_client("overflowed");
201  }
202 }

Referenced by CL_GTV_Transmit(), parse_message(), and write_message().

Variable Documentation

◆ gtv_message_buffer

byte gtv_message_buffer[MAX_MSGLEN]
static

Definition at line 29 of file gtv.c.

Referenced by CL_GTV_Resume().

◆ gtv_recv_buffer

byte gtv_recv_buffer[MAX_GTC_MSGLEN]
static

Definition at line 26 of file gtv.c.

Referenced by CL_GTV_Run().

◆ gtv_send_buffer

byte gtv_send_buffer[MAX_GTS_MSGLEN *2]
static

Definition at line 27 of file gtv.c.

Referenced by CL_GTV_Run().

gtv_recv_buffer
static byte gtv_recv_buffer[MAX_GTC_MSGLEN]
Definition: gtv.c:26
client_state_s::frame
server_frame_t frame
Definition: client.h:212
CL_GTV_Stop_f
static void CL_GTV_Stop_f(void)
Definition: gtv.c:549
server_frame_t::valid
qboolean valid
Definition: client.h:129
client_state_s::configstrings
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
Definition: client.h:289
CL_UpdateRecordingSetting
void CL_UpdateRecordingSetting(void)
Definition: main.c:265
msg_read
sizebuf_t msg_read
Definition: msg.c:37
NET_AdrToString
char * NET_AdrToString(const netadr_t *a)
Definition: net.c:257
FIFO_ReadMessage
qboolean FIFO_ReadMessage(fifo_t *fifo, size_t msglen)
Definition: fifo.c:89
Cmd_AddCommand
void Cmd_AddCommand(const char *name, xcommand_t function)
Definition: cmd.c:1562
parse_message
static qboolean parse_message(void)
Definition: gtv.c:409
MSG_ReadWord
int MSG_ReadWord(void)
Definition: msg.c:1503
ca_disconnected
@ ca_disconnected
Definition: client.h:334
ca_active
@ ca_active
Definition: client.h:340
parse_stream_stop
static void parse_stream_stop(void)
Definition: gtv.c:393
client_static_s::state
connstate_t state
Definition: client.h:375
NET_UpdateStream
void NET_UpdateStream(netstream_t *s)
Definition: net.c:1628
client_state_s::gamedir
char gamedir[MAX_QPATH]
Definition: client.h:277
ca_connected
@ ca_connected
Definition: client.h:337
SZ_WriteByte
void SZ_WriteByte(sizebuf_t *sb, int c)
Definition: sizebuf.c:82
NET_CloseStream
void NET_CloseStream(netstream_t *s)
Definition: net.c:1371
write_stream
static void write_stream(void *data, size_t len)
Definition: gtv.c:193
CL_GTV_Start_f
static void CL_GTV_Start_f(void)
Definition: gtv.c:529
MSG_WriteByte
void MSG_WriteByte(int c)
Definition: msg.c:107
emit_gamestate
static void emit_gamestate(void)
Definition: gtv.c:53
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
client_state_s::servercount
int servercount
Definition: client.h:276
NET_Accept
neterr_t NET_Accept(netstream_t *s)
Definition: net.c:1525
ca_precached
@ ca_precached
Definition: client.h:339
MSG_PackEntity
void MSG_PackEntity(entity_packed_t *out, const entity_state_t *in, qboolean short_angles)
Definition: msg.c:468
client_state_s::clientNum
int clientNum
Definition: client.h:278
NET_Listen
neterr_t NET_Listen(qboolean arg)
Definition: net.c:1466
centity_s::current
entity_state_t current
Definition: client.h:86
MSG_PackPlayer
void MSG_PackPlayer(player_packed_t *out, const player_state_t *in)
Definition: msg.c:763
msg_write
sizebuf_t msg_write
Definition: msg.c:34
NET_ErrorString
const char * NET_ErrorString(void)
Definition: net.c:659
MSG_ReadLong
int MSG_ReadLong(void)
Definition: msg.c:1517
MSG_WriteDeltaEntity
void MSG_WriteDeltaEntity(const entity_packed_t *from, const entity_packed_t *to, msgEsFlags_t flags)
Definition: msg.c:505
MSG_WriteShort
void MSG_WriteShort(int c)
Definition: msg.c:125
centity_s
Definition: client.h:85
cl
client_state_t cl
Definition: main.c:99
gtv_send_buffer
static byte gtv_send_buffer[MAX_GTS_MSGLEN *2]
Definition: gtv.c:27
cls
client_static_t cls
Definition: main.c:98
MSG_WriteString
void MSG_WriteString(const char *string)
Definition: msg.c:160
MSG_WriteLong
void MSG_WriteLong(int c)
Definition: msg.c:144
write_message
static void write_message(gtv_serverop_t op)
Definition: gtv.c:204
MSG_ReadString
size_t MSG_ReadString(char *dest, size_t size)
Definition: msg.c:1531
server_frame_t::ps
player_state_t ps
Definition: client.h:137
parse_hello
static void parse_hello(void)
Definition: gtv.c:316
CL_GTV_Status_f
static void CL_GTV_Status_f(void)
Definition: gtv.c:564
CL_GTV_Resume
void CL_GTV_Resume(void)
Definition: gtv.c:256
server_frame_t::number
int number
Definition: client.h:131
ca_connecting
@ ca_connecting
Definition: client.h:336
svc_layout
#define svc_layout
Definition: g_local.h:39
NET_RunStream
neterr_t NET_RunStream(netstream_t *s)
Definition: net.c:1647
parse_stream_start
static void parse_stream_start(void)
Definition: gtv.c:366
MSG_ReadByte
int MSG_ReadByte(void)
Definition: msg.c:1475
NET_Sleep
int NET_Sleep(int msec)
Definition: net.c:712
cl_entities
centity_t cl_entities[MAX_EDICTS]
Definition: main.c:101
FIFO_Write
size_t FIFO_Write(fifo_t *fifo, const void *buffer, size_t len)
Definition: fifo.c:50
centity_s::serverframe
int serverframe
Definition: client.h:91
drop_client
static void drop_client(const char *reason)
Definition: gtv.c:176
parse_ping
static void parse_ping(void)
Definition: gtv.c:356
SZ_Clear
void SZ_Clear(sizebuf_t *buf)
Definition: sizebuf.c:40
CL_FRAMESYNC
#define CL_FRAMESYNC
Definition: client.h:164
MSG_ReadShort
int MSG_ReadShort(void)
Definition: msg.c:1489
build_gamestate
static void build_gamestate(void)
Definition: gtv.c:31
gtv_message_buffer
static byte gtv_message_buffer[MAX_MSGLEN]
Definition: gtv.c:29