Quake II RTX doxygen
1.0 dev
|
|
#include "server.h"
#include "server/mvd/protocol.h"
Go to the source code of this file.
|
static | LIST_DECL (gtv_client_list) |
|
static | LIST_DECL (gtv_active_list) |
|
static | LIST_DECL (gtv_white_list) |
|
static | LIST_DECL (gtv_black_list) |
|
static qboolean | mvd_enable (void) |
|
static void | mvd_disable (void) |
|
static void | mvd_error (const char *reason) |
|
static void | write_stream (gtv_client_t *client, void *data, size_t len) |
|
static void | write_message (gtv_client_t *client, gtv_serverop_t op) |
|
static void | rec_stop (void) |
|
static qboolean | rec_allowed (void) |
|
static void | rec_start (qhandle_t demofile) |
|
static void | rec_write (void) |
|
static void | dummy_wait_f (void) |
|
static void | dummy_command (void) |
|
static void | dummy_forward_f (void) |
|
static void | dummy_record_f (void) |
|
static void | dummy_stop_f (void) |
|
static void | dummy_exec_string (cmdbuf_t *buf, const char *line) |
|
static void | dummy_add_message (client_t *client, byte *data, size_t length, qboolean reliable) |
|
static void | dummy_spawn (void) |
|
static client_t * | dummy_find_slot (void) |
|
static int | dummy_create (void) |
|
static void | dummy_run (void) |
|
static qboolean | player_is_active (const edict_t *ent) |
|
static qboolean | entity_is_active (const edict_t *ent) |
|
static void | build_gamestate (void) |
|
static void | emit_gamestate (void) |
|
static void | copy_entity_state (entity_packed_t *dst, const entity_packed_t *src, int flags) |
|
static void | emit_frame (void) |
|
static void | suspend_streams (void) |
|
static void | resume_streams (void) |
|
static qboolean | players_active (void) |
|
static void | check_clients_activity (void) |
|
static void | check_players_activity (void) |
|
static void | rec_frame (size_t total) |
|
void | SV_MvdBeginFrame (void) |
|
void | SV_MvdEndFrame (void) |
|
void | SV_MvdMulticast (int leafnum, multicast_t to) |
|
static qboolean | filter_unicast_data (edict_t *ent) |
|
void | SV_MvdUnicast (edict_t *ent, int clientNum, qboolean reliable) |
|
void | SV_MvdConfigstring (int index, const char *string, size_t len) |
|
void | SV_MvdBroadcastPrint (int level, const char *string) |
|
void | SV_MvdStartSound (int entnum, int channel, int flags, int soundindex, int volume, int attenuation, int timeofs) |
|
static void | remove_client (gtv_client_t *client) |
|
static void | drop_client (gtv_client_t *client, const char *error) |
|
static qboolean | auth_client (gtv_client_t *client, const char *password) |
|
static void | parse_hello (gtv_client_t *client) |
|
static void | parse_ping (gtv_client_t *client) |
|
static void | parse_stream_start (gtv_client_t *client) |
|
static void | parse_stream_stop (gtv_client_t *client) |
|
static void | parse_stringcmd (gtv_client_t *client) |
|
static qboolean | parse_message (gtv_client_t *client) |
|
static gtv_client_t * | find_slot (void) |
|
static void | accept_client (netstream_t *stream) |
|
void | SV_MvdRunClients (void) |
|
static void | dump_clients (void) |
|
static void | dump_versions (void) |
|
void | SV_MvdStatus_f (void) |
|
static void | mvd_drop (gtv_serverop_t op) |
|
void | SV_MvdMapChanged (void) |
|
void | SV_MvdClientDropped (client_t *client) |
|
void | SV_MvdInit (void) |
|
void | SV_MvdShutdown (error_type_t type) |
|
void | SV_MvdRecord_f (void) |
|
void | SV_MvdStop_f (void) |
|
static void | SV_MvdStuff_f (void) |
|
static void | SV_AddGtvHost_f (void) |
|
static void | SV_DelGtvHost_f (void) |
|
static void | SV_ListGtvHosts_f (void) |
|
static void | SV_AddGtvBan_f (void) |
|
static void | SV_DelGtvBan_f (void) |
|
static void | SV_ListGtvBans_f (void) |
|
void | SV_MvdRegister (void) |
|
◆ FOR_EACH_ACTIVE_GTV
#define FOR_EACH_ACTIVE_GTV |
( |
|
client | ) |
LIST_FOR_EACH(gtv_client_t, client, >v_active_list, active) |
Definition at line 29 of file mvd.c.
◆ FOR_EACH_GTV
#define FOR_EACH_GTV |
( |
|
client | ) |
LIST_FOR_EACH(gtv_client_t, client, >v_client_list, entry) |
Definition at line 26 of file mvd.c.
◆ MVD_USERINFO1
#define MVD_USERINFO1 "\\name\\[MVDSPEC]\\skin\\male/grunt" |
◆ MVD_USERINFO2
#define MVD_USERINFO2 "\\mvdspec\\" STRINGIFY(PROTOCOL_VERSION_MVD_CURRENT) "\\ip\\loopback" |
◆ accept_client()
static void accept_client |
( |
netstream_t * |
stream | ) |
|
|
static |
Definition at line 1728 of file mvd.c.
1738 if (stream->address.type != client->
stream.address.type)
1740 if (stream->address.type == NA_IP && stream->address.ip.u32[0] != client->
stream.address.ip.u32[0])
1742 if (stream->address.type == NA_IP6 && memcmp(stream->address.ip.u8, client->
stream.address.ip.u8, 48 / CHAR_BIT))
1747 Com_Printf(
"TCP client [%s] rejected: too many connections\n",
1757 Com_Printf(
"TCP client [%s] rejected: no free slots\n",
1763 memset(client, 0,
sizeof(*client));
1766 s->recv.data = client->
buffer;
1767 s->recv.size = MAX_GTC_MSGLEN;
1768 s->send.data = client->
buffer + MAX_GTC_MSGLEN;
1770 s->socket = stream->socket;
1771 s->address = stream->address;
1772 s->state = stream->state;
1776 List_SeqAdd(>v_client_list, &client->
entry);
1777 List_Init(&client->
active);
1779 Com_DPrintf(
"TCP client [%s] accepted\n",
Referenced by SV_MvdRunClients().
◆ auth_client()
static qboolean auth_client |
( |
gtv_client_t * |
client, |
|
|
const char * |
password |
|
) |
| |
|
static |
◆ build_gamestate()
◆ check_clients_activity()
static void check_clients_activity |
( |
void |
| ) |
|
|
static |
◆ check_players_activity()
static void check_players_activity |
( |
void |
| ) |
|
|
static |
◆ copy_entity_state()
static void copy_entity_state |
( |
entity_packed_t * |
dst, |
|
|
const entity_packed_t * |
src, |
|
|
int |
flags |
|
) |
| |
|
static |
Definition at line 686 of file mvd.c.
688 if (!(flags & MSG_ES_FIRSTPERSON)) {
689 VectorCopy(src->origin, dst->origin);
690 VectorCopy(src->angles, dst->angles);
691 VectorCopy(src->old_origin, dst->old_origin);
693 dst->modelindex = src->modelindex;
694 dst->modelindex2 = src->modelindex2;
695 dst->modelindex3 = src->modelindex3;
696 dst->modelindex4 = src->modelindex4;
697 dst->frame = src->frame;
698 dst->skinnum = src->skinnum;
699 dst->effects = src->effects;
700 dst->renderfx = src->renderfx;
701 dst->solid = src->solid;
702 dst->sound = src->sound;
Referenced by emit_frame().
◆ drop_client()
Definition at line 1353 of file mvd.c.
1361 Com_Printf(
"TCP client %s[%s] dropped: %s\n", client->
name,
1366 if (client->z.
state) {
1368 flush_stream(client, Z_FINISH);
1369 deflateEnd(&client->z);
1373 List_Remove(&client->
active);
Referenced by mvd_drop(), parse_hello(), parse_message(), parse_stream_start(), parse_stream_stop(), parse_stringcmd(), SV_MvdRunClients(), and write_stream().
◆ dummy_add_message()
static void dummy_add_message |
( |
client_t * |
client, |
|
|
byte * |
data, |
|
|
size_t |
length, |
|
|
qboolean |
reliable |
|
) |
| |
|
static |
Definition at line 272 of file mvd.c.
286 text = (
char *)(data + 1);
287 Com_DPrintf(
"dummy stufftext: %s\n", text);
Referenced by dummy_create().
◆ dummy_command()
◆ dummy_create()
Definition at line 342 of file mvd.c.
345 char userinfo[MAX_INFO_STRING * 2];
355 Com_DPrintf(
"Dummy MVD client disabled\n");
360 Com_DPrintf(
"Dummy MVD client not supported by game\n");
367 Com_EPrintf(
"No slot for dummy MVD client\n");
371 memset(newcl, 0,
sizeof(*newcl));
379 newcl->
netchan->remote_address.type = NA_LOOPBACK;
381 List_Init(&newcl->
entry);
383 if (
g_features->integer & GMF_EXTRA_USERINFO) {
389 userinfo[strlen(userinfo) + 1] = 0;
397 allow =
ge->ClientConnect(newcl->
edict, userinfo);
403 s =
"Connection refused";
405 Com_EPrintf(
"Dummy MVD client rejected by game: %s\n", s);
Referenced by mvd_enable(), and SV_MvdMapChanged().
◆ dummy_exec_string()
static void dummy_exec_string |
( |
cmdbuf_t * |
buf, |
|
|
const char * |
line |
|
) |
| |
|
static |
Definition at line 229 of file mvd.c.
245 if ((u = Com_Find(
dummy_cmds, cmd)) != NULL) {
255 Com_WPrintf(
"%s: runaway alias loop\n", __func__);
268 Com_DPrintf(
"dummy forward: %s\n", line);
Referenced by SV_MvdInit().
◆ dummy_find_slot()
◆ dummy_forward_f()
◆ dummy_record_f()
Definition at line 166 of file mvd.c.
168 char buffer[MAX_OSPATH];
176 Com_Printf(
"Usage: %s <filename>\n",
Cmd_Argv(0));
195 Com_Printf(
"Auto-recording local MVD to %s\n", buffer);
◆ dummy_run()
Definition at line 418 of file mvd.c.
431 memset(&cmd, 0,
sizeof(cmd));
432 cmd.msec = BASE_FRAMETIME;
Referenced by SV_MvdEndFrame().
◆ dummy_spawn()
◆ dummy_stop_f()
Definition at line 200 of file mvd.c.
207 Com_Printf(
"Not recording a local MVD.\n");
211 Com_Printf(
"Stopped local MVD auto-recording.\n");
◆ dummy_wait_f()
◆ dump_clients()
Definition at line 1857 of file mvd.c.
1863 "num name buf lastmsg address state\n"
1864 "--- ---------------- --- ------- --------------------- -----\n");
1867 Com_Printf(
"%3d %-16.16s %3"PRIz
" %7u %-21s ",
1868 count, client->
name, FIFO_Usage(&client->
stream.send),
1872 switch (client->
state) {
1874 Com_Printf(
"ZMBI ");
1877 Com_Printf(
"ASGN ");
1880 Com_Printf(
"CNCT ");
1883 Com_Printf(
"PRIM ");
1886 Com_Printf(
"SEND ");
Referenced by SV_MvdStatus_f().
◆ dump_versions()
Definition at line 1895 of file mvd.c.
1901 "num name version\n"
1902 "--- ---------------- -----------------------------------------\n");
1906 Com_Printf(
"%3i %-16.16s %-40.40s\n",
Referenced by SV_MvdStatus_f().
◆ emit_frame()
Definition at line 711 of file mvd.c.
713 player_packed_t *oldps, newps;
714 entity_packed_t *oldes, newes;
716 int flags, portalbytes;
717 byte portalbits[MAX_MAP_PORTAL_BYTES];
725 MSG_WriteData(portalbits, portalbytes);
727 flags = MSG_PS_IGNORE_PREDICTION | MSG_PS_IGNORE_DELTAANGLES;
729 flags |= MSG_PS_IGNORE_BLEND;
732 flags |= MSG_PS_IGNORE_GUNINDEX | MSG_PS_IGNORE_GUNFRAMES;
741 if (PPS_INUSE(oldps)) {
743 MSG_WriteDeltaPlayerstate_Packet(NULL, NULL, i, flags);
744 PPS_INUSE(oldps) = qfalse;
752 if (PPS_INUSE(oldps)) {
756 MSG_WriteDeltaPlayerstate_Packet(oldps, &newps, i, flags);
759 MSG_WriteDeltaPlayerstate_Packet(oldps, &newps, i,
760 flags | MSG_PS_FORCE);
765 PPS_INUSE(oldps) = qtrue;
771 for (i = 1; i <
ge->num_edicts; i++) {
784 if (ent->s.number != i) {
785 Com_WPrintf(
"%s: fixing ent->s.number: %d to %d\n",
786 __func__, ent->s.number, i);
791 flags = MSG_ES_UMASK;
792 if (i <= sv_maxclients->integer) {
794 if (PPS_INUSE(oldps) && oldps->pmove.pm_type == PM_NORMAL) {
797 flags |= MSG_ES_FIRSTPERSON;
801 if (!oldes->number) {
803 flags |= MSG_ES_FORCE | MSG_ES_NEWENTITY;
Referenced by SV_MvdEndFrame().
◆ emit_gamestate()
Definition at line 595 of file mvd.c.
602 int flags, extra, portalbytes;
603 byte portalbits[MAX_MAP_PORTAL_BYTES];
613 extra |= MVF_NOMSGS << SVCMD_BITS;
628 for (i = 0; i < MAX_CONFIGSTRINGS; i++) {
633 length = strlen(
string);
634 if (length > MAX_QPATH) {
639 MSG_WriteData(
string, length);
647 MSG_WriteData(portalbits, portalbytes);
652 flags |= MSG_PS_IGNORE_BLEND;
655 flags |= MSG_PS_IGNORE_GUNINDEX | MSG_PS_IGNORE_GUNFRAMES;
657 for (i = 0, ps =
mvd.
players; i < sv_maxclients->integer; i++, ps++) {
659 if (!PPS_INUSE(ps)) {
660 extra |= MSG_PS_REMOVE;
662 MSG_WriteDeltaPlayerstate_Packet(NULL, ps, i, flags | extra);
667 for (i = 1, es =
mvd.
entities + 1; i < ge->num_edicts; i++, es++) {
668 flags = MSG_ES_UMASK;
669 if ((j = es->number) != 0) {
670 if (i <= sv_maxclients->integer) {
672 if (PPS_INUSE(ps) && ps->pmove.pm_type == PM_NORMAL) {
673 flags |= MSG_ES_FIRSTPERSON;
677 flags |= MSG_ES_REMOVE;
Referenced by parse_stream_start(), rec_start(), resume_streams(), and SV_MvdMapChanged().
◆ entity_is_active()
static qboolean entity_is_active |
( |
const edict_t * |
ent | ) |
|
|
static |
◆ filter_unicast_data()
static qboolean filter_unicast_data |
( |
edict_t * |
ent | ) |
|
|
static |
◆ find_slot()
◆ LIST_DECL() [1/4]
static LIST_DECL |
( |
gtv_active_list |
| ) |
|
|
static |
◆ LIST_DECL() [2/4]
static LIST_DECL |
( |
gtv_black_list |
| ) |
|
|
static |
◆ LIST_DECL() [3/4]
static LIST_DECL |
( |
gtv_client_list |
| ) |
|
|
static |
◆ LIST_DECL() [4/4]
static LIST_DECL |
( |
gtv_white_list |
| ) |
|
|
static |
◆ mvd_disable()
◆ mvd_drop()
static void mvd_drop |
( |
gtv_serverop_t |
op | ) |
|
|
static |
◆ mvd_enable()
static qboolean mvd_enable |
( |
void |
| ) |
|
|
static |
◆ mvd_error()
static void mvd_error |
( |
const char * |
reason | ) |
|
|
static |
◆ parse_hello()
Definition at line 1455 of file mvd.c.
1458 int protocol, flags;
1468 if (FIFO_Usage(&client->
stream.send)) {
1474 if (protocol != GTV_PROTOCOL_VERSION) {
1494 flags &= ~GTF_STRINGCMDS;
1498 flags &= ~GTF_DEFLATE;
1506 client->
stream.send.data = data;
1507 client->
stream.send.size = size;
1508 client->
data = data;
1509 client->
flags = flags;
1519 if (flags & GTF_DEFLATE) {
1520 client->z.zalloc = SV_zalloc;
1521 client->z.zfree = SV_zfree;
1522 if (deflateInit(&client->z, Z_DEFAULT_COMPRESSION) != Z_OK) {
1529 Com_Printf(
"Accepted MVD client %s[%s]\n", client->
name,
Referenced by parse_message().
◆ parse_message()
Definition at line 1632 of file mvd.c.
1644 if (!FIFO_TryRead(&client->
stream.recv, &magic, 4)) {
1647 if (magic != MVD_MAGIC) {
1660 if (!FIFO_TryRead(&client->
stream.recv, &msglen, 2)) {
1663 msglen = LittleShort(msglen);
1668 if (msglen > MAX_GTC_MSGLEN) {
1690 case GTC_STREAM_START:
1693 case GTC_STREAM_STOP:
Referenced by SV_MvdRunClients().
◆ parse_ping()
◆ parse_stream_start()
Definition at line 1547 of file mvd.c.
1552 drop_client(client,
"unexpected stream start message");
1570 List_Append(>v_active_list, &client->
active);
1586 flush_stream(client, Z_SYNC_FLUSH);
Referenced by parse_message().
◆ parse_stream_stop()
Definition at line 1590 of file mvd.c.
1593 drop_client(client,
"unexpected stream stop message");
1599 List_Delete(&client->
active);
1604 flush_stream(client, Z_SYNC_FLUSH);
Referenced by parse_message().
◆ parse_stringcmd()
Definition at line 1608 of file mvd.c.
1610 char string[MAX_GTC_MSGLEN];
1613 drop_client(client,
"unexpected stringcmd message");
1618 Com_DPrintf(
"ignored stringcmd from %s[%s]\n", client->
name,
1627 Com_DPrintf(
"dummy stringcmd from %s[%s]: %s\n", client->
name,
Referenced by parse_message().
◆ player_is_active()
static qboolean player_is_active |
( |
const edict_t * |
ent | ) |
|
|
static |
Definition at line 479 of file mvd.c.
483 if ((
g_features->integer & GMF_PROPERINUSE) && !ent->inuse) {
506 if (!ent->client->ps.fov) {
516 if (ent->client->ps.pmove.pm_type == PM_SPECTATOR) {
521 if ((ent->svflags & SVF_NOCLIENT) || !
ES_INUSE(&ent->s)) {
534 if (ent->client->ps.pmove.pm_type == PM_FREEZE) {
539 if (ent->client->ps.pmove.pm_flags & PMF_NO_PREDICTION) {
Referenced by build_gamestate(), emit_frame(), players_active(), and SV_MvdUnicast().
◆ players_active()
static qboolean players_active |
( |
void |
| ) |
|
|
static |
◆ rec_allowed()
static qboolean rec_allowed |
( |
void |
| ) |
|
|
static |
Definition at line 2191 of file mvd.c.
2194 Com_Printf(
"MVD recording is disabled on this server.\n");
2199 Com_Printf(
"Already recording a local MVD.\n");
Referenced by dummy_record_f(), and SV_MvdRecord_f().
◆ rec_frame()
static void rec_frame |
( |
size_t |
total | ) |
|
|
static |
Definition at line 961 of file mvd.c.
969 msglen = LittleShort(total);
985 Com_Printf(
"Stopping MVD recording, maximum size reached.\n");
992 Com_Printf(
"Stopping MVD recording, maximum duration reached.\n");
1000 Com_EPrintf(
"Couldn't write local MVD: %s\n",
Q_ErrorString(ret));
Referenced by SV_MvdEndFrame().
◆ rec_start()
static void rec_start |
( |
qhandle_t |
demofile | ) |
|
|
static |
◆ rec_stop()
◆ rec_write()
◆ remove_client()
◆ resume_streams()
Definition at line 836 of file mvd.c.
848 flush_stream(client, Z_SYNC_FLUSH);
864 Com_DPrintf(
"Resuming MVD streams.\n");
Referenced by check_players_activity().
◆ suspend_streams()
Definition at line 819 of file mvd.c.
827 flush_stream(client, Z_SYNC_FLUSH);
832 Com_DPrintf(
"Suspending MVD streams.\n");
Referenced by check_players_activity().
◆ SV_AddGtvBan_f()
◆ SV_AddGtvHost_f()
◆ SV_DelGtvBan_f()
◆ SV_DelGtvHost_f()
◆ SV_ListGtvBans_f()
◆ SV_ListGtvHosts_f()
◆ SV_MvdBeginFrame()
◆ SV_MvdBroadcastPrint()
void SV_MvdBroadcastPrint |
( |
int |
level, |
|
|
const char * |
string |
|
) |
| |
◆ SV_MvdClientDropped()
◆ SV_MvdConfigstring()
void SV_MvdConfigstring |
( |
int |
index, |
|
|
const char * |
string, |
|
|
size_t |
len |
|
) |
| |
◆ SV_MvdEndFrame()
Definition at line 1023 of file mvd.c.
1046 mvd_error(
"reliable message overflowed");
1051 Com_WPrintf(
"Unreliable MVD datagram overflowed.\n");
1067 Com_WPrintf(
"Dumping unreliable MVD datagram.\n");
1073 header[0] = total & 255;
1074 header[1] = (total >> 8) & 255;
1075 header[2] = GTS_STREAM_DATA;
1085 flush_stream(client, Z_SYNC_FLUSH);
Referenced by SV_RunGameFrame().
◆ SV_MvdInit()
Definition at line 2068 of file mvd.c.
2076 sizeof(entity_packed_t) * MAX_EDICTS + MAX_MSGLEN * 2, TAG_SERVER);
2084 Cvar_Set(
"sv_reserved_slots",
"1");
2094 if (ret == NET_OK) {
2097 if (ret == NET_ERROR)
2098 Com_EPrintf(
"%s while opening server TCP port.\n",
NET_ErrorString());
2100 Com_EPrintf(
"Server TCP port already in use.\n");
Referenced by SV_InitGame().
◆ SV_MvdMapChanged()
Definition at line 1990 of file mvd.c.
2006 Com_DPrintf(
"Spawning MVD dummy for auto-recording\n");
2007 Cvar_Set(
"sv_mvd_suspend_time",
"0");
2030 Com_Printf(
"Stopping MVD recording, "
2031 "maximum number of level changes reached.\n");
Referenced by SV_SpawnServer().
◆ SV_MvdMulticast()
void SV_MvdMulticast |
( |
int |
leafnum, |
|
|
multicast_t |
to |
|
) |
| |
Definition at line 1122 of file mvd.c.
1133 op = mvd_multicast_all + to;
1140 if (op != mvd_multicast_all && op != mvd_multicast_all_r) {
Referenced by SV_Multicast().
◆ SV_MvdRecord_f()
Definition at line 2233 of file mvd.c.
2235 char buffer[MAX_OSPATH];
2237 unsigned mode = FS_MODE_WRITE;
2241 Com_Printf(
"No server running.\n");
2249 Com_Printf(
"Begin local MVD recording.\n");
2253 mode |= FS_FLAG_GZIP;
2261 Com_Printf(
"Missing filename argument.\n");
2284 Com_Printf(
"Recording local MVD to %s\n", buffer);
◆ SV_MvdRegister()
Definition at line 2364 of file mvd.c.
2377 "wait 50; putaway; wait 10; help;", 0);
2379 "putaway; wait 10; help;", 0);
Referenced by SV_Init().
◆ SV_MvdRunClients()
Definition at line 1783 of file mvd.c.
1789 unsigned drop_time = 1000 *
sv_timeout->value;
1799 if (ret == NET_ERROR) {
1802 }
else if (ret == NET_OK) {
1810 switch (client->
state) {
1812 if (delta > zombie_time || !FIFO_Usage(&client->
stream.send)) {
1819 if (delta > ghost_time || delta > drop_time) {
1826 if (delta > drop_time) {
Referenced by SV_Frame().
◆ SV_MvdShutdown()
void SV_MvdShutdown |
( |
error_type_t |
type | ) |
|
◆ SV_MvdStartSound()
Definition at line 1257 of file mvd.c.
1261 int extrabits, sendchan;
1269 if (channel & CHAN_NO_PHS_ADD) {
1270 extrabits |= 1 << SVCMD_BITS;
1272 if (channel & CHAN_RELIABLE) {
1274 extrabits |= 2 << SVCMD_BITS;
1281 if (flags & SND_VOLUME)
1283 if (flags & SND_ATTENUATION)
1285 if (flags & SND_OFFSET)
1288 sendchan = (entnum << 3) | (channel & 7);
Referenced by PF_StartSound().
◆ SV_MvdStatus_f()
Definition at line 1912 of file mvd.c.
1914 if (LIST_EMPTY(>v_client_list)) {
1915 Com_Printf(
"No TCP clients.\n");
Referenced by SV_Status_f().
◆ SV_MvdStop_f()
Definition at line 2297 of file mvd.c.
2300 Com_Printf(
"Not recording a local MVD.\n");
2304 Com_Printf(
"Stopped local MVD recording.\n");
◆ SV_MvdStuff_f()
Definition at line 2316 of file mvd.c.
2322 Com_Printf(
"Can't '%s', dummy MVD client is not active\n",
Cmd_Argv(0));
◆ SV_MvdUnicast()
void SV_MvdUnicast |
( |
edict_t * |
ent, |
|
|
int |
clientNum, |
|
|
qboolean |
reliable |
|
) |
| |
◆ write_message()
◆ write_stream()
Definition at line 1379 of file mvd.c.
1381 fifo_t *fifo = &client->
stream.send;
1392 if (client->z.
state) {
1393 z_streamp z = &client->z;
1396 z->avail_in = (uInt)len;
1399 data = FIFO_Reserve(fifo, &len);
1406 z->avail_out = (uInt)len;
1408 if (deflate(z, Z_NO_FLUSH) != Z_OK) {
1413 len -= z->avail_out;
1415 FIFO_Commit(fifo, len);
1418 }
while (z->avail_in);
Referenced by parse_message(), SV_MvdEndFrame(), and write_message().
◆ c_svmvd
◆ dummy_buffer
◆ dummy_buffer_text
char dummy_buffer_text[MAX_STRING_CHARS] |
|
static |
◆ dummy_cmds
const ucmd_t dummy_cmds[] |
|
static |
Initial value:= {
{ "play", NULL },
{ "stopsound", NULL },
{ "exec", NULL },
{ "screenshot", NULL },
{ NULL, NULL }
}
Definition at line 215 of file mvd.c.
Referenced by dummy_exec_string().
◆ mvd
Definition at line 81 of file mvd.c.
Referenced by build_gamestate(), check_clients_activity(), check_players_activity(), count_chase_bits(), create_channel(), demo_destroy(), demo_emit_snapshot(), demo_find_snapshot(), demo_read_frame(), dummy_command(), dummy_create(), dummy_run(), dummy_spawn(), dummy_stop_f(), emit_base_frame(), emit_frame(), emit_gamestate(), entity_flags(), filter_unicast_data(), find_slot(), gtv_destroy(), gtv_forward_cmd(), gtv_oob_kill(), gtv_read_frame(), gtv_wait_start(), gtv_wait_stop(), list_generic(), list_recordings(), MVD_AutoFollow_f(), MVD_BroadcastPrintf(), MVD_ChangeLevel(), mvd_channel_list_f(), MVD_ClearState(), MVD_Control_f(), MVD_CountClients(), MVD_Destroy(), MVD_Destroyf(), mvd_disable(), mvd_enable(), MVD_Follow_f(), MVD_FollowNext(), MVD_FollowPrev(), MVD_FollowStop(), MVD_Forward_f(), MVD_Free(), MVD_GameClientBegin(), MVD_GameClientConnect(), MVD_GameInit(), MVD_GameRunFrame(), MVD_HitPlayer(), MVD_IntermissionStart(), MVD_IntermissionStop(), MVD_Invuse_f(), MVD_Join_f(), MVD_Kill_f(), MVD_LayoutChannels(), MVD_LayoutClients(), MVD_LayoutFollow(), MVD_LayoutScores(), MVD_LinkEdict(), MVD_MostFollowed(), MVD_NotifyClient(), MVD_Observe_f(), MVD_ParseConfigstring(), MVD_ParseEntityString(), MVD_ParseFrame(), MVD_ParseMessage(), MVD_ParseMulticast(), MVD_ParsePacketEntities(), MVD_ParsePacketPlayers(), MVD_ParsePrint(), MVD_ParseServerData(), MVD_ParseSound(), MVD_ParseUnicast(), MVD_Pause_f(), MVD_Play_f(), MVD_PlayerToEntityStates(), MVD_PrepWorldFrame(), MVD_Say_f(), MVD_Seek_f(), MVD_SetChannel(), MVD_SetDefaultLayout(), MVD_SetPlayer(), MVD_SetPlayerNames(), MVD_SetServerState(), MVD_Shutdown(), MVD_Skip_f(), MVD_StopRecord(), MVD_StreamedRecord_f(), MVD_StreamedStop_f(), MVD_SwitchChannel(), MVD_TestTarget(), MVD_TrySwitchChannel(), MVD_UnicastLayout(), MVD_UnicastPrint(), MVD_UnicastSend(), MVD_UnicastString(), MVD_UnicastStuff(), MVD_UpdateClient(), MVD_UpdateClients(), MVD_UpdateConfigstring(), MVD_UpdateLayouts(), MVD_UpdateTarget(), MVD_WriteDemoMessage(), parse_stream_data(), parse_stream_start(), parse_stringcmd(), player_is_active(), players_active(), print_channel(), rec_allowed(), rec_frame(), rec_start(), rec_stop(), rec_write(), reset_unicast_strings(), resume_streams(), set_player_name(), suspend_streams(), SV_MvdBeginFrame(), SV_MvdBroadcastPrint(), SV_MvdClientDropped(), SV_MvdConfigstring(), SV_MvdEndFrame(), SV_MvdInit(), SV_MvdMapChanged(), SV_MvdMulticast(), SV_MvdRunClients(), SV_MvdShutdown(), SV_MvdStartSound(), SV_MvdStop_f(), SV_MvdStuff_f(), SV_MvdUnicast(), and update_player_name().
◆ sv_mvd_allow_stufftext
cvar_t* sv_mvd_allow_stufftext |
|
static |
◆ sv_mvd_autorecord
cvar_t* sv_mvd_autorecord |
|
static |
◆ sv_mvd_begincmd
◆ sv_mvd_bufsize
◆ sv_mvd_capture_flags
cvar_t* sv_mvd_capture_flags |
|
static |
◆ sv_mvd_disconnect_time
cvar_t* sv_mvd_disconnect_time |
|
static |
◆ sv_mvd_enable
◆ sv_mvd_maxclients
cvar_t* sv_mvd_maxclients |
|
static |
◆ sv_mvd_maxmaps
◆ sv_mvd_maxsize
◆ sv_mvd_maxtime
◆ sv_mvd_noblend
◆ sv_mvd_nogun
◆ sv_mvd_nomsgs
◆ sv_mvd_password
◆ sv_mvd_scorecmd
◆ sv_mvd_spawn_dummy
cvar_t* sv_mvd_spawn_dummy |
|
static |
◆ sv_mvd_suspend_time
cvar_t* sv_mvd_suspend_time |
|
static |
static void parse_hello(gtv_client_t *client)
static void dummy_add_message(client_t *client, byte *data, size_t length, qboolean reliable)
void * Z_ReservedAlloc(size_t size)
static cvar_t * sv_mvd_disconnect_time
void SV_DelMatch_f(list_t *list)
cvar_t * Cvar_Set(const char *var_name, const char *value)
qhandle_t FS_EasyOpenFile(char *buf, size_t size, unsigned mode, const char *dir, const char *name, const char *ext)
static void rec_write(void)
player_packed_t * players
static void parse_stringcmd(gtv_client_t *client)
static void mvd_disable(void)
char * NET_AdrToString(const netadr_t *a)
static qboolean players_active(void)
static void mvd_drop(gtv_serverop_t op)
static void remove_client(gtv_client_t *client)
static void dump_clients(void)
static void dummy_spawn(void)
qboolean FIFO_ReadMessage(fifo_t *fifo, size_t msglen)
static void SV_AddGtvHost_f(void)
static void dummy_run(void)
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
const char * Q_ErrorString(qerror_t error)
static void dummy_exec_string(cmdbuf_t *buf, const char *line)
static cvar_t * sv_mvd_begincmd
static cvar_t * sv_mvd_maxtime
static void emit_gamestate(void)
void NET_UpdateStream(netstream_t *s)
void SZ_WriteByte(sizebuf_t *sb, int c)
static void rec_start(qhandle_t demofile)
static cvar_t * sv_mvd_password
void SZ_WriteShort(sizebuf_t *sb, int c)
ssize_t FS_Tell(qhandle_t f)
void Cmd_PrintUsage(const cmd_option_t *opt, const char *suffix)
void NET_CloseStream(netstream_t *s)
void SV_ListMatches_f(list_t *list)
#define FOR_EACH_ACTIVE_GTV(client)
static void SV_DelGtvBan_f(void)
void Cbuf_InsertText(cmdbuf_t *buf, const char *text)
void Cmd_TokenizeString(const char *text, qboolean macroExpand)
static cvar_t * sv_mvd_allow_stufftext
static void dummy_record_f(void)
void MSG_WriteByte(int c)
static void dummy_command(void)
static cvar_t * sv_mvd_suspend_time
entity_packed_t * entities
void SZ_Init(sizebuf_t *buf, void *data, size_t size)
void SV_UserinfoChanged(client_t *cl)
static void mvd_error(const char *reason)
static void write_message(gtv_client_t *client, gtv_serverop_t op)
cvar_t * sv_reserved_slots
neterr_t NET_Accept(netstream_t *s)
static void parse_stream_start(gtv_client_t *client)
static void SV_MvdStuff_f(void)
#define FOR_EACH_GTV(client)
void MSG_PackEntity(entity_packed_t *out, const entity_state_t *in, qboolean short_angles)
neterr_t NET_Listen(qboolean arg)
static const ucmd_t dummy_cmds[]
static void resume_streams(void)
static cmdbuf_t dummy_buffer
void MSG_PackPlayer(player_packed_t *out, const player_state_t *in)
static const cmdreg_t c_svmvd[]
int Cmd_ParseOptions(const cmd_option_t *opt)
const char * NET_ErrorString(void)
static void suspend_streams(void)
void Cbuf_AddText(cmdbuf_t *buf, const char *text)
static qboolean mvd_enable(void)
char * Info_ValueForKey(const char *s, const char *key)
static void dump_versions(void)
static gtv_client_t * find_slot(void)
int CM_WritePortalBits(cm_t *cm, byte *buffer)
static void rec_stop(void)
void Cmd_Register(const cmdreg_t *reg)
static cvar_t * sv_mvd_maxclients
void MSG_WriteDeltaEntity(const entity_packed_t *from, const entity_packed_t *to, msgEsFlags_t flags)
static cvar_t * sv_mvd_noblend
static void dummy_stop_f(void)
static void rec_frame(size_t total)
static void copy_entity_state(entity_packed_t *dst, const entity_packed_t *src, int flags)
size_t Q_strlcpy(char *dst, const char *src, size_t size)
static cvar_t * sv_mvd_bufsize
static void check_clients_activity(void)
static cvar_t * sv_mvd_nogun
void MSG_WriteShort(int c)
char * Cmd_AliasCommand(const char *name)
static void write_stream(gtv_client_t *client, void *data, size_t len)
void SV_DropClient(client_t *client, const char *reason)
static cvar_t * sv_mvd_maxmaps
static cvar_t * sv_mvd_scorecmd
static const cmd_option_t o_record[]
static void dummy_wait_f(void)
static void drop_client(gtv_client_t *client, const char *error)
static qboolean parse_message(gtv_client_t *client)
static void parse_ping(gtv_client_t *client)
static void check_players_activity(void)
void Z_TagReserve(size_t size, memtag_t tag)
ssize_t FS_Write(const void *buf, size_t len, qhandle_t f)
static void SV_DelGtvHost_f(void)
static cvar_t * sv_mvd_capture_flags
static void SV_ListGtvHosts_f(void)
void MSG_WriteString(const char *string)
void MSG_WriteLong(int c)
void Cvar_Command(cvar_t *v)
static void accept_client(netstream_t *stream)
int Cvar_ClampInteger(cvar_t *var, int min, int max)
size_t MSG_ReadString(char *dest, size_t size)
static char dummy_buffer_text[MAX_STRING_CHARS]
static cvar_t * sv_mvd_autorecord
void(* AddMessage)(struct client_s *, byte *, size_t, qboolean)
void Cbuf_Execute(cmdbuf_t *buf)
void Cmd_PrintHelp(const cmd_option_t *opt)
byte buffer[MAX_GTC_MSGLEN+4]
static qboolean player_is_active(const edict_t *ent)
cvar_t * Cvar_FindVar(const char *var_name)
addrmatch_t * SV_MatchAddress(list_t *list, netadr_t *addr)
neterr_t NET_RunStream(netstream_t *s)
static void dummy_forward_f(void)
static void emit_frame(void)
void FS_FCloseFile(qhandle_t f)
static qboolean rec_allowed(void)
static cvar_t * sv_mvd_enable
static void parse_stream_stop(gtv_client_t *client)
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
size_t FIFO_Write(fifo_t *fifo, const void *buffer, size_t len)
static qboolean filter_unicast_data(edict_t *ent)
void SV_RemoveClient(client_t *client)
static void build_gamestate(void)
static qboolean auth_client(gtv_client_t *client, const char *password)
static void SV_AddGtvBan_f(void)
static client_t * dummy_find_slot(void)
static cvar_t * sv_mvd_spawn_dummy
char userinfo[MAX_INFO_STRING]
void SV_AddMatch_f(list_t *list)
static int dummy_create(void)
static qboolean entity_is_active(const edict_t *ent)
void SZ_Clear(sizebuf_t *buf)
static cvar_t * sv_mvd_maxsize
char name[MAX_CLIENT_NAME]
static cvar_t * sv_mvd_nomsgs
static void SV_ListGtvBans_f(void)