Quake II RTX doxygen
1.0 dev
|
|
#include "../server.h"
#include <setjmp.h>
Go to the source code of this file.
|
#define | MVD_Malloc(size) Z_TagMalloc(size, TAG_MVD) |
|
#define | MVD_Mallocz(size) Z_TagMallocz(size, TAG_MVD) |
|
#define | MVD_CopyString(s) Z_TagCopyString(s, TAG_MVD) |
|
#define | FOR_EACH_MVD(mvd) LIST_FOR_EACH(mvd_t, mvd, &mvd_channel_list, entry) |
|
#define | FOR_EACH_MVDCL(cl, mvd) LIST_FOR_EACH(mvd_client_t, cl, &(mvd)->clients, entry) |
|
#define | EDICT_MVDCL(ent) ((mvd_client_t *)((ent)->client)) |
|
#define | CS_NUM(c, n) ((char *)(c) + (n) * MAX_QPATH) |
|
#define | MVD_InfoSet(var, val) Cvar_FullSet(var, val, CVAR_SERVERINFO | CVAR_GAME, FROM_CODE) |
|
#define | MVD_FEATURES (GMF_CLIENTNUM | GMF_PROPERINUSE | GMF_WANT_ALL_DISCONNECTS) |
|
#define | LAYOUT_MSEC 3000 |
|
#define | FLOOD_SAMPLES 16 |
|
#define | FLOOD_MASK (FLOOD_SAMPLES - 1) |
|
#define | MAX_MVD_NAME 16 |
|
|
void | MVD_Destroyf (mvd_t *mvd, const char *fmt,...) q_noreturn q_printf(2 |
|
void void | MVD_Shutdown (void) |
|
mvd_t * | MVD_SetChannel (int arg) |
|
void | MVD_File_g (genctx_t *ctx) |
|
void | MVD_Spawn (void) |
|
void | MVD_StopRecord (mvd_t *mvd) |
|
void | MVD_StreamedStop_f (void) |
|
void | MVD_StreamedRecord_f (void) |
|
void | MVD_Register (void) |
|
int | MVD_Frame (void) |
|
qboolean | MVD_ParseMessage (mvd_t *mvd) |
|
void | MVD_ParseEntityString (mvd_t *mvd, const char *data) |
|
void | MVD_ClearState (mvd_t *mvd, qboolean full) |
|
void | MVD_SwitchChannel (mvd_client_t *client, mvd_t *mvd) |
|
void | MVD_RemoveClient (client_t *client) |
|
void | MVD_BroadcastPrintf (mvd_t *mvd, int level, int mask, const char *fmt,...) q_printf(4 |
|
void void | MVD_PrepWorldFrame (void) |
|
void | MVD_GameClientNameChanged (edict_t *ent, const char *name) |
|
void | MVD_GameClientDrop (edict_t *ent, const char *prefix, const char *reason) |
|
void | MVD_UpdateClients (mvd_t *mvd) |
|
void | MVD_FreePlayer (mvd_player_t *player) |
|
void | MVD_UpdateConfigstring (mvd_t *mvd, int index) |
|
void | MVD_SetPlayerNames (mvd_t *mvd) |
|
void | MVD_LinkEdict (mvd_t *mvd, edict_t *ent) |
|
◆ CS_NUM
#define CS_NUM |
( |
|
c, |
|
|
|
n |
|
) |
| ((char *)(c) + (n) * MAX_QPATH) |
◆ EDICT_MVDCL
#define EDICT_MVDCL |
( |
|
ent | ) |
((mvd_client_t *)((ent)->client)) |
◆ FLOOD_MASK
◆ FLOOD_SAMPLES
◆ FOR_EACH_MVD
◆ FOR_EACH_MVDCL
◆ LAYOUT_MSEC
◆ MAX_MVD_NAME
◆ MVD_CopyString
◆ MVD_FEATURES
#define MVD_FEATURES (GMF_CLIENTNUM | GMF_PROPERINUSE | GMF_WANT_ALL_DISCONNECTS) |
◆ MVD_InfoSet
#define MVD_InfoSet |
( |
|
var, |
|
|
|
val |
|
) |
| Cvar_FullSet(var, val, CVAR_SERVERINFO | CVAR_GAME, FROM_CODE) |
◆ MVD_Malloc
◆ MVD_Mallocz
◆ mvd_cs_t
◆ mvd_t
◆ mvd_layout_t
Enumerator |
---|
LAYOUT_NONE | |
LAYOUT_FOLLOW | |
LAYOUT_SCORES | |
LAYOUT_OLDSCORES | |
LAYOUT_MENU | |
LAYOUT_CLIENTS | |
LAYOUT_CHANNELS | |
Definition at line 43 of file client.h.
◆ mvd_state_t
Enumerator |
---|
MVD_DEAD | |
MVD_WAITING | |
MVD_READING | |
MVD_NUM_STATES | |
Definition at line 107 of file client.h.
◆ MVD_BroadcastPrintf()
void MVD_BroadcastPrintf |
( |
mvd_t * |
mvd, |
|
|
int |
level, |
|
|
int |
mask, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ MVD_ClearState()
void MVD_ClearState |
( |
mvd_t * |
mvd, |
|
|
qboolean |
full |
|
) |
| |
Definition at line 856 of file parse.c.
864 memset(
mvd->edicts, 0,
sizeof(
mvd->edicts));
865 mvd->pool.num_edicts = 0;
868 for (i = 0; i <
mvd->maxclients; i++) {
871 memset(player, 0,
sizeof(*player));
880 LIST_FOR_EACH_SAFE(
mvd_snap_t, snap, next, &
mvd->snapshots, entry) {
884 List_Init(&
mvd->snapshots);
889 if (
mvd->intermission) {
894 memset(
mvd->configstrings, 0,
sizeof(
mvd->configstrings));
Referenced by MVD_ParseServerData(), and MVD_Seek_f().
◆ MVD_Destroyf()
void MVD_Destroyf |
( |
mvd_t * |
mvd, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ MVD_File_g()
void MVD_File_g |
( |
genctx_t * |
ctx | ) |
|
◆ MVD_Frame()
Definition at line 406 of file client.c.
411 if (
sv.
state == ss_broadcast) {
416 LIST_FOR_EACH_SAFE(
gtv_t, gtv, next, &mvd_gtv_list, entry) {
Referenced by SV_Frame().
◆ MVD_FreePlayer()
◆ MVD_GameClientDrop()
void MVD_GameClientDrop |
( |
edict_t * |
ent, |
|
|
const char * |
prefix, |
|
|
const char * |
reason |
|
) |
| |
◆ MVD_GameClientNameChanged()
void MVD_GameClientNameChanged |
( |
edict_t * |
ent, |
|
|
const char * |
name |
|
) |
| |
◆ MVD_LinkEdict()
void MVD_LinkEdict |
( |
mvd_t * |
mvd, |
|
|
edict_t * |
ent |
|
) |
| |
Definition at line 1652 of file game.c.
1656 bsp_t *cache =
mvd->cm.cache;
1662 if (ent->s.solid == PACKED_BSP) {
1663 index = ent->s.modelindex;
1664 if (index < 1 || index > cache->nummodels) {
1665 Com_WPrintf(
"%s: entity %d: bad inline model index: %d\n",
1666 __func__, ent->s.number, index);
1669 cm = &cache->models[index - 1];
1670 VectorCopy(cm->mins, ent->mins);
1671 VectorCopy(cm->maxs, ent->maxs);
1672 ent->solid = SOLID_BSP;
1673 }
else if (ent->s.solid) {
1674 MSG_UnpackSolid16(ent->s.solid, ent->mins, ent->maxs);
1675 ent->solid = SOLID_BBOX;
1677 VectorClear(ent->mins);
1678 VectorClear(ent->maxs);
1679 ent->solid = SOLID_NOT;
Referenced by MVD_ParsePacketEntities(), MVD_PlayerToEntityStates(), and MVD_Seek_f().
◆ MVD_ParseEntityString()
void MVD_ParseEntityString |
( |
mvd_t * |
mvd, |
|
|
const char * |
data |
|
) |
| |
Definition at line 64 of file parse.c.
67 char key[MAX_STRING_CHARS];
68 char value[MAX_STRING_CHARS];
69 char classname[MAX_QPATH];
79 Com_Error(ERR_DROP,
"expected '{', found '%s'", p);
91 Com_Error(ERR_DROP,
"expected key, found '{'");
98 Com_Error(ERR_DROP,
"expected key/value pair, found EOF");
100 if (p[0] ==
'}' || p[0] ==
'{') {
101 Com_Error(ERR_DROP,
"expected value, found '%s'", p);
104 if (!strcmp(key,
"classname")) {
105 Q_strlcpy(classname, p,
sizeof(classname));
112 if (!strcmp(key,
"origin")) {
116 }
else if (!strncmp(key,
"angle", 5)) {
121 }
else if (key[5] ==
's' && key[6] == 0) {
130 Com_Error(ERR_DROP,
"entity with no classname");
133 if (strncmp(classname,
"info_player_", 12)) {
137 if (!strcmp(classname + 12,
"intermission")) {
139 VectorCopy(angles,
mvd->spawnAngles);
143 if (!strcmp(classname + 12,
"start") ||
144 !strcmp(classname + 12,
"deathmatch")) {
146 VectorCopy(angles,
mvd->spawnAngles);
Referenced by MVD_GameInit(), and MVD_ParseServerData().
◆ MVD_ParseMessage()
qboolean MVD_ParseMessage |
( |
mvd_t * |
mvd | ) |
|
Definition at line 1098 of file parse.c.
1101 qboolean ret = qfalse;
1104 if (mvd_shownet->integer == 1) {
1105 Com_Printf(
"%"PRIz
" ",
msg_read.cursize);
1106 }
else if (mvd_shownet->integer > 1) {
1107 Com_Printf(
"------------------\n");
1125 extrabits = cmd >> SVCMD_BITS;
1129 if (mvd_shownet->integer > 1) {
1135 case mvd_serverdata:
1139 case mvd_multicast_all:
1140 case mvd_multicast_pvs:
1141 case mvd_multicast_phs:
1142 case mvd_multicast_all_r:
1143 case mvd_multicast_pvs_r:
1144 case mvd_multicast_phs_r:
1151 case mvd_configstring:
Referenced by demo_play_next(), demo_read_frame(), gtv_read_frame(), MVD_Seek_f(), and parse_stream_data().
◆ MVD_PrepWorldFrame()
Definition at line 2263 of file game.c.
2271 for (i = 1; i <
mvd->pool.num_edicts; i++) {
2272 ent = &
mvd->edicts[i];
2276 if (!(ent->s.renderfx & RF_BEAM)) {
2277 VectorCopy(ent->s.origin, ent->s.old_origin);
Referenced by SV_PrepWorldFrame().
◆ MVD_Register()
◆ MVD_RemoveClient()
◆ MVD_SetChannel()
Definition at line 230 of file client.c.
237 Com_Printf(
"No active channels.\n");
245 Com_Printf(
"Please specify an exact channel ID.\n");
251 if (!
dedicated->integer && !strcmp(s,
"@@")) {
252 if ((
mvd = find_local_channel()) != NULL) {
266 if (!strcmp(
mvd->name, s)) {
272 Com_Printf(
"No such channel ID: %s\n", s);
Referenced by MVD_Control_f(), MVD_Join_f(), MVD_Kill_f(), MVD_Pause_f(), MVD_Play_f(), MVD_Seek_f(), MVD_Skip_f(), MVD_StreamedRecord_f(), and MVD_StreamedStop_f().
◆ MVD_SetPlayerNames()
◆ MVD_Shutdown()
◆ MVD_Spawn()
◆ MVD_StopRecord()
◆ MVD_StreamedRecord_f()
Definition at line 1896 of file client.c.
1898 char buffer[MAX_OSPATH];
1903 unsigned mode = FS_MODE_WRITE;
1911 Com_Printf(
"Begin MVD recording on the specified channel.\n");
1915 mode |= FS_FLAG_GZIP;
1923 Com_Printf(
"Missing filename argument.\n");
1933 if (
mvd->demorecording) {
1934 Com_Printf(
"[%s] Already recording into %s.\n",
1935 mvd->name,
mvd->demoname);
1948 Com_Printf(
"[%s] Recording into %s\n",
mvd->name, buffer);
1950 mvd->demorecording = f;
1962 msglen = LittleShort(
msg_write.cursize);
1975 Com_EPrintf(
"[%s] Couldn't write demo: %s\n",
mvd->name,
Q_ErrorString(ret));
◆ MVD_StreamedStop_f()
Definition at line 1778 of file client.c.
1784 Com_Printf(
"Usage: %s [chanid]\n",
Cmd_Argv(0));
1788 if (!
mvd->demorecording) {
1789 Com_Printf(
"[%s] Not recording a demo.\n",
mvd->name);
1795 Com_Printf(
"[%s] Stopped recording.\n",
mvd->name);
◆ MVD_SwitchChannel()
◆ MVD_UpdateClients()
◆ MVD_UpdateConfigstring()
◆ mvd_active
◆ mvd_channel_list
◆ mvd_clients
◆ mvd_dirty
◆ mvd_jmpbuf
◆ mvd_last_activity
unsigned mvd_last_activity |
◆ mvd_waitingRoom
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 set_player_name(mvd_t *mvd, int index)
void CM_FreeMap(cm_t *cm)
static cvar_t * mvd_snaps
player_packed_t * players
byte chase_bitmap[MAX_CLIENTS/CHAR_BIT]
unsigned mvd_last_activity
static const cmdreg_t c_mvd[]
static qboolean match_ended_hack
mvd_t * MVD_SetChannel(int arg)
static qboolean MVD_PartFilter(mvd_client_t *client)
void MVD_StopRecord(mvd_t *mvd)
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
const char * Q_ErrorString(qerror_t error)
void Z_LeakTest(memtag_t tag)
mvd_client_t * mvd_clients
static void MVD_UpdateTarget(mvd_client_t *client)
static void set_mvd_active(void)
static void MVD_SetServerState(client_t *cl, mvd_t *mvd)
static cvar_t * mvd_freeze_hack
static cvar_t * mvd_password
void Cmd_PrintUsage(const cmd_option_t *opt, const char *suffix)
#define SV_InfoSet(var, val)
#define FOR_EACH_MVD(mvd)
void MSG_WriteByte(int c)
unsigned Sys_Milliseconds(void)
void SV_ClientAddMessage(client_t *client, int flags)
static void MVD_ParseServerData(mvd_t *mvd, int extrabits)
void(* run)(struct gtv_s *)
static void MVD_ParseMulticast(mvd_t *mvd, mvd_ops_t op, int extrabits)
void Com_Error(error_type_t type, const char *fmt,...)
static cvar_t * mvd_username
int Cmd_ParseOptions(const cmd_option_t *opt)
char * va(const char *format,...)
void FS_File_g(const char *path, const char *ext, unsigned flags, genctx_t *ctx)
static cvar_t * mvd_buffer_size
static cvar_t * mvd_timeout
void Cmd_Register(const cmdreg_t *reg)
static void MVD_ParseUnicast(mvd_t *mvd, mvd_ops_t op, int extrabits)
static void emit_gamestate(mvd_t *mvd)
size_t Q_strlcpy(char *dst, const char *src, size_t size)
void MVD_BroadcastPrintf(mvd_t *mvd, int level, int mask, const char *fmt,...)
void MSG_WriteShort(int c)
void Cvar_SetInteger(cvar_t *var, int value, from_t from)
void SV_LinkEdict(cm_t *cm, edict_t *ent)
static void MVD_NotifyClient(mvd_client_t *client)
static const cmd_option_t o_record[]
static void MVD_Free(mvd_t *mvd)
void(* destroy)(struct gtv_s *)
#define FOR_EACH_MVDCL(cl, mvd)
ssize_t FS_Write(const void *buf, size_t len, qhandle_t f)
static void reset_unicast_strings(mvd_t *mvd, int index)
qboolean COM_IsUint(const char *s)
static cvar_t * mvd_wait_percent
void MSG_WriteString(const char *string)
static void MVD_UpdateClient(mvd_client_t *client)
static void MVD_ParseConfigstring(mvd_t *mvd)
static void MVD_IntermissionStart(mvd_t *mvd)
void Cmd_PrintHelp(const cmd_option_t *opt)
static void update_player_name(mvd_t *mvd, int index)
static void MVD_IntermissionStop(mvd_t *mvd)
static void MVD_ParseFrame(mvd_t *mvd)
char * COM_Parse(const char **data_p)
void MVD_FreePlayer(mvd_player_t *player)
void FS_FCloseFile(qhandle_t f)
#define MVD_CopyString(s)
static cvar_t * mvd_wait_delay
static cvar_t * mvd_suspend_time
void MVD_Destroyf(mvd_t *mvd, const char *fmt,...)
static void MVD_ParseSound(mvd_t *mvd, int extrabits)
void SZ_Clear(sizebuf_t *buf)
void SV_ClientReset(client_t *client)
mvd_client_t * mvd_clients
static void MVD_ParsePrint(mvd_t *mvd)