Quake II RTX doxygen
1.0 dev
|
|
#include "client.h"
#include "server/mvd/protocol.h"
Go to the source code of this file.
◆ build_gamestate()
Definition at line 31 of file gtv.c.
36 memset(
cls.gtv.entities, 0,
sizeof(
cls.gtv.entities));
42 for (i = 1; i < MAX_EDICTS; i++) {
Referenced by CL_GTV_Resume().
◆ CL_GTV_EmitFrame()
Definition at line 107 of file gtv.c.
109 player_packed_t newps;
110 entity_packed_t *oldes, newes;
131 MSG_WriteDeltaPlayerstate_Packet(&
cls.gtv.ps, &newps,
140 for (i = 1; i < MAX_EDICTS; i++) {
141 oldes = &
cls.gtv.entities[i];
154 flags = MSG_ES_UMASK;
156 if (!oldes->number) {
158 flags |= MSG_ES_FORCE | MSG_ES_NEWENTITY;
Referenced by CL_DeltaFrame().
◆ CL_GTV_Init()
◆ CL_GTV_Resume()
◆ CL_GTV_Run()
◆ CL_GTV_Shutdown()
◆ CL_GTV_Start_f()
Definition at line 529 of file gtv.c.
534 Com_Printf(
"Client GTV already started.\n");
540 Com_Printf(
"Listening for GTV connections.\n");
542 }
else if (ret == NET_ERROR) {
545 Com_EPrintf(
"Client TCP port already in use.\n");
Referenced by CL_GTV_Init().
◆ CL_GTV_Status_f()
Definition at line 564 of file gtv.c.
567 Com_Printf(
"Client GTV not running.\n");
572 Com_Printf(
"Listening for GTV connections.\n");
576 Com_Printf(
"TCP client [%s] connected (state %d)\n",
Referenced by CL_GTV_Init().
◆ CL_GTV_Stop_f()
◆ CL_GTV_Suspend()
◆ CL_GTV_Transmit()
Definition at line 278 of file gtv.c.
292 if (
cls.gtv.message.overflowed) {
293 Com_WPrintf(
"MVD message overflowed.\n");
297 if (!
cls.gtv.message.cursize)
301 total =
cls.gtv.message.cursize + 1;
302 header[0] = total & 255;
303 header[1] = (total >> 8) & 255;
304 header[2] = GTS_STREAM_DATA;
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.
231 case svc_configstring:
233 SZ_Write(&
cls.gtv.message, data + 1, len - 1);
237 SZ_Write(&
cls.gtv.message, data + 1, len - 1);
241 bits = ((len >> 8) & 7) << SVCMD_BITS;
245 SZ_Write(&
cls.gtv.message, data, len);
248 bits = ((len >> 8) & 7) << SVCMD_BITS;
251 SZ_Write(&
cls.gtv.message, data, len);
Referenced by CL_ParseServerMessage().
◆ drop_client()
static void drop_client |
( |
const char * |
reason | ) |
|
|
static |
◆ emit_gamestate()
Definition at line 53 of file gtv.c.
62 MSG_WriteByte(mvd_serverdata | (MVF_SINGLEPOV << SVCMD_BITS));
70 for (i = 0; i < MAX_CONFIGSTRINGS; i++) {
75 length = strlen(
string);
76 if (length > MAX_QPATH) {
81 MSG_WriteData(
string, length);
90 MSG_WriteDeltaPlayerstate_Packet(NULL, &
cls.gtv.ps,
95 for (i = 1, es =
cls.gtv.entities + 1; i < MAX_EDICTS; i++, es++) {
97 if ((j = es->number) == 0) {
98 flags |= MSG_ES_REMOVE;
Referenced by CL_GTV_Resume().
◆ parse_hello()
Definition at line 316 of file gtv.c.
326 if (protocol != GTV_PROTOCOL_VERSION) {
339 if (!NET_IsLanAddress(&
cls.gtv.stream.address)) {
352 Com_Printf(
"Accepted MVD client [%s]\n",
Referenced by parse_message().
◆ parse_message()
static qboolean parse_message |
( |
void |
| ) |
|
|
static |
Definition at line 409 of file gtv.c.
421 if (!FIFO_TryRead(&
cls.gtv.stream.recv, &magic, 4)) {
424 if (magic != MVD_MAGIC) {
436 if (!
cls.gtv.msglen) {
437 if (!FIFO_TryRead(&
cls.gtv.stream.recv, &msglen, 2)) {
440 msglen = LittleShort(msglen);
445 if (msglen > MAX_GTC_MSGLEN) {
449 cls.gtv.msglen = msglen;
467 case GTC_STREAM_START:
470 case GTC_STREAM_STOP:
Referenced by CL_GTV_Run().
◆ parse_ping()
◆ parse_stream_start()
◆ parse_stream_stop()
◆ write_message()
static void write_message |
( |
gtv_serverop_t |
op | ) |
|
|
static |
◆ write_stream()
static void write_stream |
( |
void * |
data, |
|
|
size_t |
len |
|
) |
| |
|
static |
◆ gtv_message_buffer
byte gtv_message_buffer[MAX_MSGLEN] |
|
static |
◆ gtv_recv_buffer
byte gtv_recv_buffer[MAX_GTC_MSGLEN] |
|
static |
◆ gtv_send_buffer
byte gtv_send_buffer[MAX_GTS_MSGLEN *2] |
|
static |
static byte gtv_recv_buffer[MAX_GTC_MSGLEN]
static void CL_GTV_Stop_f(void)
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
void CL_UpdateRecordingSetting(void)
char * NET_AdrToString(const netadr_t *a)
qboolean FIFO_ReadMessage(fifo_t *fifo, size_t msglen)
void Cmd_AddCommand(const char *name, xcommand_t function)
static qboolean parse_message(void)
static void parse_stream_stop(void)
void NET_UpdateStream(netstream_t *s)
void SZ_WriteByte(sizebuf_t *sb, int c)
void NET_CloseStream(netstream_t *s)
static void write_stream(void *data, size_t len)
static void CL_GTV_Start_f(void)
void MSG_WriteByte(int c)
static void emit_gamestate(void)
void SZ_Init(sizebuf_t *buf, void *data, size_t size)
neterr_t NET_Accept(netstream_t *s)
void MSG_PackEntity(entity_packed_t *out, const entity_state_t *in, qboolean short_angles)
neterr_t NET_Listen(qboolean arg)
void MSG_PackPlayer(player_packed_t *out, const player_state_t *in)
const char * NET_ErrorString(void)
void MSG_WriteDeltaEntity(const entity_packed_t *from, const entity_packed_t *to, msgEsFlags_t flags)
void MSG_WriteShort(int c)
static byte gtv_send_buffer[MAX_GTS_MSGLEN *2]
void MSG_WriteString(const char *string)
void MSG_WriteLong(int c)
static void write_message(gtv_serverop_t op)
size_t MSG_ReadString(char *dest, size_t size)
static void parse_hello(void)
static void CL_GTV_Status_f(void)
neterr_t NET_RunStream(netstream_t *s)
static void parse_stream_start(void)
centity_t cl_entities[MAX_EDICTS]
size_t FIFO_Write(fifo_t *fifo, const void *buffer, size_t len)
static void drop_client(const char *reason)
static void parse_ping(void)
void SZ_Clear(sizebuf_t *buf)
static void build_gamestate(void)
static byte gtv_message_buffer[MAX_MSGLEN]