DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
sv_main.c File Reference
#include "quakedef.h"
#include "sv_demo.h"
#include "libcurl.h"
#include "csprogs.h"
#include "thread.h"
#include "prvm_offsets.h"
+ Include dependency graph for sv_main.c:

Go to the source code of this file.

Macros

#define PRVM_DECLARE_clientfieldedict(x)
 
#define PRVM_DECLARE_clientfieldedict(x)
 
#define PRVM_DECLARE_clientfieldfloat(x)
 
#define PRVM_DECLARE_clientfieldfloat(x)
 
#define PRVM_DECLARE_clientfieldfunction(x)
 
#define PRVM_DECLARE_clientfieldfunction(x)
 
#define PRVM_DECLARE_clientfieldstring(x)
 
#define PRVM_DECLARE_clientfieldstring(x)
 
#define PRVM_DECLARE_clientfieldvector(x)
 
#define PRVM_DECLARE_clientfieldvector(x)
 
#define PRVM_DECLARE_clientfunction(x)
 
#define PRVM_DECLARE_clientfunction(x)
 
#define PRVM_DECLARE_clientglobaledict(x)
 
#define PRVM_DECLARE_clientglobaledict(x)
 
#define PRVM_DECLARE_clientglobalfloat(x)
 
#define PRVM_DECLARE_clientglobalfloat(x)
 
#define PRVM_DECLARE_clientglobalfunction(x)
 
#define PRVM_DECLARE_clientglobalfunction(x)
 
#define PRVM_DECLARE_clientglobalstring(x)
 
#define PRVM_DECLARE_clientglobalstring(x)
 
#define PRVM_DECLARE_clientglobalvector(x)
 
#define PRVM_DECLARE_clientglobalvector(x)
 
#define PRVM_DECLARE_field(x)
 
#define PRVM_DECLARE_field(x)
 
#define PRVM_DECLARE_function(x)
 
#define PRVM_DECLARE_function(x)
 
#define PRVM_DECLARE_global(x)
 
#define PRVM_DECLARE_global(x)
 
#define PRVM_DECLARE_menufieldedict(x)
 
#define PRVM_DECLARE_menufieldedict(x)
 
#define PRVM_DECLARE_menufieldfloat(x)
 
#define PRVM_DECLARE_menufieldfloat(x)
 
#define PRVM_DECLARE_menufieldfunction(x)
 
#define PRVM_DECLARE_menufieldfunction(x)
 
#define PRVM_DECLARE_menufieldstring(x)
 
#define PRVM_DECLARE_menufieldstring(x)
 
#define PRVM_DECLARE_menufieldvector(x)
 
#define PRVM_DECLARE_menufieldvector(x)
 
#define PRVM_DECLARE_menufunction(x)
 
#define PRVM_DECLARE_menufunction(x)
 
#define PRVM_DECLARE_menuglobaledict(x)
 
#define PRVM_DECLARE_menuglobaledict(x)
 
#define PRVM_DECLARE_menuglobalfloat(x)
 
#define PRVM_DECLARE_menuglobalfloat(x)
 
#define PRVM_DECLARE_menuglobalfunction(x)
 
#define PRVM_DECLARE_menuglobalfunction(x)
 
#define PRVM_DECLARE_menuglobalstring(x)
 
#define PRVM_DECLARE_menuglobalstring(x)
 
#define PRVM_DECLARE_menuglobalvector(x)
 
#define PRVM_DECLARE_menuglobalvector(x)
 
#define PRVM_DECLARE_serverfieldedict(x)
 
#define PRVM_DECLARE_serverfieldedict(x)
 
#define PRVM_DECLARE_serverfieldfloat(x)
 
#define PRVM_DECLARE_serverfieldfloat(x)
 
#define PRVM_DECLARE_serverfieldfunction(x)
 
#define PRVM_DECLARE_serverfieldfunction(x)
 
#define PRVM_DECLARE_serverfieldstring(x)
 
#define PRVM_DECLARE_serverfieldstring(x)
 
#define PRVM_DECLARE_serverfieldvector(x)
 
#define PRVM_DECLARE_serverfieldvector(x)
 
#define PRVM_DECLARE_serverfunction(x)
 
#define PRVM_DECLARE_serverfunction(x)
 
#define PRVM_DECLARE_serverglobaledict(x)
 
#define PRVM_DECLARE_serverglobaledict(x)
 
#define PRVM_DECLARE_serverglobalfloat(x)
 
#define PRVM_DECLARE_serverglobalfloat(x)
 
#define PRVM_DECLARE_serverglobalfunction(x)
 
#define PRVM_DECLARE_serverglobalfunction(x)
 
#define PRVM_DECLARE_serverglobalstring(x)
 
#define PRVM_DECLARE_serverglobalstring(x)
 
#define PRVM_DECLARE_serverglobalvector(x)
 
#define PRVM_DECLARE_serverglobalvector(x)
 
#define SV_REQFIELDS   (sizeof(sv_reqfields) / sizeof(prvm_required_field_t))
 
#define SV_REQGLOBALS   (sizeof(sv_reqglobals) / sizeof(prvm_required_field_t))
 

Functions

static void Download_CheckExtensions (cmd_state_t *cmd)
 
static void Host_Timescale_c (cvar_t *var)
 
static void SV_AreaStats_f (cmd_state_t *cmd)
 
static void SV_CheckRequiredFuncs (prvm_prog_t *prog, const char *filename)
 
static void SV_CheckTimeouts (void)
 
void SV_ConnectClient (int clientnum, netconn_t *netconnection)
 
static void SV_CreateBaseline (void)
 
static void SV_Download_f (cmd_state_t *cmd)
 
void SV_DropClient (qbool leaving, const char *fmt,...)
 
double SV_Frame (double time)
 
model_tSV_GetModelByIndex (int modelindex)
 
model_tSV_GetModelFromEdict (prvm_edict_t *ed)
 
void SV_Init (void)
 
int SV_IsLocalServer (void)
 
int SV_ModelIndex (const char *s, int precachemode)
 
int SV_ParticleEffectIndex (const char *name)
 
static void SV_Prepare_CSQC (void)
 
static void SV_SaveEntFile_f (cmd_state_t *cmd)
 
void SV_SaveSpawnparms (void)
 
void SV_SendServerinfo (client_t *client)
 
static void SV_ServerOptions (void)
 
void SV_Shutdown (void)
 
int SV_SoundIndex (const char *s, int precachemode)
 
void SV_SpawnServer (const char *map)
 
static void SV_StartDownload_f (cmd_state_t *cmd)
 
void SV_StartThread (void)
 
void SV_StopThread (void)
 
static int SV_ThreadFunc (void *voiddata)
 
const char * SV_TimingReport (char *buf, size_t buflen)
 for output in SV_Status_f
 
static void SV_VM_Setup (void)
 
static void SV_VM_Shutdown (qbool prog_reset)
 
static void SVVM_begin_increase_edicts (prvm_prog_t *prog)
 
static void SVVM_count_edicts (prvm_prog_t *prog)
 
static void SVVM_end_increase_edicts (prvm_prog_t *prog)
 
static void SVVM_free_edict (prvm_prog_t *prog, prvm_edict_t *ed)
 
static void SVVM_init_edict (prvm_prog_t *prog, prvm_edict_t *e)
 
static qbool SVVM_load_edict (prvm_prog_t *prog, prvm_edict_t *ent)
 

Variables

cvar_t coop = {CF_SERVER, "coop","0", "coop mode, 0 = no coop, 1 = coop mode, multiple players playing through the singleplayer game (coop mode also shuts off deathmatch)"}
 
cvar_t cutscene = {CF_SERVER, "cutscene", "1", "enables cutscenes in nehahra, can be used by other mods"}
 
cvar_t deathmatch = {CF_SERVER, "deathmatch","0", "deathmatch mode, values depend on mod but typically 0 = no deathmatch, 1 = normal deathmatch with respawning weapons, 2 = weapons stay (players can only pick up new weapons)"}
 
cvar_t fraglimit = {CF_SERVER | CF_NOTIFY, "fraglimit","0", "ends level if this many frags is reached by any player"}
 
cvar_t gamecfg = {CF_SERVER, "gamecfg", "0", "unused cvar in quake, can be used by mods"}
 
cvar_t halflifebsp = {CF_SERVER, "halflifebsp", "0", "indicates the current map is hlbsp format (useful to know because of different bounding box sizes)"}
 
client_thost_client
 
cvar_t host_framerate
 
cvar_t host_limitlocal = {CF_SERVER, "host_limitlocal", "0", "whether to apply rate limiting to the local player in a listen server (only useful for testing)"}
 
cvar_t host_timescale = {CF_CLIENT | CF_SERVER, "host_timescale", "1.0", "controls game speed, 0.5 is half speed, 2 is double speed"}
 
cvar_t nehx00 = {CF_SERVER, "nehx00", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx01 = {CF_SERVER, "nehx01", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx02 = {CF_SERVER, "nehx02", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx03 = {CF_SERVER, "nehx03", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx04 = {CF_SERVER, "nehx04", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx05 = {CF_SERVER, "nehx05", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx06 = {CF_SERVER, "nehx06", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx07 = {CF_SERVER, "nehx07", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx08 = {CF_SERVER, "nehx08", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx09 = {CF_SERVER, "nehx09", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx10 = {CF_SERVER, "nehx10", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx11 = {CF_SERVER, "nehx11", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx12 = {CF_SERVER, "nehx12", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx13 = {CF_SERVER, "nehx13", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx14 = {CF_SERVER, "nehx14", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx15 = {CF_SERVER, "nehx15", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx16 = {CF_SERVER, "nehx16", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx17 = {CF_SERVER, "nehx17", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx18 = {CF_SERVER, "nehx18", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t nehx19 = {CF_SERVER, "nehx19", "0", "nehahra data storage cvar (used in singleplayer)"}
 
cvar_t net_connecttimeout
 
cvar_t noexit = {CF_SERVER | CF_NOTIFY, "noexit","0", "kills anyone attempting to use an exit"}
 
cvar_t nomonsters = {CF_SERVER, "nomonsters", "0", "unused cvar in quake, can be used by mods"}
 
cvar_t pausable = {CF_SERVER, "pausable","1", "allow players to pause or not (otherwise, only the server admin can)"}
 
cvar_t pr_checkextension = {CF_SERVER | CF_READONLY, "pr_checkextension", "1", "indicates to QuakeC that the standard quakec extensions system is available (if 0, quakec should not attempt to use extensions)"}
 
cvar_t samelevel = {CF_SERVER | CF_NOTIFY, "samelevel","0", "repeats same level if level ends (due to timelimit or someone hitting an exit)"}
 
cvar_t saved1 = {CF_SERVER | CF_ARCHIVE, "saved1", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"}
 
cvar_t saved2 = {CF_SERVER | CF_ARCHIVE, "saved2", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"}
 
cvar_t saved3 = {CF_SERVER | CF_ARCHIVE, "saved3", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"}
 
cvar_t saved4 = {CF_SERVER | CF_ARCHIVE, "saved4", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"}
 
cvar_t savedgamecfg = {CF_SERVER | CF_ARCHIVE, "savedgamecfg", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"}
 
float scr_centertime_off
 
cvar_t scratch1 = {CF_SERVER, "scratch1", "0", "unused cvar in quake, can be used by mods"}
 
cvar_t scratch2 = {CF_SERVER,"scratch2", "0", "unused cvar in quake, can be used by mods"}
 
cvar_t scratch3 = {CF_SERVER, "scratch3", "0", "unused cvar in quake, can be used by mods"}
 
cvar_t scratch4 = {CF_SERVER, "scratch4", "0", "unused cvar in quake, can be used by mods"}
 
cvar_t skill = {CF_SERVER, "skill","1", "difficulty level of game, affects monster layouts in levels, 0 = easy, 1 = normal, 2 = hard, 3 = nightmare (same layout as hard but monsters fire twice)"}
 
static const char * standardeffectnames [EFFECT_TOTAL]
 
server_t sv
 local server
 
cvar_t sv_accelerate = {CF_SERVER, "sv_accelerate", "10", "rate at which a player accelerates to sv_maxspeed"}
 
cvar_t sv_aim = {CF_SERVER | CF_ARCHIVE, "sv_aim", "2", "maximum cosine angle for quake's vertical autoaim, a value above 1 completely disables the autoaim, quake used 0.93"}
 
cvar_t sv_airaccel_qw = {CF_SERVER, "sv_airaccel_qw", "1", "ratio of QW-style air control as opposed to simple acceleration; when < 0, the speed is clamped against the maximum allowed forward speed after the move"}
 
cvar_t sv_airaccel_qw_stretchfactor = {CF_SERVER, "sv_airaccel_qw_stretchfactor", "0", "when set, the maximum acceleration increase the player may get compared to forward-acceleration when strafejumping"}
 
cvar_t sv_airaccel_sideways_friction = {CF_SERVER, "sv_airaccel_sideways_friction", "", "anti-sideways movement stabilization (reduces speed gain when zigzagging); when < 0, only so much friction is applied that braking (by accelerating backwards) cannot be stronger"}
 
cvar_t sv_airaccelerate = {CF_SERVER, "sv_airaccelerate", "-1", "rate at which a player accelerates to sv_maxairspeed while in the air, if less than 0 the sv_accelerate variable is used instead"}
 
cvar_t sv_aircontrol = {CF_SERVER, "sv_aircontrol", "0", "CPMA-style air control"}
 
cvar_t sv_aircontrol_penalty = {CF_SERVER, "sv_aircontrol_penalty", "0", "deceleration while using CPMA-style air control"}
 
cvar_t sv_aircontrol_power = {CF_SERVER, "sv_aircontrol_power", "2", "CPMA-style air control exponent"}
 
cvar_t sv_airspeedlimit_nonqw = {CF_SERVER, "sv_airspeedlimit_nonqw", "0", "when set, this is a soft speed limit while in air when using airaccel_qw not equal to 1"}
 
cvar_t sv_airstopaccelerate = {CF_SERVER, "sv_airstopaccelerate", "0", "when set, replacement for sv_airaccelerate when moving backwards"}
 
cvar_t sv_airstrafeaccel_qw = {CF_SERVER, "sv_airstrafeaccel_qw", "0", "when set, replacement for sv_airaccel_qw when just strafing"}
 
cvar_t sv_airstrafeaccelerate = {CF_SERVER, "sv_airstrafeaccelerate", "0", "when set, replacement for sv_airaccelerate when just strafing"}
 
cvar_t sv_allowdownloads = {CF_SERVER, "sv_allowdownloads", "1", "whether to allow clients to download files from the server (does not affect http downloads)"}
 
cvar_t sv_allowdownloads_archive = {CF_SERVER, "sv_allowdownloads_archive", "0", "whether to allow downloads of archives (pak/pk3)"}
 
cvar_t sv_allowdownloads_config = {CF_SERVER, "sv_allowdownloads_config", "0", "whether to allow downloads of config files (cfg)"}
 
cvar_t sv_allowdownloads_dlcache = {CF_SERVER, "sv_allowdownloads_dlcache", "0", "whether to allow downloads of dlcache files (dlcache/)"}
 
cvar_t sv_allowdownloads_inarchive = {CF_SERVER, "sv_allowdownloads_inarchive", "0", "whether to allow downloads from archives (pak/pk3)"}
 
cvar_t sv_areadebug = {CF_SERVER, "sv_areadebug", "0", "disables physics culling for debugging purposes (only for development)"}
 
cvar_t sv_areagrid_link_SOLID_NOT = {CF_SERVER | CF_NOTIFY, "sv_areagrid_link_SOLID_NOT", "1", "set to 0 to prevent SOLID_NOT entities from being linked to the area grid, and unlink any that are already linked (in the code paths that would otherwise link them), for better performance"}
 
cvar_t sv_areagrid_mingridsize = {CF_SERVER | CF_NOTIFY, "sv_areagrid_mingridsize", "128", "minimum areagrid cell size, smaller values work better for lots of small objects, higher values for large objects"}
 
cvar_t sv_autodemo_perclient = {CF_SERVER | CF_ARCHIVE, "sv_autodemo_perclient", "0", "set to 1 to enable autorecorded per-client demos (they'll start to record at the beginning of a match); set it to 2 to also record client->server packets (for debugging)"}
 
cvar_t sv_autodemo_perclient_discardable = {CF_SERVER | CF_ARCHIVE, "sv_autodemo_perclient_discardable", "0", "Allow game code to decide whether a demo should be kept or discarded."}
 
cvar_t sv_autodemo_perclient_nameformat = {CF_SERVER | CF_ARCHIVE, "sv_autodemo_perclient_nameformat", "sv_autodemos/%Y-%m-%d_%H-%M", "The format of the sv_autodemo_perclient filename, followed by the map name, the client number and the IP address + port number, separated by underscores (the date is encoded using strftime escapes)" }
 
cvar_t sv_checkforpacketsduringsleep = {CF_SERVER, "sv_checkforpacketsduringsleep", "0", "uses select() function to wait between frames which can be interrupted by packets being received, instead of Sleep()/usleep()/SDL_Sleep() functions which do not check for packets"}
 
cvar_t sv_clmovement_enable = {CF_SERVER, "sv_clmovement_enable", "1", "whether to allow clients to use cl_movement prediction, which can cause choppy movement on the server which may annoy other players"}
 
cvar_t sv_clmovement_inputtimeout = {CF_SERVER, "sv_clmovement_inputtimeout", "0.1", "when a client does not send input for this many seconds (max 0.1), force them to move anyway (unlike QuakeWorld)"}
 
cvar_t sv_clmovement_minping = {CF_SERVER, "sv_clmovement_minping", "0", "if client ping is below this time in milliseconds, then their ability to use cl_movement prediction is disabled for a while (as they don't need it)"}
 
cvar_t sv_clmovement_minping_disabletime = {CF_SERVER, "sv_clmovement_minping_disabletime", "1000", "when client falls below minping, disable their prediction for this many milliseconds (should be at least 1000 or else their prediction may turn on/off frequently)"}
 
cvar_t sv_cullentities_nevercullbmodels = {CF_SERVER, "sv_cullentities_nevercullbmodels", "0", "if enabled the clients are always notified of moving doors and lifts and other submodels of world (warning: eats a lot of network bandwidth on some levels!)"}
 
cvar_t sv_cullentities_pvs = {CF_SERVER, "sv_cullentities_pvs", "1", "fast but loose culling of hidden entities"}
 
cvar_t sv_cullentities_stats = {CF_SERVER, "sv_cullentities_stats", "0", "displays stats on network entities culled by various methods for each client"}
 
cvar_t sv_cullentities_trace = {CF_SERVER, "sv_cullentities_trace", "0", "somewhat slow but very tight culling of hidden entities, minimizes network traffic and makes wallhack cheats useless"}
 
cvar_t sv_cullentities_trace_delay = {CF_SERVER, "sv_cullentities_trace_delay", "1", "number of seconds until the entity gets actually culled (also applies to portal camera eyes even if sv_cullentities_trace is 0)"}
 
cvar_t sv_cullentities_trace_delay_players = {CF_SERVER, "sv_cullentities_trace_delay_players", "0.2", "number of seconds until the entity gets actually culled if it is a player entity"}
 
cvar_t sv_cullentities_trace_enlarge = {CF_SERVER, "sv_cullentities_trace_enlarge", "0", "box enlargement for entity culling (also applies to portal camera eyes even if sv_cullentities_trace is 0)"}
 
cvar_t sv_cullentities_trace_entityocclusion = {CF_SERVER, "sv_cullentities_trace_entityocclusion", "0", "also check if doors and other bsp models are in the way"}
 
cvar_t sv_cullentities_trace_expand = {CF_SERVER, "sv_cullentities_trace_expand", "0", "box is expanded by this many units for entity culling (also applies to portal camera eyes even if sv_cullentities_trace is 0)"}
 
cvar_t sv_cullentities_trace_eyejitter = {CF_SERVER, "sv_cullentities_trace_eyejitter", "16", "jitter the eye by this much for each trace (also applies to portal camera eyes even if sv_cullentities_trace is 0)"}
 
cvar_t sv_cullentities_trace_prediction = {CF_SERVER, "sv_cullentities_trace_prediction", "1", "also trace from the predicted player position"}
 
cvar_t sv_cullentities_trace_prediction_time = {CF_SERVER, "sv_cullentities_trace_prediction_time", "0.2", "maximum ping time to predict in seconds"}
 
cvar_t sv_cullentities_trace_samples = {CF_SERVER, "sv_cullentities_trace_samples", "2", "number of samples to test for entity culling"}
 
cvar_t sv_cullentities_trace_samples_extra = {CF_SERVER, "sv_cullentities_trace_samples_extra", "2", "number of samples to test for entity culling when the entity affects its surroundings by e.g. dlight (also applies to portal camera eyes even if sv_cullentities_trace is 0)"}
 
cvar_t sv_cullentities_trace_samples_players = {CF_SERVER, "sv_cullentities_trace_samples_players", "8", "number of samples to test for entity culling when the entity is a player entity"}
 
cvar_t sv_cullentities_trace_spectators = {CF_SERVER, "sv_cullentities_trace_spectators", "0", "enables trace entity culling for clients that are spectating"}
 
cvar_t sv_debugmove = {CF_SERVER | CF_NOTIFY, "sv_debugmove", "0", "disables collision detection optimizations for debugging purposes"}
 
cvar_t sv_dedicated = {CF_SERVER | CF_READONLY, "sv_dedicated", "0", "for scripts and SVQC to detect when they're running on a dedicated server"}
 
cvar_t sv_disablenotify = {CF_SERVER, "sv_disablenotify", "0", "suppress broadcast prints when certain cvars are changed (CF_NOTIFY flag in engine code)"}
 
cvar_t sv_echobprint = {CF_SERVER | CF_ARCHIVE, "sv_echobprint", "1", "prints gamecode bprint() calls to server console"}
 
cvar_t sv_edgefriction = {CF_SERVER, "edgefriction", "1", "how much you slow down when nearing a ledge you might fall off, multiplier of sv_friction (Quake used 2, QuakeWorld used 1 due to a bug in physics code)"}
 
cvar_t sv_entpatch = {CF_SERVER, "sv_entpatch", "1", "enables loading of .ent files to override entities in the bsp (for example Threewave CTF server pack contains .ent patch files enabling play of CTF on id1 maps)"}
 
cvar_t sv_freezenonclients = {CF_SERVER | CF_NOTIFY, "sv_freezenonclients", "0", "freezes time, except for players, allowing you to walk around and take screenshots of explosions"}
 
cvar_t sv_friction = {CF_SERVER | CF_NOTIFY, "sv_friction","4", "how fast you slow down"}
 
cvar_t sv_gameplayfix_blowupfallenzombies = {CF_SERVER, "sv_gameplayfix_blowupfallenzombies", "1", "causes findradius to detect SOLID_NOT entities such as zombies and corpses on the floor, allowing splash damage to apply to them"}
 
cvar_t sv_gameplayfix_consistentplayerprethink = {CF_SERVER, "sv_gameplayfix_consistentplayerprethink", "0", "improves fairness in multiplayer by running all PlayerPreThink functions (which fire weapons) before performing physics, then running all PlayerPostThink functions"}
 
cvar_t sv_gameplayfix_delayprojectiles = {CF_SERVER, "sv_gameplayfix_delayprojectiles", "1", "causes entities to not move on the same frame they are spawned, meaning that projectiles wait until the next frame to perform their first move, giving proper interpolation and rocket trails, but making weapons harder to use at low framerates"}
 
cvar_t sv_gameplayfix_downtracesupportsongroundflag = {CF_SERVER, "sv_gameplayfix_downtracesupportsongroundflag", "1", "prevents very short moves from clearing onground (which may make the player stick to the floor at high netfps), fixes groundentity not being set when walking onto a mover with sv_gameplayfix_nogravityonground"}
 
cvar_t sv_gameplayfix_droptofloorstartsolid = {CF_SERVER, "sv_gameplayfix_droptofloorstartsolid", "1", "prevents items and monsters that start in a solid area from falling out of the level (makes droptofloor treat trace_startsolid as an acceptable outcome)"}
 
cvar_t sv_gameplayfix_droptofloorstartsolid_nudgetocorrect = {CF_SERVER, "sv_gameplayfix_droptofloorstartsolid_nudgetocorrect", "1", "tries to nudge stuck items and monsters out of walls before droptofloor is performed"}
 
cvar_t sv_gameplayfix_easierwaterjump = {CF_SERVER, "sv_gameplayfix_easierwaterjump", "1", "changes water jumping to make it easier to get out of water (exactly like in QuakeWorld)"}
 
cvar_t sv_gameplayfix_findradiusdistancetobox = {CF_SERVER, "sv_gameplayfix_findradiusdistancetobox", "1", "causes findradius to check the distance to the corner of a box rather than the center of the box, makes findradius detect bmodels such as very large doors that would otherwise be unaffected by splash damage"}
 
cvar_t sv_gameplayfix_fixedcheckwatertransition = {CF_SERVER, "sv_gameplayfix_fixedcheckwatertransition", "1", "fix two very stupid bugs in SV_CheckWaterTransition when watertype is CONTENTS_EMPTY (the bugs causes waterlevel to be 1 on first frame, -1 on second frame - the fix makes it 0 on both frames)"}
 
cvar_t sv_gameplayfix_gravityunaffectedbyticrate = {CF_SERVER, "sv_gameplayfix_gravityunaffectedbyticrate", "0", "fix some ticrate issues in physics."}
 
cvar_t sv_gameplayfix_grenadebouncedownslopes = {CF_SERVER, "sv_gameplayfix_grenadebouncedownslopes", "1", "prevents MOVETYPE_BOUNCE (grenades) from getting stuck when fired down a downward sloping surface"}
 
cvar_t sv_gameplayfix_impactbeforeonground = {CF_SERVER, "sv_gameplayfix_impactbeforeonground", "0", "enables a bug from old DP versions in which entity .touch functions are called before FL_ONGROUND is set when a collision is detected in SV_FlyMove() (used by MOVETYPE_WALK and MOVETYPE_STEP), Quake 1.5 and Combat+ mods require this, it breaks id1 fiends"}
 
cvar_t sv_gameplayfix_multiplethinksperframe = {CF_SERVER, "sv_gameplayfix_multiplethinksperframe", "1", "allows entities to think more often than the server framerate, primarily useful for very high fire rate weapons"}
 
cvar_t sv_gameplayfix_noairborncorpse = {CF_SERVER, "sv_gameplayfix_noairborncorpse", "1", "causes entities (corpses, items, etc) sitting ontop of moving entities (players) to fall when the moving entity (player) is no longer supporting them"}
 
cvar_t sv_gameplayfix_noairborncorpse_allowsuspendeditems = {CF_SERVER, "sv_gameplayfix_noairborncorpse_allowsuspendeditems", "1", "causes entities sitting ontop of objects that are instantaneously remove to float in midair (special hack to allow a common level design trick for floating items)"}
 
cvar_t sv_gameplayfix_nogravityonground = {CF_SERVER, "sv_gameplayfix_nogravityonground", "0", "turn off gravity when on ground (to get rid of sliding)"}
 
cvar_t sv_gameplayfix_nosquashentities = {CF_SERVER, "sv_gameplayfix_nosquashentities", "0", "Entity hitboxes will not be resized or disabled when they are crushed by movers, and will continue to be affected by movers."}
 
cvar_t sv_gameplayfix_nostepmoveonsteepslopes = {CF_SERVER, "sv_gameplayfix_nostepmoveonsteepslopes", "0", "crude fix which prevents MOVETYPE_STEP (not swimming or flying) to move on slopes whose angle is bigger than 45 degree"}
 
cvar_t sv_gameplayfix_nudgeoutofsolid = {CF_SERVER, "sv_gameplayfix_nudgeoutofsolid", "0", "attempts to fix physics errors where an object ended up in solid for some reason, smarter than sv_gameplayfix_unstick* except on Q1BSP with mod_q1bsp_polygoncollisions disabled (there it falls back to the unsticking method)"}
 
cvar_t sv_gameplayfix_nudgeoutofsolid_separation = {CF_SERVER, "sv_gameplayfix_nudgeoutofsolid_separation", "0.03125", "keep objects this distance apart to prevent collision issues on seams"}
 
cvar_t sv_gameplayfix_q1bsptracelinereportstexture = {CF_SERVER, "sv_gameplayfix_q1bsptracelinereportstexture", "1", "enables mods to get accurate trace_texture results on q1bsp by using a surface-hitting traceline implementation rather than the standard solidbsp method, q3bsp always reports texture accurately"}
 
cvar_t sv_gameplayfix_q2airaccelerate = {CF_SERVER, "sv_gameplayfix_q2airaccelerate", "0", "Quake2-style air acceleration"}
 
cvar_t sv_gameplayfix_setmodelrealbox = {CF_SERVER, "sv_gameplayfix_setmodelrealbox", "1", "fixes a bug in Quake that made setmodel always set the entity box to ('-16 -16 -16', '16 16 16') rather than properly checking the model box, breaks some poorly coded mods"}
 
cvar_t sv_gameplayfix_slidemoveprojectiles = {CF_SERVER, "sv_gameplayfix_slidemoveprojectiles", "1", "allows MOVETYPE_FLY/FLYMISSILE/TOSS/BOUNCE/BOUNCEMISSILE entities to finish their move in a frame even if they hit something, fixes 'gravity accumulation' bug for grenades on steep slopes"}
 
cvar_t sv_gameplayfix_stepdown = {CF_SERVER, "sv_gameplayfix_stepdown", "0", "attempts to step down stairs, not just up them (prevents the familiar thud..thud..thud.. when running down stairs and slopes)"}
 
cvar_t sv_gameplayfix_stepmultipletimes = {CF_SERVER, "sv_gameplayfix_stepmultipletimes", "0", "applies step-up onto a ledge more than once in a single frame, when running quickly up stairs"}
 
cvar_t sv_gameplayfix_swiminbmodels = {CF_SERVER, "sv_gameplayfix_swiminbmodels", "1", "causes pointcontents (used to determine if you are in a liquid) to check bmodel entities as well as the world model, so you can swim around in (possibly moving) water bmodel entities"}
 
cvar_t sv_gameplayfix_unstickentities = {CF_SERVER, "sv_gameplayfix_unstickentities", "0", "hack to check if entities are crossing world collision hull and try to move them to the right position. Quake didn't do this so maps shouldn't depend on it."}
 
cvar_t sv_gameplayfix_unstickplayers = {CF_SERVER, "sv_gameplayfix_unstickplayers", "1", "big hack to try and fix the rare case of MOVETYPE_WALK entities getting stuck in the world clipping hull. Quake did something similar."}
 
cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag = {CF_SERVER, "sv_gameplayfix_upwardvelocityclearsongroundflag", "1", "prevents monsters, items, and most other objects from being stuck to the floor when pushed around by damage, and other situations in mods"}
 
cvar_t sv_gravity = {CF_SERVER | CF_NOTIFY, "sv_gravity","800", "how fast you fall (512 = roughly earth gravity)"}
 
cvar_t sv_idealpitchscale = {CF_SERVER, "sv_idealpitchscale","0.8", "how much to look up/down slopes and stairs when not using freelook"}
 
cvar_t sv_init_frame_count = {CF_SERVER, "sv_init_frame_count", "2", "number of frames to run to allow everything to settle before letting clients connect"}
 
cvar_t sv_jumpstep = {CF_SERVER | CF_NOTIFY, "sv_jumpstep", "0", "whether you can step up while jumping"}
 
cvar_t sv_jumpvelocity = {CF_SERVER, "sv_jumpvelocity", "270", "cvar that can be used by QuakeC code for jump velocity"}
 
cvar_t sv_lagreporting_always = {CF_SERVER, "sv_lagreporting_always", "0", "report lag even in singleplayer, listen, an empty dedicated server, or during intermission"}
 
cvar_t sv_lagreporting_strict = {CF_SERVER, "sv_lagreporting_strict", "0", "log any extra frames run to catch up after a holdup (only applies when sv_maxphysicsframesperserverframe > 1)"}
 
cvar_t sv_legacy_bbox_expand = {CF_SERVER, "sv_legacy_bbox_expand", "1", "before linking an entity to the area grid, decrease its mins and increase its maxs by '1 1 1', or '15 15 1' if it has flag FL_ITEM (this is the Quake/QuakeWorld behaviour); disable to make SVQC bboxes consistent with CSQC which never does this expansion"}
 
cvar_t sv_mapformat_is_quake2 = {CF_SERVER, "sv_mapformat_is_quake2", "0", "indicates the current map is q2bsp format (useful to know because of different entity behaviors, .frame on submodels and other things)"}
 
cvar_t sv_mapformat_is_quake3 = {CF_SERVER, "sv_mapformat_is_quake3", "0", "indicates the current map is q3bsp format (useful to know because of different entity behaviors)"}
 
cvar_t sv_maxairspeed = {CF_SERVER, "sv_maxairspeed", "30", "maximum speed a player can accelerate to when airborn (note that it is possible to completely stop by moving the opposite direction)"}
 
cvar_t sv_maxairstrafespeed = {CF_SERVER, "sv_maxairstrafespeed", "0", "when set, replacement for sv_maxairspeed when just strafing"}
 
cvar_t sv_maxphysicsframesperserverframe = {CF_SERVER, "sv_maxphysicsframesperserverframe","10", "maximum number of physics frames per server frame"}
 
cvar_t sv_maxrate = {CF_SERVER | CF_ARCHIVE | CF_NOTIFY, "sv_maxrate", "1000000", "upper limit on client rate cvar, should reflect your network connection quality"}
 
cvar_t sv_maxspeed = {CF_SERVER | CF_NOTIFY, "sv_maxspeed", "320", "maximum speed a player can accelerate to when on ground (can be exceeded by tricks)"}
 
cvar_t sv_maxvelocity = {CF_SERVER | CF_NOTIFY, "sv_maxvelocity","2000", "universal speed limit on all entities"}
 
mempool_tsv_mempool = NULL
 
cvar_t sv_nostep = {CF_SERVER | CF_NOTIFY, "sv_nostep","0", "prevents MOVETYPE_STEP entities (monsters) from moving"}
 
cvar_t sv_onlycsqcnetworking = {CF_SERVER, "sv_onlycsqcnetworking", "0", "disables legacy entity networking code for higher performance (except on clients, which can still be legacy)"}
 
cvar_t sv_playerphysicsqc = {CF_SERVER | CF_NOTIFY, "sv_playerphysicsqc", "1", "enables QuakeC function to override player physics"}
 
cvar_t sv_progs = {CF_SERVER, "sv_progs", "progs.dat", "selects which quakec progs.dat file to run" }
 
cvar_t sv_protocolname = {CF_SERVER, "sv_protocolname", "DP7", "selects network protocol to host for (values include QUAKE, QUAKEDP, NEHAHRAMOVIE, DP1 and up)"}
 
cvar_t sv_qcstats = {CF_SERVER, "sv_qcstats", "0", "Disables engine sending of stats 220 and above, for use by certain games such as Xonotic, NOTE: it's strongly recommended that SVQC send correct STAT_MOVEVARS_TICRATE and STAT_MOVEVARS_TIMESCALE"}
 
cvar_t sv_random_seed = {CF_SERVER, "sv_random_seed", "", "random seed; when set, on every map start this random seed is used to initialize the random number generator. Don't touch it unless for benchmarking or debugging"}
 
prvm_required_field_t sv_reqfields []
 
prvm_required_field_t sv_reqglobals []
 
cvar_t sv_rollangle = {CF_CLIENT, "sv_rollangle", "2.0", "how much to tilt the view when strafing"}
 
cvar_t sv_rollspeed = {CF_CLIENT, "sv_rollspeed", "200", "how much strafing is necessary to tilt the view"}
 
cvar_t sv_sendentities_csqc_randomize_order = {CF_SERVER, "sv_sendentities_csqc_randomize_order", "1", "Randomize the order of sending CSQC entities (should behave better when packet size or bandwidth limits are exceeded)."}
 
cvar_t sv_sound_land = {CF_SERVER, "sv_sound_land", "demon/dland2.wav", "sound to play when MOVETYPE_STEP entity hits the ground at high speed (empty cvar disables the sound)"}
 
cvar_t sv_sound_watersplash = {CF_SERVER, "sv_sound_watersplash", "misc/h2ohit1.wav", "sound to play when MOVETYPE_FLY/TOSS/BOUNCE/STEP entity enters or leaves water (empty cvar disables the sound)"}
 
cvar_t sv_stepheight = {CF_SERVER | CF_NOTIFY, "sv_stepheight", "18", "how high you can step up (TW_SV_STEPCONTROL extension)"}
 
cvar_t sv_stopspeed = {CF_SERVER | CF_NOTIFY, "sv_stopspeed","100", "how fast you come to a complete stop"}
 
cvar_t sv_threaded = {CF_SERVER, "sv_threaded", "0", "enables a separate thread for server code, improving performance, especially when hosting a game while playing, EXPERIMENTAL, may be crashy"}
 
cvar_t sv_wallfriction = {CF_SERVER | CF_NOTIFY, "sv_wallfriction", "1", "how much you slow down when sliding along a wall"}
 
cvar_t sv_warsowbunny_accel = {CF_SERVER, "sv_warsowbunny_accel", "0.1585", "how fast you accelerate until after reaching sv_maxspeed (it gets harder as you near sv_warsowbunny_topspeed)"}
 
cvar_t sv_warsowbunny_airforwardaccel = {CF_SERVER, "sv_warsowbunny_airforwardaccel", "1.00001", "how fast you accelerate until you reach sv_maxspeed"}
 
cvar_t sv_warsowbunny_backtosideratio = {CF_SERVER, "sv_warsowbunny_backtosideratio", "0.8", "lower values make it easier to change direction without losing speed; the drawback is \"understeering\" in sharp turns"}
 
cvar_t sv_warsowbunny_topspeed = {CF_SERVER, "sv_warsowbunny_topspeed", "925", "soft speed limit (can get faster with rjs and on ramps)"}
 
cvar_t sv_warsowbunny_turnaccel = {CF_SERVER, "sv_warsowbunny_turnaccel", "0", "max sharpness of turns (also master switch for the sv_warsowbunny_* mode; set this to 9 to enable)"}
 
cvar_t sv_wateraccelerate = {CF_SERVER, "sv_wateraccelerate", "-1", "rate at which a player accelerates to sv_maxspeed while in water, if less than 0 the sv_accelerate variable is used instead"}
 
cvar_t sv_waterfriction = {CF_SERVER | CF_NOTIFY, "sv_waterfriction","-1", "how fast you slow down in water, if less than 0 the sv_friction variable is used instead"}
 
cvar_t sv_worldbasename = {CF_SERVER | CF_READONLY, "sv_worldbasename", "", "name of current worldmodel without maps/ prefix or extension"}
 
cvar_t sv_worldmessage = {CF_SERVER | CF_READONLY, "sv_worldmessage", "", "title of current level"}
 
cvar_t sv_worldname = {CF_SERVER | CF_READONLY, "sv_worldname", "", "name of current worldmodel"}
 
cvar_t sv_worldnamenoextension = {CF_SERVER | CF_READONLY, "sv_worldnamenoextension", "", "name of current worldmodel without extension"}
 
cvar_t sv_writepicture_quality = {CF_SERVER | CF_ARCHIVE, "sv_writepicture_quality", "10", "WritePicture quality offset (higher means better quality, but slower)"}
 
server_static_t svs
 persistant server info
 
cvar_t sys_ticrate = {CF_SERVER | CF_ARCHIVE, "sys_ticrate","0.01388889", "how long a server frame is in seconds, 0.05 is 20fps server rate, 0.1 is 10fps (can not be set higher than 0.1), 0 runs as many server frames as possible (makes games against bots a little smoother, overwhelms network players), 1/72 matches QuakeWorld physics"}
 
cvar_t teamplay = {CF_SERVER | CF_NOTIFY, "teamplay","0", "teamplay mode, values depend on mod but typically 0 = no teams, 1 = no team damage no self damage, 2 = team damage and self damage, some mods support 3 = no team damage but can damage self"}
 
cvar_t temp1 = {CF_SERVER, "temp1","0", "general cvar for mods to use, in stock id1 this selects which death animation to use on players (0 = random death, other values select specific death scenes)"}
 
cvar_t timelimit = {CF_SERVER | CF_NOTIFY, "timelimit","0", "ends level at this time (in minutes)"}
 

Macro Definition Documentation

◆ PRVM_DECLARE_clientfieldedict [1/2]

#define PRVM_DECLARE_clientfieldedict ( x)

◆ PRVM_DECLARE_clientfieldedict [2/2]

#define PRVM_DECLARE_clientfieldedict ( x)

◆ PRVM_DECLARE_clientfieldfloat [1/2]

#define PRVM_DECLARE_clientfieldfloat ( x)

◆ PRVM_DECLARE_clientfieldfloat [2/2]

#define PRVM_DECLARE_clientfieldfloat ( x)

◆ PRVM_DECLARE_clientfieldfunction [1/2]

#define PRVM_DECLARE_clientfieldfunction ( x)

◆ PRVM_DECLARE_clientfieldfunction [2/2]

#define PRVM_DECLARE_clientfieldfunction ( x)

◆ PRVM_DECLARE_clientfieldstring [1/2]

#define PRVM_DECLARE_clientfieldstring ( x)

◆ PRVM_DECLARE_clientfieldstring [2/2]

#define PRVM_DECLARE_clientfieldstring ( x)

◆ PRVM_DECLARE_clientfieldvector [1/2]

#define PRVM_DECLARE_clientfieldvector ( x)

◆ PRVM_DECLARE_clientfieldvector [2/2]

#define PRVM_DECLARE_clientfieldvector ( x)

◆ PRVM_DECLARE_clientfunction [1/2]

#define PRVM_DECLARE_clientfunction ( x)

◆ PRVM_DECLARE_clientfunction [2/2]

#define PRVM_DECLARE_clientfunction ( x)

◆ PRVM_DECLARE_clientglobaledict [1/2]

#define PRVM_DECLARE_clientglobaledict ( x)

◆ PRVM_DECLARE_clientglobaledict [2/2]

#define PRVM_DECLARE_clientglobaledict ( x)

◆ PRVM_DECLARE_clientglobalfloat [1/2]

#define PRVM_DECLARE_clientglobalfloat ( x)

◆ PRVM_DECLARE_clientglobalfloat [2/2]

#define PRVM_DECLARE_clientglobalfloat ( x)

◆ PRVM_DECLARE_clientglobalfunction [1/2]

#define PRVM_DECLARE_clientglobalfunction ( x)

◆ PRVM_DECLARE_clientglobalfunction [2/2]

#define PRVM_DECLARE_clientglobalfunction ( x)

◆ PRVM_DECLARE_clientglobalstring [1/2]

#define PRVM_DECLARE_clientglobalstring ( x)

◆ PRVM_DECLARE_clientglobalstring [2/2]

#define PRVM_DECLARE_clientglobalstring ( x)

◆ PRVM_DECLARE_clientglobalvector [1/2]

#define PRVM_DECLARE_clientglobalvector ( x)

◆ PRVM_DECLARE_clientglobalvector [2/2]

#define PRVM_DECLARE_clientglobalvector ( x)

◆ PRVM_DECLARE_field [1/2]

#define PRVM_DECLARE_field ( x)

◆ PRVM_DECLARE_field [2/2]

#define PRVM_DECLARE_field ( x)

◆ PRVM_DECLARE_function [1/2]

#define PRVM_DECLARE_function ( x)

◆ PRVM_DECLARE_function [2/2]

#define PRVM_DECLARE_function ( x)

◆ PRVM_DECLARE_global [1/2]

#define PRVM_DECLARE_global ( x)

◆ PRVM_DECLARE_global [2/2]

#define PRVM_DECLARE_global ( x)

◆ PRVM_DECLARE_menufieldedict [1/2]

#define PRVM_DECLARE_menufieldedict ( x)

◆ PRVM_DECLARE_menufieldedict [2/2]

#define PRVM_DECLARE_menufieldedict ( x)

◆ PRVM_DECLARE_menufieldfloat [1/2]

#define PRVM_DECLARE_menufieldfloat ( x)

◆ PRVM_DECLARE_menufieldfloat [2/2]

#define PRVM_DECLARE_menufieldfloat ( x)

◆ PRVM_DECLARE_menufieldfunction [1/2]

#define PRVM_DECLARE_menufieldfunction ( x)

◆ PRVM_DECLARE_menufieldfunction [2/2]

#define PRVM_DECLARE_menufieldfunction ( x)

◆ PRVM_DECLARE_menufieldstring [1/2]

#define PRVM_DECLARE_menufieldstring ( x)

◆ PRVM_DECLARE_menufieldstring [2/2]

#define PRVM_DECLARE_menufieldstring ( x)

◆ PRVM_DECLARE_menufieldvector [1/2]

#define PRVM_DECLARE_menufieldvector ( x)

◆ PRVM_DECLARE_menufieldvector [2/2]

#define PRVM_DECLARE_menufieldvector ( x)

◆ PRVM_DECLARE_menufunction [1/2]

#define PRVM_DECLARE_menufunction ( x)

◆ PRVM_DECLARE_menufunction [2/2]

#define PRVM_DECLARE_menufunction ( x)

◆ PRVM_DECLARE_menuglobaledict [1/2]

#define PRVM_DECLARE_menuglobaledict ( x)

◆ PRVM_DECLARE_menuglobaledict [2/2]

#define PRVM_DECLARE_menuglobaledict ( x)

◆ PRVM_DECLARE_menuglobalfloat [1/2]

#define PRVM_DECLARE_menuglobalfloat ( x)

◆ PRVM_DECLARE_menuglobalfloat [2/2]

#define PRVM_DECLARE_menuglobalfloat ( x)

◆ PRVM_DECLARE_menuglobalfunction [1/2]

#define PRVM_DECLARE_menuglobalfunction ( x)

◆ PRVM_DECLARE_menuglobalfunction [2/2]

#define PRVM_DECLARE_menuglobalfunction ( x)

◆ PRVM_DECLARE_menuglobalstring [1/2]

#define PRVM_DECLARE_menuglobalstring ( x)

◆ PRVM_DECLARE_menuglobalstring [2/2]

#define PRVM_DECLARE_menuglobalstring ( x)

◆ PRVM_DECLARE_menuglobalvector [1/2]

#define PRVM_DECLARE_menuglobalvector ( x)

◆ PRVM_DECLARE_menuglobalvector [2/2]

#define PRVM_DECLARE_menuglobalvector ( x)

◆ PRVM_DECLARE_serverfieldedict [1/2]

#define PRVM_DECLARE_serverfieldedict ( x)
Value:
GLint GLenum GLint x
Definition glquake.h:651
@ ev_entity
Definition pr_comp.h:29

◆ PRVM_DECLARE_serverfieldedict [2/2]

#define PRVM_DECLARE_serverfieldedict ( x)

◆ PRVM_DECLARE_serverfieldfloat [1/2]

#define PRVM_DECLARE_serverfieldfloat ( x)
Value:
{ev_float, #x},
@ ev_float
Definition pr_comp.h:29

◆ PRVM_DECLARE_serverfieldfloat [2/2]

#define PRVM_DECLARE_serverfieldfloat ( x)

◆ PRVM_DECLARE_serverfieldfunction [1/2]

#define PRVM_DECLARE_serverfieldfunction ( x)
Value:
@ ev_function
Definition pr_comp.h:29

◆ PRVM_DECLARE_serverfieldfunction [2/2]

#define PRVM_DECLARE_serverfieldfunction ( x)

◆ PRVM_DECLARE_serverfieldstring [1/2]

#define PRVM_DECLARE_serverfieldstring ( x)
Value:
@ ev_string
Definition pr_comp.h:29

◆ PRVM_DECLARE_serverfieldstring [2/2]

#define PRVM_DECLARE_serverfieldstring ( x)

◆ PRVM_DECLARE_serverfieldvector [1/2]

#define PRVM_DECLARE_serverfieldvector ( x)
Value:
@ ev_vector
Definition pr_comp.h:29

◆ PRVM_DECLARE_serverfieldvector [2/2]

#define PRVM_DECLARE_serverfieldvector ( x)

◆ PRVM_DECLARE_serverfunction [1/2]

#define PRVM_DECLARE_serverfunction ( x)

◆ PRVM_DECLARE_serverfunction [2/2]

#define PRVM_DECLARE_serverfunction ( x)

◆ PRVM_DECLARE_serverglobaledict [1/2]

#define PRVM_DECLARE_serverglobaledict ( x)

◆ PRVM_DECLARE_serverglobaledict [2/2]

#define PRVM_DECLARE_serverglobaledict ( x)
Value:

◆ PRVM_DECLARE_serverglobalfloat [1/2]

#define PRVM_DECLARE_serverglobalfloat ( x)

◆ PRVM_DECLARE_serverglobalfloat [2/2]

#define PRVM_DECLARE_serverglobalfloat ( x)
Value:
{ev_float, #x},

◆ PRVM_DECLARE_serverglobalfunction [1/2]

#define PRVM_DECLARE_serverglobalfunction ( x)

◆ PRVM_DECLARE_serverglobalfunction [2/2]

#define PRVM_DECLARE_serverglobalfunction ( x)
Value:

◆ PRVM_DECLARE_serverglobalstring [1/2]

#define PRVM_DECLARE_serverglobalstring ( x)

◆ PRVM_DECLARE_serverglobalstring [2/2]

#define PRVM_DECLARE_serverglobalstring ( x)
Value:

◆ PRVM_DECLARE_serverglobalvector [1/2]

#define PRVM_DECLARE_serverglobalvector ( x)

◆ PRVM_DECLARE_serverglobalvector [2/2]

#define PRVM_DECLARE_serverglobalvector ( x)
Value:

◆ SV_REQFIELDS

#define SV_REQFIELDS   (sizeof(sv_reqfields) / sizeof(prvm_required_field_t))

Definition at line 278 of file sv_main.c.

Referenced by SV_VM_Setup().

◆ SV_REQGLOBALS

#define SV_REQGLOBALS   (sizeof(sv_reqglobals) / sizeof(prvm_required_field_t))

Definition at line 357 of file sv_main.c.

Referenced by SV_VM_Setup().

Function Documentation

◆ Download_CheckExtensions()

static void Download_CheckExtensions ( cmd_state_t * cmd)
static

Definition at line 1191 of file sv_main.c.

1192{
1193 int i;
1194 int argc = Cmd_Argc(cmd);
1195
1196 // first reset them all
1198
1199 for(i = 2; i < argc; ++i)
1200 {
1201 if(!strcmp(Cmd_Argv(cmd, i), "deflate"))
1202 {
1204 break;
1205 }
1206 }
1207}
static int Cmd_Argc(cmd_state_t *cmd)
Definition cmd.h:249
static const char * Cmd_Argv(cmd_state_t *cmd, int arg)
Cmd_Argv(cmd, ) will return an empty string (not a NULL) if arg > argc, so string operations are alwa...
Definition cmd.h:254
void cmd(string command,...)
int i
qbool download_deflate
Definition server.h:290
client_t * host_client
Definition sv_main.c:29

References cmd(), Cmd_Argc(), Cmd_Argv(), client_t::download_deflate, host_client, and i.

Referenced by SV_Download_f().

◆ Host_Timescale_c()

static void Host_Timescale_c ( cvar_t * var)
static

Definition at line 436 of file sv_main.c.

437{
438 if(var->value < 0.00001 && var->value != 0)
439 Cvar_SetValueQuick(var, 0);
440}
void Cvar_SetValueQuick(cvar_t *var, float value)
Definition cvar.c:473
float value
Definition cvar.h:74

References Cvar_SetValueQuick(), and cvar_t::value.

Referenced by SV_Init().

◆ SV_AreaStats_f()

static void SV_AreaStats_f ( cmd_state_t * cmd)
static

Definition at line 444 of file sv_main.c.

445{
446 World_PrintAreaStats(&sv.world, "server");
447}
world_t world
collision culling data
Definition server.h:106
server_t sv
local server
Definition sv_main.c:223
void World_PrintAreaStats(world_t *world, const char *worldname)
Definition world.c:104

References sv, server_t::world, and World_PrintAreaStats().

Referenced by SV_Init().

◆ SV_CheckRequiredFuncs()

static void SV_CheckRequiredFuncs ( prvm_prog_t * prog,
const char * filename )
static

Definition at line 273 of file sv_main.c.

274{
275 // no required funcs?!
276}

Referenced by SV_VM_Setup().

◆ SV_CheckTimeouts()

static void SV_CheckTimeouts ( void )
static

Definition at line 2504 of file sv_main.c.

2505{
2506 int i;
2507
2508 // never timeout loopback connections
2509 for (i = (host_isclient.integer ? 1 : 0), host_client = &svs.clients[i]; i < svs.maxclients; i++, host_client++)
2511 SV_DropClient(false, "Timed out");
2512}
host_static_t host
Definition host.c:41
cvar_t host_isclient
Definition host.c:61
netconn_t * netconnection
communications handle
Definition server.h:210
int integer
Definition cvar.h:73
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
Definition host.h:46
double timeout
Definition netconn.h:153
struct client_s * clients
client slots
Definition server.h:30
int maxclients
number of svs.clients slots (updated by maxplayers command)
Definition server.h:28
void SV_DropClient(qbool leaving, const char *fmt,...)
Definition sv_main.c:1018
server_static_t svs
persistant server info
Definition sv_main.c:224

References server_static_t::clients, host, host_client, host_isclient, i, cvar_t::integer, server_static_t::maxclients, client_t::netconnection, host_static_t::realtime, SV_DropClient(), svs, and netconn_t::timeout.

Referenced by SV_Frame(), and SV_ThreadFunc().

◆ SV_ConnectClient()

void SV_ConnectClient ( int clientnum,
netconn_t * netconnection )

Definition at line 936 of file sv_main.c.

937{
938 prvm_prog_t *prog = SVVM_prog;
939 client_t *client;
940 int i;
941
942 client = svs.clients + clientnum;
943
944// set up the client_t
945 if (sv.loadgame)
946 {
947 float backupparms[NUM_SPAWN_PARMS];
948 memcpy(backupparms, client->spawn_parms, sizeof(backupparms));
949 memset(client, 0, sizeof(*client));
950 memcpy(client->spawn_parms, backupparms, sizeof(backupparms));
951 }
952 else
953 memset(client, 0, sizeof(*client));
954 client->active = true;
955 client->netconnection = netconnection;
956
957 Con_DPrintf("Client %s connected\n", client->netconnection ? client->netconnection->address : "botclient");
958
959 if(client->netconnection && client->netconnection->crypto.authenticated)
960 {
961 Con_Printf("%s connection to %s has been established: client is %s@%s%.*s, I am %.*s@%s%.*s\n",
962 client->netconnection->crypto.use_aes ? "Encrypted" : "Authenticated",
963 client->netconnection->address,
964 client->netconnection->crypto.client_idfp[0] ? client->netconnection->crypto.client_idfp : "-",
965 (client->netconnection->crypto.client_issigned || !client->netconnection->crypto.client_keyfp[0]) ? "" : "~",
968 (client->netconnection->crypto.server_issigned || !client->netconnection->crypto.server_keyfp[0]) ? "" : "~",
970 );
971 }
972
973 dp_strlcpy(client->name, "unconnected", sizeof(client->name));
974 dp_strlcpy(client->old_name, "unconnected", sizeof(client->old_name));
975 client->prespawned = false;
976 client->spawned = false;
977 client->begun = false;
978 client->edict = PRVM_EDICT_NUM(clientnum+1);
979 if (client->netconnection)
980 client->netconnection->message.allowoverflow = true; // we can catch it
981 // prepare the unreliable message buffer
982 client->unreliablemsg.data = client->unreliablemsg_data;
983 client->unreliablemsg.maxsize = sizeof(client->unreliablemsg_data);
984 // updated by receiving "rate" command from client, this is also the default if not using a DP client
985 client->rate = 1000000000;
986 client->connecttime = host.realtime;
987
988 if (!sv.loadgame)
989 {
990 // call the progs to get default spawn parms for the new client
991 // set self to world to intentionally cause errors with broken SetNewParms code in some mods
994 prog->ExecuteProgram(prog, PRVM_serverfunction(SetNewParms), "QC function SetNewParms is missing");
995 for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
997
998 // set up the entity for this client (including .colormap, .team, etc)
999 PRVM_ED_ClearEdict(prog, client->edict);
1000 }
1001
1002 // don't call SendServerinfo for a fresh botclient because its fields have
1003 // not been set up by the qc yet
1004 if (client->netconnection)
1005 SV_SendServerinfo (client);
1006 else
1007 client->prespawned = client->spawned = client->begun = true;
1008}
#define dp_strlcpy(dst, src, dsize)
Definition common.h:303
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
Definition console.c:1544
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
Definition console.c:1514
int crypto_keyfp_recommended_length
Definition crypto.c:41
entity self
float time
float parm1
Definition progsdefs.qc:45
void PRVM_ED_ClearEdict(prvm_prog_t *prog, prvm_edict_t *e)
Definition prvm_edict.c:210
#define PRVM_serverglobaledict(fieldname)
Definition progsvm.h:180
#define PRVM_EDICT_NUM(n)
Definition progsvm.h:867
#define PRVM_serverglobalfloat(fieldname)
Definition progsvm.h:177
#define PRVM_serverfunction(funcname)
Definition progsvm.h:182
#define SVVM_prog
Definition progsvm.h:766
#define NUM_SPAWN_PARMS
Definition server.h:180
qbool active
false = empty client slot
Definition server.h:185
qbool begun
false = don't send datagrams
Definition server.h:193
prvm_vec_t spawn_parms[NUM_SPAWN_PARMS]
spawn parms are carried from level to level
Definition server.h:232
int rate
requested rate in bytes per second
Definition server.h:198
char old_name[MAX_SCOREBOARDNAME]
Definition server.h:235
qbool prespawned
false = don't allow spawn
Definition server.h:189
char name[MAX_SCOREBOARDNAME]
Definition server.h:235
sizebuf_t unreliablemsg
Definition server.h:281
unsigned char unreliablemsg_data[NET_MAXMESSAGE]
Definition server.h:280
qbool spawned
false = don't allow begin
Definition server.h:191
prvm_edict_t * edict
PRVM_EDICT_NUM(clientnum+1)
Definition server.h:221
double connecttime
realtime this client connected
Definition server.h:204
char server_keyfp[FP64_SIZE+1]
Definition crypto.h:48
qbool server_issigned
Definition crypto.h:49
char client_idfp[FP64_SIZE+1]
Definition crypto.h:44
char client_keyfp[FP64_SIZE+1]
Definition crypto.h:45
qbool authenticated
Definition crypto.h:50
qbool client_issigned
Definition crypto.h:46
char server_idfp[FP64_SIZE+1]
Definition crypto.h:47
qbool use_aes
Definition crypto.h:51
sizebuf_t message
writing buffer to send to peer as the next reliable message can be added to at any time,...
Definition netconn.h:161
char address[128]
Definition netconn.h:231
crypto_t crypto
Definition netconn.h:232
void(* ExecuteProgram)(struct prvm_prog_s *prog, func_t fnum, const char *errormessage)
pointer to one of the *VM_ExecuteProgram functions
Definition progsvm.h:749
double time
Definition server.h:76
qbool loadgame
handle connections specially
Definition server.h:71
unsigned char * data
Definition common.h:52
qbool allowoverflow
if false, do a Sys_Error
Definition common.h:50
int maxsize
Definition common.h:53
void SV_SendServerinfo(client_t *client)
Definition sv_main.c:749

References client_t::active, netconn_t::address, sizebuf_t::allowoverflow, crypto_t::authenticated, client_t::begun, crypto_t::client_idfp, crypto_t::client_issigned, crypto_t::client_keyfp, server_static_t::clients, Con_DPrintf(), Con_Printf(), client_t::connecttime, netconn_t::crypto, crypto_keyfp_recommended_length, sizebuf_t::data, dp_strlcpy, client_t::edict, prvm_prog_t::ExecuteProgram, host, i, server_t::loadgame, sizebuf_t::maxsize, netconn_t::message, client_t::name, client_t::netconnection, NUM_SPAWN_PARMS, client_t::old_name, parm1, client_t::prespawned, PRVM_ED_ClearEdict(), PRVM_EDICT_NUM, PRVM_serverfunction, PRVM_serverglobaledict, PRVM_serverglobalfloat, client_t::rate, host_static_t::realtime, self, crypto_t::server_idfp, crypto_t::server_issigned, crypto_t::server_keyfp, client_t::spawn_parms, client_t::spawned, sv, SV_SendServerinfo(), svs, SVVM_prog, server_t::time, time, client_t::unreliablemsg, client_t::unreliablemsg_data, and crypto_t::use_aes.

Referenced by NetConn_ServerParsePacket(), and VM_SV_spawnclient().

◆ SV_CreateBaseline()

static void SV_CreateBaseline ( void )
static

Definition at line 1628 of file sv_main.c.

1629{
1630 prvm_prog_t *prog = SVVM_prog;
1631 int i, entnum, large;
1632 prvm_edict_t *svent;
1633
1634 // LadyHavoc: clear *all* baselines (not just active ones)
1635 for (entnum = 0;entnum < prog->max_edicts;entnum++)
1636 {
1637 // get the current server version
1638 svent = PRVM_EDICT_NUM(entnum);
1639
1640 // LadyHavoc: always clear state values, whether the entity is in use or not
1641 svent->priv.server->baseline = defaultstate;
1642
1643 if (svent->free)
1644 continue;
1646 continue;
1647
1648 // create entity baseline
1649 VectorCopy (PRVM_serveredictvector(svent, origin), svent->priv.server->baseline.origin);
1650 VectorCopy (PRVM_serveredictvector(svent, angles), svent->priv.server->baseline.angles);
1651 svent->priv.server->baseline.frame = (int)PRVM_serveredictfloat(svent, frame);
1652 svent->priv.server->baseline.skin = (int)PRVM_serveredictfloat(svent, skin);
1653 if (entnum > 0 && entnum <= svs.maxclients)
1654 {
1655 svent->priv.server->baseline.colormap = entnum;
1656 svent->priv.server->baseline.modelindex = SV_ModelIndex("progs/player.mdl", 1);
1657 }
1658 else
1659 {
1660 svent->priv.server->baseline.colormap = 0;
1661 svent->priv.server->baseline.modelindex = (int)PRVM_serveredictfloat(svent, modelindex);
1662 }
1663
1664 large = false;
1665 if (svent->priv.server->baseline.modelindex & 0xFF00 || svent->priv.server->baseline.frame & 0xFF00)
1666 {
1667 large = true;
1669 large = false;
1670 }
1671
1672 // add to the message
1673 if (large)
1675 else
1678
1679 if (large)
1680 {
1681 MSG_WriteShort (&sv.signon, svent->priv.server->baseline.modelindex);
1682 MSG_WriteShort (&sv.signon, svent->priv.server->baseline.frame);
1683 }
1685 {
1686 MSG_WriteShort (&sv.signon, svent->priv.server->baseline.modelindex);
1687 MSG_WriteByte (&sv.signon, svent->priv.server->baseline.frame);
1688 }
1689 else
1690 {
1691 MSG_WriteByte (&sv.signon, svent->priv.server->baseline.modelindex);
1692 MSG_WriteByte (&sv.signon, svent->priv.server->baseline.frame);
1693 }
1694 MSG_WriteByte (&sv.signon, svent->priv.server->baseline.colormap);
1695 MSG_WriteByte (&sv.signon, svent->priv.server->baseline.skin);
1696 for (i=0 ; i<3 ; i++)
1697 {
1698 MSG_WriteCoord(&sv.signon, svent->priv.server->baseline.origin[i], sv.protocol);
1699 MSG_WriteAngle(&sv.signon, svent->priv.server->baseline.angles[i], sv.protocol);
1700 }
1701 }
1702}
void MSG_WriteShort(sizebuf_t *sb, int c)
Definition com_msg.c:138
void MSG_WriteCoord(sizebuf_t *sb, float f, protocolversion_t protocol)
Definition com_msg.c:202
void MSG_WriteByte(sizebuf_t *sb, int c)
Definition com_msg.c:130
void MSG_WriteAngle(sizebuf_t *sb, float f, protocolversion_t protocol)
Definition com_msg.c:237
@ PROTOCOL_NEHAHRABJP2
same as NEHAHRABJP but with 16bit soundindex
Definition common.h:147
@ PROTOCOL_NEHAHRABJP
same as QUAKEDP but with 16bit modelindex
Definition common.h:146
@ PROTOCOL_NEHAHRABJP3
same as NEHAHRABJP2 but with some changes
Definition common.h:148
float modelindex
float skin
vector angles
float entnum
vector origin
float frame
static int(ZEXPORT *qz_inflate)(z_stream *strm
#define VectorCopy(in, out)
Definition mathlib.h:101
#define PRVM_serveredictvector(ed, fieldname)
Definition progsvm.h:173
#define PRVM_serveredictfloat(ed, fieldname)
Definition progsvm.h:172
entity_state_t defaultstate
Definition protocol.c:4
#define svc_spawnbaseline2
Definition protocol.h:275
#define svc_spawnbaseline
Definition protocol.h:242
qbool free
true if this edict is unused
Definition progsvm.h:93
union prvm_edict_t::@29 priv
struct edict_engineprivate_s * server
FIXME: this server pointer really means world, not server (it is used by both server qc and client qc...
Definition progsvm.h:106
int max_edicts
number of edicts for which space has been (should be) allocated
Definition progsvm.h:673
sizebuf_t signon
Definition server.h:133
protocolversion_t protocol
one of the PROTOCOL_ values
Definition server.h:74
int SV_ModelIndex(const char *s, int precachemode)
Definition sv_main.c:1411

References angles, defaultstate, entnum, frame, prvm_edict_t::free, i, int(), prvm_prog_t::max_edicts, server_static_t::maxclients, modelindex, MSG_WriteAngle(), MSG_WriteByte(), MSG_WriteCoord(), MSG_WriteShort(), origin, prvm_edict_t::priv, server_t::protocol, PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PRVM_EDICT_NUM, PRVM_serveredictfloat, PRVM_serveredictvector, prvm_edict_t::server, server_t::signon, skin, sv, SV_ModelIndex(), svc_spawnbaseline, svc_spawnbaseline2, svs, SVVM_prog, and VectorCopy.

Referenced by SV_SpawnServer().

◆ SV_Download_f()

static void SV_Download_f ( cmd_state_t * cmd)
static

Definition at line 1209 of file sv_main.c.

1210{
1211 const char *whichpack, *whichpack2, *extension;
1212 qbool is_csqc; // so we need to check only once
1213
1214 if (Cmd_Argc(cmd) < 2)
1215 {
1216 SV_ClientPrintf("usage: download <filename> {<extensions>}*\n");
1217 SV_ClientPrintf(" supported extensions: deflate\n");
1218 return;
1219 }
1220
1221 if (FS_CheckNastyPath(Cmd_Argv(cmd, 1), false))
1222 {
1223 SV_ClientPrintf("Download rejected: nasty filename \"%s\"\n", Cmd_Argv(cmd, 1));
1224 return;
1225 }
1226
1228 {
1229 // at this point we'll assume the previous download should be aborted
1230 Con_DPrintf("Download of %s aborted by %s starting a new download\n", host_client->download_name, host_client->name);
1231 SV_ClientCommands("\nstopdownload\n");
1232
1233 // close the file and reset variables
1236 host_client->download_name[0] = 0;
1239 }
1240
1241 is_csqc = (sv.csqc_progname[0] && strcmp(Cmd_Argv(cmd, 1), sv.csqc_progname) == 0);
1242
1243 if (!sv_allowdownloads.integer && !is_csqc)
1244 {
1245 SV_ClientPrintf("Downloads are disabled on this server\n");
1246 SV_ClientCommands("\nstopdownload\n");
1247 return;
1248 }
1249
1251
1254
1255 // host_client is asking to download a specified file
1257 Con_DPrintf("Download request for %s by %s\n", host_client->download_name, host_client->name);
1258
1259 if(is_csqc)
1260 {
1261 char extensions[MAX_QPATH]; // make sure this can hold all extensions
1262 extensions[0] = '\0';
1263
1265 dp_strlcat(extensions, " deflate", sizeof(extensions));
1266
1267 Con_DPrintf("Downloading %s to %s\n", host_client->download_name, host_client->name);
1268
1271 else
1273
1274 // no, no space is needed between %s and %s :P
1275 SV_ClientCommands("\ncl_downloadbegin %i %s%s\n", (int)FS_FileSize(host_client->download_file), host_client->download_name, extensions);
1276
1279 host_client->sendsignon = true; // make sure this message is sent
1280 return;
1281 }
1282
1284 {
1285 SV_ClientPrintf("Download rejected: server does not have the file \"%s\"\nYou may need to separately download or purchase the data archives for this game/mod to get this file\n", host_client->download_name);
1286 SV_ClientCommands("\nstopdownload\n");
1287 return;
1288 }
1289
1290 // check if the user is trying to download part of registered Quake(r)
1292 whichpack2 = FS_WhichPack("gfx/pop.lmp");
1293 if ((whichpack && whichpack2 && !strcasecmp(whichpack, whichpack2)) || FS_IsRegisteredQuakePack(host_client->download_name))
1294 {
1295 SV_ClientPrintf("Download rejected: file \"%s\" is part of registered Quake(r)\nYou must purchase Quake(r) from id Software or a retailer to get this file\nPlease go to http://www.idsoftware.com/games/quake/quake/index.php?game_section=buy\n", host_client->download_name);
1296 SV_ClientCommands("\nstopdownload\n");
1297 return;
1298 }
1299
1300 // check if the server has forbidden archive downloads entirely
1302 {
1304 if (whichpack)
1305 {
1306 SV_ClientPrintf("Download rejected: file \"%s\" is in an archive (\"%s\")\nYou must separately download or purchase the data archives for this game/mod to get this file\n", host_client->download_name, whichpack);
1307 SV_ClientCommands("\nstopdownload\n");
1308 return;
1309 }
1310 }
1311
1313 {
1314 if (!strcasecmp(extension, "cfg"))
1315 {
1316 SV_ClientPrintf("Download rejected: file \"%s\" is a .cfg file which is forbidden for security reasons\nYou must separately download or purchase the data archives for this game/mod to get this file\n", host_client->download_name);
1317 SV_ClientCommands("\nstopdownload\n");
1318 return;
1319 }
1320 }
1321
1323 {
1324 if (!strncasecmp(host_client->download_name, "dlcache/", 8))
1325 {
1326 SV_ClientPrintf("Download rejected: file \"%s\" is in the dlcache/ directory which is forbidden for security reasons\nYou must separately download or purchase the data archives for this game/mod to get this file\n", host_client->download_name);
1327 SV_ClientCommands("\nstopdownload\n");
1328 return;
1329 }
1330 }
1331
1333 {
1334 if (!strcasecmp(extension, "pak") || !strcasecmp(extension, "pk3") || !strcasecmp(extension, "dpk"))
1335 {
1336 SV_ClientPrintf("Download rejected: file \"%s\" is an archive\nYou must separately download or purchase the data archives for this game/mod to get this file\n", host_client->download_name);
1337 SV_ClientCommands("\nstopdownload\n");
1338 return;
1339 }
1340 }
1341
1344 {
1345 SV_ClientPrintf("Download rejected: server could not open the file \"%s\"\n", host_client->download_name);
1346 SV_ClientCommands("\nstopdownload\n");
1347 return;
1348 }
1349
1351 {
1352 SV_ClientPrintf("Download rejected: file \"%s\" is very large\n", host_client->download_name);
1353 SV_ClientCommands("\nstopdownload\n");
1356 return;
1357 }
1358
1360 {
1361 SV_ClientPrintf("Download rejected: file \"%s\" is not a regular file\n", host_client->download_name);
1362 SV_ClientCommands("\nstopdownload\n");
1365 return;
1366 }
1367
1368 Con_DPrintf("Downloading %s to %s\n", host_client->download_name, host_client->name);
1369
1370 /*
1371 * we can only do this if we would actually deflate on the fly
1372 * which we do not (yet)!
1373 {
1374 char extensions[MAX_QPATH]; // make sure this can hold all extensions
1375 extensions[0] = '\0';
1376
1377 if(host_client->download_deflate)
1378 strlcat(extensions, " deflate", sizeof(extensions));
1379
1380 // no, no space is needed between %s and %s :P
1381 SV_ClientCommands("\ncl_downloadbegin %i %s%s\n", (int)FS_FileSize(host_client->download_file), host_client->download_name, extensions);
1382 }
1383 */
1384 SV_ClientCommands("\ncl_downloadbegin %i %s\n", (int)FS_FileSize(host_client->download_file), host_client->download_name);
1385
1388 host_client->sendsignon = true; // make sure this message is sent
1389
1390 // the rest of the download process is handled in SV_SendClientDatagram
1391 // and other code dealing with svc_downloaddata and clc_ackdownloaddata
1392 //
1393 // no svc_downloaddata messages will be sent until sv_startdownload is
1394 // sent by the client
1395}
#define dp_strlcat(dst, src, dsize)
Definition common.h:304
const char * FS_FileExtension(const char *in)
Definition fs.c:1403
qfile_t * FS_OpenVirtualFile(const char *filepath, qbool quiet)
Definition fs.c:2928
fs_offset_t FS_FileSize(qfile_t *file)
Definition fs.c:3474
int FS_Close(qfile_t *file)
Definition fs.c:2970
const char * FS_WhichPack(const char *filename)
Definition fs.c:4091
int FS_CheckNastyPath(const char *path, qbool isgamedir)
Definition fs.c:2618
const char * FS_FileExists(const char *filename)
Look for a file in the packages and in the filesystem Returns its canonical name (same case as used i...
Definition fs.c:3693
qfile_t * FS_FileFromData(const unsigned char *data, const size_t size, qbool quiet)
Definition fs.c:2951
qbool FS_IsRegisteredQuakePack(const char *name)
Definition fs.c:4112
cvar_t developer_extra
Definition host.c:49
#define MAX_QPATH
max length of a quake game pathname
Definition qdefs.h:169
#define NULL
Definition qtypes.h:12
bool qbool
Definition qtypes.h:9
void SV_ClientCommands(const char *fmt,...) DP_FUNC_PRINTF(1)
Definition sv_send.c:135
void SV_ClientPrintf(const char *fmt,...) DP_FUNC_PRINTF(1)
Definition sv_send.c:72
char download_name[MAX_QPATH]
Definition server.h:289
int sendsignon
1 = send svc_serverinfo and advance to 2, 2 doesn't send, then advances to 0 (allowing unlimited send...
Definition server.h:195
qfile_t * download_file
Definition server.h:286
int download_expectedposition
next position the client should ack
Definition server.h:287
qbool download_started
Definition server.h:288
unsigned char * csqc_progdata_deflated
Definition server.h:41
unsigned char * csqc_progdata
Definition server.h:39
size_t csqc_progsize_deflated
Definition server.h:40
int csqc_progsize
Definition server.h:102
char csqc_progname[MAX_QPATH]
Definition server.h:103
cvar_t sv_allowdownloads_archive
Definition sv_main.c:70
cvar_t sv_allowdownloads_dlcache
Definition sv_main.c:72
cvar_t sv_allowdownloads_config
Definition sv_main.c:71
static void Download_CheckExtensions(cmd_state_t *cmd)
Definition sv_main.c:1191
cvar_t sv_allowdownloads_inarchive
Definition sv_main.c:73
cvar_t sv_allowdownloads
Definition sv_main.c:69

References cmd(), Cmd_Argc(), Cmd_Argv(), Con_DPrintf(), server_static_t::csqc_progdata, server_static_t::csqc_progdata_deflated, server_t::csqc_progname, server_t::csqc_progsize, server_static_t::csqc_progsize_deflated, developer_extra, Download_CheckExtensions(), client_t::download_deflate, client_t::download_expectedposition, client_t::download_file, client_t::download_name, client_t::download_started, dp_strlcat, dp_strlcpy, FS_CheckNastyPath(), FS_Close(), FS_FileExists(), FS_FileExtension(), FS_FileFromData(), FS_FileSize(), FS_IsRegisteredQuakePack(), FS_OpenVirtualFile(), FS_WhichPack(), host_client, cvar_t::integer, MAX_QPATH, client_t::name, NULL, client_t::sendsignon, sv, sv_allowdownloads, sv_allowdownloads_archive, sv_allowdownloads_config, sv_allowdownloads_dlcache, sv_allowdownloads_inarchive, SV_ClientCommands(), SV_ClientPrintf(), and svs.

Referenced by SV_Init().

◆ SV_DropClient()

void SV_DropClient ( qbool leaving,
const char * fmt,
... )

Definition at line 1018 of file sv_main.c.

1019{
1020 prvm_prog_t *prog = SVVM_prog;
1021 int i;
1022
1023 va_list argptr;
1024 char reason[512] = "";
1025
1026 Con_Printf("Client \"%s\" dropped", host_client->name);
1027
1028 if(fmt)
1029 {
1030 va_start(argptr, fmt);
1031 dpvsnprintf(reason, sizeof(reason), fmt, argptr);
1032 va_end(argptr);
1033
1034 Con_Printf(" (%s)\n", reason);
1035 }
1036 else
1037 {
1038 Con_Printf(" \n");
1039 }
1040
1042
1043 // make sure edict is not corrupt (from a level change for example)
1045
1047 {
1048 // tell the client to be gone
1049 if (!leaving)
1050 {
1051 // LadyHavoc: no opportunity for resending, so use unreliable 3 times
1052 unsigned char bufdata[520]; // Disconnect reason string can be 512 characters
1053 sizebuf_t buf;
1054 memset(&buf, 0, sizeof(buf));
1055 buf.data = bufdata;
1056 buf.maxsize = sizeof(bufdata);
1058 if(fmt)
1059 {
1061 MSG_WriteString(&buf, reason);
1062 else
1063 SV_ClientPrintf("%s\n", reason);
1064 }
1068 }
1069 }
1070
1071 // call qc ClientDisconnect function
1072 // LadyHavoc: don't call QC if server is dead (avoids recursive
1073 // Host_Error in some mods when they run out of edicts)
1075 {
1076 // call the prog function for removing a client
1077 // this will set the body to a dead frame, among other things
1078 int saveSelf = PRVM_serverglobaledict(self);
1082 prog->ExecuteProgram(prog, PRVM_serverfunction(ClientDisconnect), "QC function ClientDisconnect is missing");
1083 PRVM_serverglobaledict(self) = saveSelf;
1084 }
1085
1087 {
1088 // break the net connection
1091
1092 if(fmt)
1093 SV_BroadcastPrintf("\003^3%s left the game (%s)\n", host_client->name, reason);
1094 else
1095 SV_BroadcastPrintf("\003^3%s left the game\n", host_client->name);
1096 }
1097
1098 // if a download is active, close it
1100 {
1101 Con_DPrintf("Download of %s aborted when %s dropped\n", host_client->download_name, host_client->name);
1104 host_client->download_name[0] = 0;
1107 }
1108
1109 // remove leaving player from scoreboard
1110 host_client->name[0] = 0;
1111 host_client->colors = 0;
1112 host_client->frags = 0;
1113 // send notification to all clients
1114 // get number of client manually just to make sure we get it right...
1125
1126 // free the client now
1133
1134 if (sv.active)
1135 {
1136 // clear a fields that matter to DP_SV_CLIENTNAME and DP_SV_CLIENTCOLORS, and also frags
1138 }
1139
1140 // clear the client struct (this sets active to false)
1141 memset(host_client, 0, sizeof(*host_client));
1142
1143 // update server listing on the master because player count changed
1144 // (which the master uses for filtering empty/full servers)
1146
1147 if (sv.loadgame)
1148 {
1149 for (i = 0;i < svs.maxclients;i++)
1150 if (svs.clients[i].active && !svs.clients[i].spawned)
1151 break;
1152 if (i == svs.maxclients)
1153 {
1154 Con_Printf("Loaded game, everyone rejoined - unpausing\n");
1155 sv.paused = sv.loadgame = false; // we're basically done with loading now
1156 }
1157 }
1158}
void EntityFrame4_FreeDatabase(entityframe4_database_t *d)
Definition com_ents4.c:13
void EntityFrame_FreeDatabase(entityframe_database_t *d)
Definition com_ents.c:11
void MSG_WriteString(sizebuf_t *sb, const char *s)
Definition com_msg.c:173
int dpvsnprintf(char *buffer, size_t buffersize, const char *format, va_list args)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
Definition common.c:1010
@ PROTOCOL_DARKPLACES8
added parting messages. WIP
Definition common.h:134
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition glquake.h:657
void NetConn_Heartbeat(int priority)
Definition netconn.c:3984
void NetConn_Close(netconn_t *conn)
Definition netconn.c:1240
int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, int burstsize, qbool quakesignon_suppressreliables)
Definition netconn.c:844
#define PRVM_EDICT_TO_PROG(e)
Definition progsvm.h:875
#define svc_disconnect
Definition protocol.h:216
#define svc_updatefrags
Definition protocol.h:233
void EntityFrame5_FreeDatabase(entityframe5_database_t *d)
Definition sv_ents5.c:29
#define svc_updatecolors
Definition protocol.h:236
#define svc_updatename
Definition protocol.h:232
void SV_BroadcastPrintf(const char *fmt,...) DP_FUNC_PRINTF(1)
Definition sv_send.c:116
int colors
Definition server.h:236
entityframe_database_t * entitydatabase
Definition server.h:272
qbool clientconnectcalled
false = don't do ClientDisconnect on drop
Definition server.h:187
int frags
Definition server.h:237
entityframe5_database_t * entitydatabase5
Definition server.h:274
entityframe4_database_t * entitydatabase4
Definition server.h:273
qbool paused
Definition server.h:68
qbool active
false if only a net client
Definition server.h:66
sizebuf_t reliable_datagram
Definition server.h:130
void SV_StopDemoRecording(client_t *client)
Definition sv_demo.c:55

References server_t::active, buf, client_t::clientconnectcalled, server_static_t::clients, client_t::colors, Con_DPrintf(), Con_Printf(), client_t::download_expectedposition, client_t::download_file, client_t::download_name, client_t::download_started, dpvsnprintf(), client_t::edict, client_t::entitydatabase, client_t::entitydatabase4, client_t::entitydatabase5, EntityFrame4_FreeDatabase(), EntityFrame5_FreeDatabase(), EntityFrame_FreeDatabase(), prvm_prog_t::ExecuteProgram, client_t::frags, FS_Close(), host_client, i, server_t::loadgame, server_static_t::maxclients, MSG_WriteByte(), MSG_WriteShort(), MSG_WriteString(), client_t::name, NetConn_Close(), NetConn_Heartbeat(), NetConn_SendUnreliableMessage(), client_t::netconnection, NULL, server_t::paused, server_t::protocol, PROTOCOL_DARKPLACES8, PRVM_ED_ClearEdict(), PRVM_EDICT_NUM, PRVM_EDICT_TO_PROG, PRVM_serverfunction, PRVM_serverglobaledict, PRVM_serverglobalfloat, server_t::reliable_datagram, self, sv, SV_BroadcastPrintf(), SV_ClientPrintf(), SV_StopDemoRecording(), svc_disconnect, svc_updatecolors, svc_updatefrags, svc_updatename, svs, SVVM_prog, server_t::time, and time.

Referenced by SV_CheckTimeouts(), SV_Kick_f(), SV_ReadClientMessage(), SV_SendClientMessages(), SV_Shutdown(), Sys_Error(), and VM_SV_dropclient().

◆ SV_Frame()

double SV_Frame ( double time)

Definition at line 2527 of file sv_main.c.

2528{
2529 static double sv_timer;
2530 int i;
2531 char vabuf[1024];
2532 qbool reporting = false;
2533
2534 // reset timer after level change
2536 sv_timer = time = host.sleeptime = 0;
2537
2538 if (!svs.threaded)
2539 {
2540 prvm_prog_t *prog = SVVM_prog;
2541
2544
2546 reporting = true;
2547 // bones_was_here: intermission_running isn't declared in dpdefs, but it's used by
2548 // id1 Quake, all Quake mods (afaict), Nexuiz and Xonotic.
2549 else if (cls.state == ca_dedicated && !PRVM_serverglobalfloat(intermission_running))
2550 {
2551 // Report lag if there's players, so they know it wasn't the network or their machine
2552 for (i = 0; i < svs.maxclients; ++i)
2553 {
2554 if (svs.clients[i].begun && svs.clients[i].netconnection)
2555 {
2556 reporting = true;
2557 break;
2558 }
2559 }
2560 }
2561
2562 if(sv.perf_acc_realtime > 5)
2563 {
2566
2568 {
2573 }
2574
2575 if (sv.perf_lost > 0 && reporting)
2576 SV_BroadcastPrintf(CON_WARN "Server lag report: %s\n", SV_TimingReport(vabuf, sizeof(vabuf)));
2577
2582 }
2583
2584 /*
2585 * Receive packets on each main loop iteration, as the main loop may
2586 * be undersleeping due to select() detecting a new packet
2587 */
2588 if (sv.active)
2589 {
2592 }
2593 }
2594
2595 /*
2596 * If the accumulator hasn't become positive, don't
2597 * run the frame. Everything that happens before this
2598 * point will happen even if we're sleeping this frame.
2599 */
2600 if((sv_timer += time) < 0)
2601 return sv_timer;
2602
2603 // limit the frametime steps to no more than 100ms each
2604 if (sv_timer > 0.1)
2605 {
2606 if (!svs.threaded)
2607 sv.perf_acc_lost += (sv_timer - 0.1);
2608 sv_timer = 0.1;
2609 }
2610
2611 if (sv.active && sv_timer > 0 && !svs.threaded)
2612 {
2613 /*
2614 * Execute one or more server frames, with an upper limit on how much
2615 * execution time to spend on server frames to avoid freezing the game if
2616 * the server is overloaded. This execution time limit means the game will
2617 * slow down if the server is taking too long.
2618 */
2619 int framecount, framelimit = 1;
2620 double advancetime, aborttime = 0;
2621 float offset;
2622 prvm_prog_t *prog = SVVM_prog;
2623
2624 // run the world state
2625 // don't allow simulation to run too fast or too slow or logic glitches can occur
2626
2627 // stop running server frames if the wall time reaches this value
2628 if (sys_ticrate.value <= 0)
2629 advancetime = sv_timer;
2630 else
2631 {
2632 advancetime = sys_ticrate.value;
2633 // listen servers can run multiple server frames per client frame
2636 aborttime = Sys_DirtyTime() + 0.1;
2637 }
2638
2640 advancetime = min(advancetime, 0.1 / host_timescale.value);
2641 else
2642 advancetime = min(advancetime, 0.1);
2643
2644 if(advancetime > 0)
2645 {
2647 if (offset < 0 || offset >= 1800)
2648 offset = 0;
2649
2650 offset += sv_timer;
2654
2657 }
2658
2659 // only advance time if not paused
2660 // the game also pauses in singleplayer when menu or console is used
2661 sv.frametime = advancetime * host_timescale.value;
2664 if (sv.paused || host.paused)
2665 sv.frametime = 0;
2666
2667 for (framecount = 0; framecount < framelimit && sv_timer > 0; framecount++)
2668 {
2669 sv_timer -= advancetime;
2670
2671 // move things around and think unless paused
2672 if (sv.frametime)
2673 SV_Physics();
2674
2675 // if this server frame took too long, break out of the loop
2676 if (framelimit > 1 && Sys_DirtyTime() >= aborttime)
2677 break;
2678 }
2679
2680 if (framecount > 1 && sv_lagreporting_strict.integer && reporting)
2681 SV_BroadcastPrintf(CON_WARN "Server lag report: caught up %.1fms by running %d extra frames\n", advancetime * (framecount - 1) * 1000, framecount - 1);
2682
2683 R_TimeReport("serverphysics");
2684
2685 // send all messages to the clients
2687
2688 if (sv.paused == 1 && host.realtime > sv.pausedstart && sv.pausedstart > 0) {
2691 prog->ExecuteProgram(prog, PRVM_serverfunction(SV_PausedTic), "QC function SV_PausedTic is missing");
2692 }
2693
2694 // send an heartbeat if enough time has passed since the last one
2696 R_TimeReport("servernetwork");
2697 }
2698 else
2699 {
2700 // don't let r_speeds display jump around
2701 R_TimeReport("serverphysics");
2702 R_TimeReport("servernetwork");
2703 }
2704
2705 // if there is some time remaining from this frame, reset the timer
2706 if (sv_timer >= 0)
2707 {
2708 if (!svs.threaded)
2709 sv.perf_acc_lost += sv_timer;
2710 sv_timer = 0;
2711 }
2712
2713 return sv_timer;
2714}
client_static_t cls
Definition cl_main.c:116
@ ca_dedicated
Definition client.h:530
#define CON_WARN
Definition console.h:101
GLuint GLuint GLintptr offset
Definition glquake.h:632
#define min(A, B)
Definition mathlib.h:37
float sqrt(float f)
void NetConn_ServerFrame(void)
Definition netconn.c:3861
#define OFS_PARM0
Definition pr_comp.h:34
void R_TimeReport(const char *desc)
Definition r_stats.c:193
void SV_SendClientMessages(void)
Definition sv_send.c:1697
void SV_Physics(void)
Definition sv_phys.c:3013
cactive_t state
Definition client.h:568
double sleeptime
time spent sleeping after the last frame
Definition host.h:48
double dirtytime
the main loop wall time for this frame, equal to Sys_DirtyTime() at the start of this host frame
Definition host.h:47
unsigned int framecount
incremented every frame, never reset, >0 means Host_AbortCurrentFrame() is possible
Definition host.h:45
qbool paused
global paused state, pauses both client and server
Definition host.h:50
prvm_vec_t * fp
Definition progsvm.h:580
union prvm_prog_t::@31 globals
qbool threaded
Definition server.h:44
double pausedstart
Definition server.h:69
float perf_offset_sdev
Definition server.h:86
float perf_acc_realtime
Definition server.h:88
double frametime
Definition server.h:77
float perf_acc_offset_max
Definition server.h:93
int perf_acc_offset_samples
Definition server.h:94
float perf_acc_lost
Definition server.h:90
float perf_lost
Definition server.h:83
unsigned int spawnframe
Definition server.h:79
float perf_acc_sleeptime
Definition server.h:89
float perf_acc_offset_squared
Definition server.h:92
float perf_offset_avg
Definition server.h:84
float perf_cpuload
Definition server.h:82
float perf_acc_offset
Definition server.h:91
float perf_offset_max
Definition server.h:85
cvar_t host_framerate
Definition host.c:44
cvar_t sv_lagreporting_strict
Definition sv_main.c:169
cvar_t sv_maxphysicsframesperserverframe
Definition sv_main.c:167
cvar_t sys_ticrate
Definition sv_main.c:166
const char * SV_TimingReport(char *buf, size_t buflen)
for output in SV_Status_f
Definition sv_main.c:2521
static void SV_CheckTimeouts(void)
Definition sv_main.c:2504
cvar_t host_timescale
Definition sv_main.c:53
cvar_t sv_lagreporting_always
Definition sv_main.c:168
double Sys_DirtyTime(void)
Definition sys_shared.c:417

References server_t::active, ca_dedicated, server_static_t::clients, cls, CON_WARN, host_static_t::dirtytime, prvm_prog_t::ExecuteProgram, prvm_prog_t::fp, host_static_t::framecount, server_t::frametime, prvm_prog_t::globals, host, host_framerate, host_timescale, i, cvar_t::integer, server_static_t::maxclients, min, NetConn_Heartbeat(), NetConn_ServerFrame(), offset, OFS_PARM0, host_static_t::paused, server_t::paused, server_t::pausedstart, server_t::perf_acc_lost, server_t::perf_acc_offset, server_t::perf_acc_offset_max, server_t::perf_acc_offset_samples, server_t::perf_acc_offset_squared, server_t::perf_acc_realtime, server_t::perf_acc_sleeptime, server_t::perf_cpuload, server_t::perf_lost, server_t::perf_offset_avg, server_t::perf_offset_max, server_t::perf_offset_sdev, PRVM_serverfunction, PRVM_serverglobalfloat, R_TimeReport(), host_static_t::realtime, host_static_t::sleeptime, server_t::spawnframe, sqrt(), client_static_t::state, sv, SV_BroadcastPrintf(), SV_CheckTimeouts(), sv_lagreporting_always, sv_lagreporting_strict, sv_maxphysicsframesperserverframe, SV_Physics(), SV_SendClientMessages(), SV_TimingReport(), svs, SVVM_prog, Sys_DirtyTime(), sys_ticrate, server_static_t::threaded, server_t::time, time, and cvar_t::value.

Referenced by Host_Frame().

◆ SV_GetModelByIndex()

model_t * SV_GetModelByIndex ( int modelindex)

Definition at line 1607 of file sv_main.c.

1608{
1609 return (modelindex > 0 && modelindex < MAX_MODELS) ? sv.models[modelindex] : NULL;
1610}
#define MAX_MODELS
max number of models loaded at once (including during level transitions)
Definition qdefs.h:106
struct model_s * models[MAX_MODELS]
Definition server.h:117

References MAX_MODELS, modelindex, server_t::models, NULL, and sv.

Referenced by EntityState5_WriteUpdate(), SV_GetTagIndex(), SV_GetTagMatrix(), SV_LinkEdict(), SV_MarkWriteEntityStateToClient(), SV_PrepareEntityForSending(), SV_PushMove(), VM_SV_frameduration(), VM_SV_frameforname(), VM_SV_setmodel(), VM_SV_setmodelindex(), VM_SV_skel_build(), and VM_SV_skel_create().

◆ SV_GetModelFromEdict()

◆ SV_Init()

void SV_Init ( void )

Definition at line 504 of file sv_main.c.

505{
506 // init the csqc progs cvars, since they are updated/used by the server code
507 // TODO: fix this since this is a quick hack to make some of [515]'s broken code run ;) [9/13/2006 Black]
508 extern cvar_t csqc_progname; //[515]: csqc crc check and right csprogs name according to progs.dat
509 extern cvar_t csqc_progcrc;
510 extern cvar_t csqc_progsize;
512
517
522
523 Cmd_AddCommand(CF_SHARED, "sv_saveentfile", SV_SaveEntFile_f, "save map entities to .ent file (to allow external editing)");
524 Cmd_AddCommand(CF_SHARED, "sv_areastats", SV_AreaStats_f, "prints statistics on entity culling during collision traces");
525 Cmd_AddCommand(CF_CLIENT | CF_SERVER_FROM_CLIENT, "sv_startdownload", SV_StartDownload_f, "begins sending a file to the client (network protocol use only)");
526 Cmd_AddCommand(CF_CLIENT | CF_SERVER_FROM_CLIENT, "download", SV_Download_f, "downloads a specified file from the server");
527
542 Cvar_RegisterVirtual (&host_timescale, "timescale");
639 Cvar_RegisterVirtual(&host_limitlocal, "sv_ratelimitlocalplayer");
654
660
663
666
677
678 // LadyHavoc: Nehahra uses these to pass data around cutscene demos
699 Cvar_RegisterVariable (&cutscene); // for Nehahra but useful to other mods as well
700
704
708
710
712
715
716 sv_mempool = Mem_AllocPool("server", 0, NULL);
717
720}
cvar_t csqc_progcrc
Definition cl_main.c:36
cvar_t csqc_usedemoprogs
Definition cl_main.c:38
cvar_t csqc_progsize
Definition cl_main.c:37
cvar_t csqc_progname
Definition cl_main.c:35
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
Definition cmd.c:1661
#define CF_SHARED
Definition cmd.h:67
#define CF_SERVER_FROM_CLIENT
command the client is allowed to execute on the server as a stringcmd
Definition cmd.h:51
#define CF_CLIENT
cvar/command that only the client can change/execute
Definition cmd.h:48
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
Definition cvar.c:599
void Cvar_RegisterVirtual(cvar_t *variable, const char *name)
Definition cvar.c:513
void Cvar_RegisterCallback(cvar_t *variable, void(*callback)(cvar_t *))
Definition cvar.c:495
void Cvar_Callback(cvar_t *var)
Definition cvar.c:372
cvar_t sv_netport
Definition netconn.c:156
void SV_InitOperatorCommands(void)
Definition sv_ccmds.c:1640
Definition cvar.h:66
void(* SV_Shutdown)(void)
Definition host.h:60
struct host_static_t::@12 hook
cvar_t sv_autodemo_perclient_discardable
Definition sv_main.c:213
cvar_t sv_progs
Definition sv_main.c:146
cvar_t saved2
Definition sv_main.c:179
static void SV_AreaStats_f(cmd_state_t *cmd)
Definition sv_main.c:444
static void Host_Timescale_c(cvar_t *var)
Definition sv_main.c:436
cvar_t nehx11
Definition sv_main.c:200
cvar_t sv_cullentities_stats
Definition sv_main.c:83
cvar_t sv_gameplayfix_swiminbmodels
Definition sv_main.c:126
cvar_t sv_waterfriction
Definition sv_main.c:157
cvar_t noexit
Definition sv_main.c:47
cvar_t sv_airaccel_qw
Definition sv_main.c:57
cvar_t sv_gameplayfix_nudgeoutofsolid_separation
Definition sv_main.c:118
cvar_t nehx05
Definition sv_main.c:194
cvar_t sv_rollangle
Definition sv_main.c:176
cvar_t sv_gameplayfix_delayprojectiles
Definition sv_main.c:106
cvar_t sv_gameplayfix_noairborncorpse_allowsuspendeditems
Definition sv_main.c:116
cvar_t sv_gameplayfix_droptofloorstartsolid_nudgetocorrect
Definition sv_main.c:108
cvar_t sv_gameplayfix_consistentplayerprethink
Definition sv_main.c:105
cvar_t nehx12
Definition sv_main.c:201
cvar_t deathmatch
Definition sv_main.c:44
cvar_t sv_maxairstrafespeed
Definition sv_main.c:64
cvar_t nehx00
Definition sv_main.c:189
cvar_t sv_areadebug
Definition sv_main.c:164
cvar_t sv_random_seed
Definition sv_main.c:149
cvar_t scratch3
Definition sv_main.c:185
cvar_t coop
Definition sv_main.c:43
cvar_t nehx08
Definition sv_main.c:197
cvar_t pr_checkextension
Definition sv_main.c:50
cvar_t sv_gameplayfix_easierwaterjump
Definition sv_main.c:109
cvar_t sv_airstopaccelerate
Definition sv_main.c:61
cvar_t sv_cullentities_trace_enlarge
Definition sv_main.c:87
cvar_t sv_maxairspeed
Definition sv_main.c:140
cvar_t saved4
Definition sv_main.c:181
cvar_t nehx16
Definition sv_main.c:205
cvar_t timelimit
Definition sv_main.c:173
cvar_t sv_debugmove
Definition sv_main.c:97
cvar_t gamecfg
Definition sv_main.c:46
cvar_t sv_clmovement_enable
Definition sv_main.c:77
cvar_t sv_areagrid_link_SOLID_NOT
Definition sv_main.c:74
cvar_t sv_gameplayfix_impactbeforeonground
Definition sv_main.c:113
static void SV_ServerOptions(void)
Definition sv_main.c:449
cvar_t sv_gameplayfix_unstickplayers
Definition sv_main.c:130
cvar_t nomonsters
Definition sv_main.c:48
cvar_t sv_sound_land
Definition sv_main.c:151
static void SV_Download_f(cmd_state_t *cmd)
Definition sv_main.c:1209
cvar_t sv_cullentities_pvs
Definition sv_main.c:82
cvar_t sv_gameplayfix_nudgeoutofsolid
Definition sv_main.c:117
cvar_t sv_cullentities_trace_prediction
Definition sv_main.c:90
cvar_t sv_freezenonclients
Definition sv_main.c:102
cvar_t sv_jumpvelocity
Definition sv_main.c:138
cvar_t sv_airspeedlimit_nonqw
Definition sv_main.c:62
cvar_t sv_airaccel_qw_stretchfactor
Definition sv_main.c:58
cvar_t sv_aircontrol
Definition sv_main.c:66
cvar_t sv_aim
Definition sv_main.c:56
cvar_t sv_warsowbunny_turnaccel
Definition sv_main.c:161
cvar_t sv_maxrate
Definition sv_main.c:141
cvar_t halflifebsp
Definition sv_main.c:215
cvar_t sv_gameplayfix_nogravityonground
Definition sv_main.c:120
cvar_t sv_wateraccelerate
Definition sv_main.c:156
cvar_t sv_init_frame_count
Definition sv_main.c:135
cvar_t sv_gameplayfix_findradiusdistancetobox
Definition sv_main.c:110
cvar_t sv_mapformat_is_quake2
Definition sv_main.c:216
cvar_t nehx13
Definition sv_main.c:202
cvar_t sv_jumpstep
Definition sv_main.c:137
mempool_t * sv_mempool
Definition sv_main.c:226
cvar_t sv_sendentities_csqc_randomize_order
Definition sv_main.c:221
cvar_t sv_aircontrol_penalty
Definition sv_main.c:68
cvar_t sv_wallfriction
Definition sv_main.c:155
cvar_t sv_threaded
Definition sv_main.c:170
cvar_t sv_cullentities_trace_expand
Definition sv_main.c:88
cvar_t sv_cullentities_trace_eyejitter
Definition sv_main.c:89
cvar_t sv_cullentities_nevercullbmodels
Definition sv_main.c:81
cvar_t sv_legacy_bbox_expand
Definition sv_main.c:139
cvar_t savedgamecfg
Definition sv_main.c:182
cvar_t sv_maxspeed
Definition sv_main.c:142
cvar_t nehx02
Definition sv_main.c:191
cvar_t sv_sound_watersplash
Definition sv_main.c:152
cvar_t sv_worldmessage
Definition sv_main.c:37
cvar_t nehx01
Definition sv_main.c:190
cvar_t sv_gameplayfix_noairborncorpse
Definition sv_main.c:115
cvar_t sv_airstrafeaccelerate
Definition sv_main.c:63
cvar_t sv_nostep
Definition sv_main.c:144
cvar_t sv_gameplayfix_nosquashentities
Definition sv_main.c:133
cvar_t sv_gameplayfix_gravityunaffectedbyticrate
Definition sv_main.c:111
cvar_t sv_autodemo_perclient_nameformat
Definition sv_main.c:212
cvar_t sv_gameplayfix_q2airaccelerate
Definition sv_main.c:119
cvar_t sv_aircontrol_power
Definition sv_main.c:67
cvar_t sv_qcstats
Definition sv_main.c:148
cvar_t sv_warsowbunny_airforwardaccel
Definition sv_main.c:158
cvar_t sv_areagrid_mingridsize
Definition sv_main.c:75
cvar_t sv_gameplayfix_fixedcheckwatertransition
Definition sv_main.c:132
cvar_t sv_idealpitchscale
Definition sv_main.c:136
cvar_t nehx07
Definition sv_main.c:196
cvar_t sv_rollspeed
Definition sv_main.c:175
cvar_t scratch4
Definition sv_main.c:186
cvar_t nehx04
Definition sv_main.c:193
cvar_t nehx19
Definition sv_main.c:208
cvar_t sv_gameplayfix_slidemoveprojectiles
Definition sv_main.c:122
cvar_t temp1
Definition sv_main.c:187
cvar_t pausable
Definition sv_main.c:49
cvar_t nehx17
Definition sv_main.c:206
cvar_t sv_airstrafeaccel_qw
Definition sv_main.c:65
cvar_t sv_edgefriction
Definition sv_main.c:100
cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag
Definition sv_main.c:127
cvar_t sv_stepheight
Definition sv_main.c:153
cvar_t sv_disablenotify
Definition sv_main.c:42
cvar_t host_limitlocal
Definition sv_main.c:150
cvar_t fraglimit
Definition sv_main.c:45
cvar_t sv_writepicture_quality
Definition sv_main.c:219
cvar_t nehx10
Definition sv_main.c:199
cvar_t sv_cullentities_trace_samples
Definition sv_main.c:93
cvar_t sv_worldname
Definition sv_main.c:38
cvar_t sv_gravity
Definition sv_main.c:134
cvar_t nehx18
Definition sv_main.c:207
cvar_t sv_gameplayfix_unstickentities
Definition sv_main.c:131
cvar_t sv_cullentities_trace
Definition sv_main.c:84
cvar_t sv_maxvelocity
Definition sv_main.c:143
cvar_t sv_entpatch
Definition sv_main.c:101
cvar_t sv_dedicated
Definition sv_main.c:98
cvar_t sv_gameplayfix_droptofloorstartsolid
Definition sv_main.c:107
cvar_t sv_clmovement_inputtimeout
Definition sv_main.c:80
cvar_t sv_friction
Definition sv_main.c:103
cvar_t sv_worldnamenoextension
Definition sv_main.c:39
cvar_t sv_cullentities_trace_samples_extra
Definition sv_main.c:94
cvar_t cutscene
Definition sv_main.c:209
cvar_t scratch2
Definition sv_main.c:184
cvar_t samelevel
Definition sv_main.c:51
cvar_t scratch1
Definition sv_main.c:183
cvar_t nehx09
Definition sv_main.c:198
static void SV_SaveEntFile_f(cmd_state_t *cmd)
Definition sv_main.c:722
cvar_t sv_checkforpacketsduringsleep
Definition sv_main.c:76
cvar_t nehx06
Definition sv_main.c:195
cvar_t sv_clmovement_minping
Definition sv_main.c:78
cvar_t sv_protocolname
Definition sv_main.c:147
cvar_t sv_mapformat_is_quake3
Definition sv_main.c:217
cvar_t nehx14
Definition sv_main.c:203
cvar_t sv_gameplayfix_downtracesupportsongroundflag
Definition sv_main.c:128
void SV_Shutdown(void)
Definition sv_main.c:2128
cvar_t sv_gameplayfix_q1bsptracelinereportstexture
Definition sv_main.c:129
cvar_t sv_stopspeed
Definition sv_main.c:154
cvar_t sv_warsowbunny_accel
Definition sv_main.c:159
cvar_t sv_clmovement_minping_disabletime
Definition sv_main.c:79
cvar_t sv_worldbasename
Definition sv_main.c:40
cvar_t sv_airaccel_sideways_friction
Definition sv_main.c:59
cvar_t sv_cullentities_trace_entityocclusion
Definition sv_main.c:92
cvar_t sv_gameplayfix_nostepmoveonsteepslopes
Definition sv_main.c:125
cvar_t skill
Definition sv_main.c:52
cvar_t sv_airaccelerate
Definition sv_main.c:60
cvar_t nehx03
Definition sv_main.c:192
cvar_t sv_warsowbunny_backtosideratio
Definition sv_main.c:162
cvar_t sv_accelerate
Definition sv_main.c:55
cvar_t sv_gameplayfix_stepmultipletimes
Definition sv_main.c:124
cvar_t sv_autodemo_perclient
Definition sv_main.c:211
cvar_t saved1
Definition sv_main.c:178
static void SV_StartDownload_f(cmd_state_t *cmd)
Definition sv_main.c:1160
cvar_t sv_cullentities_trace_delay
Definition sv_main.c:85
cvar_t sv_playerphysicsqc
Definition sv_main.c:145
cvar_t sv_cullentities_trace_delay_players
Definition sv_main.c:86
cvar_t sv_cullentities_trace_samples_players
Definition sv_main.c:95
cvar_t sv_cullentities_trace_prediction_time
Definition sv_main.c:91
cvar_t sv_cullentities_trace_spectators
Definition sv_main.c:96
cvar_t sv_onlycsqcnetworking
Definition sv_main.c:163
cvar_t sv_warsowbunny_topspeed
Definition sv_main.c:160
cvar_t sv_gameplayfix_blowupfallenzombies
Definition sv_main.c:104
cvar_t teamplay
Definition sv_main.c:172
cvar_t sv_gameplayfix_grenadebouncedownslopes
Definition sv_main.c:112
cvar_t sv_gameplayfix_setmodelrealbox
Definition sv_main.c:121
cvar_t saved3
Definition sv_main.c:180
cvar_t sv_echobprint
Definition sv_main.c:99
cvar_t sv_gameplayfix_stepdown
Definition sv_main.c:123
cvar_t sv_gameplayfix_multiplethinksperframe
Definition sv_main.c:114
cvar_t nehx15
Definition sv_main.c:204
#define Mem_AllocPool(name, flags, parent)
Definition zone.h:104

References CF_CLIENT, CF_SERVER_FROM_CLIENT, CF_SHARED, Cmd_AddCommand(), coop, csqc_progcrc, csqc_progname, csqc_progsize, csqc_usedemoprogs, cutscene, Cvar_Callback(), Cvar_RegisterCallback(), Cvar_RegisterVariable(), Cvar_RegisterVirtual(), deathmatch, fraglimit, gamecfg, halflifebsp, host_static_t::hook, host, host_limitlocal, host_timescale, Host_Timescale_c(), Mem_AllocPool, nehx00, nehx01, nehx02, nehx03, nehx04, nehx05, nehx06, nehx07, nehx08, nehx09, nehx10, nehx11, nehx12, nehx13, nehx14, nehx15, nehx16, nehx17, nehx18, nehx19, noexit, nomonsters, NULL, pausable, pr_checkextension, samelevel, saved1, saved2, saved3, saved4, savedgamecfg, scratch1, scratch2, scratch3, scratch4, skill, sv_accelerate, sv_aim, sv_airaccel_qw, sv_airaccel_qw_stretchfactor, sv_airaccel_sideways_friction, sv_airaccelerate, sv_aircontrol, sv_aircontrol_penalty, sv_aircontrol_power, sv_airspeedlimit_nonqw, sv_airstopaccelerate, sv_airstrafeaccel_qw, sv_airstrafeaccelerate, sv_allowdownloads, sv_allowdownloads_archive, sv_allowdownloads_config, sv_allowdownloads_dlcache, sv_allowdownloads_inarchive, sv_areadebug, sv_areagrid_link_SOLID_NOT, sv_areagrid_mingridsize, SV_AreaStats_f(), sv_autodemo_perclient, sv_autodemo_perclient_discardable, sv_autodemo_perclient_nameformat, sv_checkforpacketsduringsleep, sv_clmovement_enable, sv_clmovement_inputtimeout, sv_clmovement_minping, sv_clmovement_minping_disabletime, sv_cullentities_nevercullbmodels, sv_cullentities_pvs, sv_cullentities_stats, sv_cullentities_trace, sv_cullentities_trace_delay, sv_cullentities_trace_delay_players, sv_cullentities_trace_enlarge, sv_cullentities_trace_entityocclusion, sv_cullentities_trace_expand, sv_cullentities_trace_eyejitter, sv_cullentities_trace_prediction, sv_cullentities_trace_prediction_time, sv_cullentities_trace_samples, sv_cullentities_trace_samples_extra, sv_cullentities_trace_samples_players, sv_cullentities_trace_spectators, sv_debugmove, sv_dedicated, sv_disablenotify, SV_Download_f(), sv_echobprint, sv_edgefriction, sv_entpatch, sv_freezenonclients, sv_friction, sv_gameplayfix_blowupfallenzombies, sv_gameplayfix_consistentplayerprethink, sv_gameplayfix_delayprojectiles, sv_gameplayfix_downtracesupportsongroundflag, sv_gameplayfix_droptofloorstartsolid, sv_gameplayfix_droptofloorstartsolid_nudgetocorrect, sv_gameplayfix_easierwaterjump, sv_gameplayfix_findradiusdistancetobox, sv_gameplayfix_fixedcheckwatertransition, sv_gameplayfix_gravityunaffectedbyticrate, sv_gameplayfix_grenadebouncedownslopes, sv_gameplayfix_impactbeforeonground, sv_gameplayfix_multiplethinksperframe, sv_gameplayfix_noairborncorpse, sv_gameplayfix_noairborncorpse_allowsuspendeditems, sv_gameplayfix_nogravityonground, sv_gameplayfix_nosquashentities, sv_gameplayfix_nostepmoveonsteepslopes, sv_gameplayfix_nudgeoutofsolid, sv_gameplayfix_nudgeoutofsolid_separation, sv_gameplayfix_q1bsptracelinereportstexture, sv_gameplayfix_q2airaccelerate, sv_gameplayfix_setmodelrealbox, sv_gameplayfix_slidemoveprojectiles, sv_gameplayfix_stepdown, sv_gameplayfix_stepmultipletimes, sv_gameplayfix_swiminbmodels, sv_gameplayfix_unstickentities, sv_gameplayfix_unstickplayers, sv_gameplayfix_upwardvelocityclearsongroundflag, sv_gravity, sv_idealpitchscale, sv_init_frame_count, SV_InitOperatorCommands(), sv_jumpstep, sv_jumpvelocity, sv_lagreporting_always, sv_lagreporting_strict, sv_legacy_bbox_expand, sv_mapformat_is_quake2, sv_mapformat_is_quake3, sv_maxairspeed, sv_maxairstrafespeed, sv_maxphysicsframesperserverframe, sv_maxrate, sv_maxspeed, sv_maxvelocity, sv_mempool, sv_netport, sv_nostep, sv_onlycsqcnetworking, sv_playerphysicsqc, sv_progs, sv_protocolname, sv_qcstats, sv_random_seed, sv_rollangle, sv_rollspeed, SV_SaveEntFile_f(), sv_sendentities_csqc_randomize_order, SV_ServerOptions(), host_static_t::SV_Shutdown, SV_Shutdown(), sv_sound_land, sv_sound_watersplash, SV_StartDownload_f(), sv_stepheight, sv_stopspeed, sv_threaded, sv_wallfriction, sv_warsowbunny_accel, sv_warsowbunny_airforwardaccel, sv_warsowbunny_backtosideratio, sv_warsowbunny_topspeed, sv_warsowbunny_turnaccel, sv_wateraccelerate, sv_waterfriction, sv_worldbasename, sv_worldmessage, sv_worldname, sv_worldnamenoextension, sv_writepicture_quality, sys_ticrate, teamplay, temp1, and timelimit.

Referenced by Host_Init().

◆ SV_IsLocalServer()

int SV_IsLocalServer ( void )

Definition at line 1783 of file sv_main.c.

1784{
1785 return (host_isclient.integer && sv.active ? svs.maxclients : 0);
1786}

References server_t::active, host_isclient, cvar_t::integer, server_static_t::maxclients, sv, and svs.

Referenced by SV_Savegame_f().

◆ SV_ModelIndex()

int SV_ModelIndex ( const char * s,
int precachemode )

Definition at line 1411 of file sv_main.c.

1412{
1414 char filename[MAX_QPATH];
1415 if (!s || !*s)
1416 return 0;
1417 // testing
1418 //if (precachemode == 2)
1419 // return 0;
1420 dp_strlcpy(filename, s, sizeof(filename));
1421 for (i = 2;i < limit;i++)
1422 {
1423 if (!sv.model_precache[i][0])
1424 {
1425 if (precachemode)
1426 {
1428 {
1429 Con_Printf("SV_ModelIndex(\"%s\"): precache_model can only be done in spawn functions\n", filename);
1430 return 0;
1431 }
1432 if (precachemode == 1)
1433 Con_Printf("SV_ModelIndex(\"%s\"): not precached (fix your code), precaching anyway\n", filename);
1434 dp_strlcpy(sv.model_precache[i], filename, sizeof(sv.model_precache[i]));
1435 if (sv.state == ss_loading)
1436 {
1437 // running from SV_SpawnServer which is launched from the client console command interpreter
1438 sv.models[i] = Mod_ForName (sv.model_precache[i], true, false, s[0] == '*' ? sv.worldname : NULL);
1439 }
1440 else
1441 {
1442 if (svs.threaded)
1443 {
1444 // this is running on the server thread, we can't load a model here (it would crash on renderer calls), so only look it up, the svc_precache will cause it to be loaded when it reaches the client
1445 sv.models[i] = Mod_FindName (sv.model_precache[i], s[0] == '*' ? sv.worldname : NULL);
1446 }
1447 else
1448 {
1449 // running single threaded, so we can load the model here
1450 sv.models[i] = Mod_ForName (sv.model_precache[i], true, false, s[0] == '*' ? sv.worldname : NULL);
1451 }
1455 }
1456 return i;
1457 }
1458 Con_Printf("SV_ModelIndex(\"%s\"): not precached\n", filename);
1459 return 0;
1460 }
1461 if (!strcmp(sv.model_precache[i], filename))
1462 return i;
1463 }
1464 Con_Printf("SV_ModelIndex(\"%s\"): i (%i) == MAX_MODELS (%i)\n", filename, i, MAX_MODELS);
1465 return 0;
1466}
@ PROTOCOL_DARKPLACES2
various changes
Definition common.h:140
@ PROTOCOL_DARKPLACES4
various changes
Definition common.h:138
@ PROTOCOL_DARKPLACES3
uses EntityFrame4 entity snapshot encoder/decoder which is broken, this attempted to do partial snaps...
Definition common.h:139
@ PROTOCOL_DARKPLACES5
uses EntityFrame5 entity snapshot encoder/decoder which is based on a Tribes networking article at ht...
Definition common.h:137
@ PROTOCOL_QUAKEDP
darkplaces extended quake protocol (used by TomazQuake and others), backwards compatible as long as n...
Definition common.h:142
@ PROTOCOL_QUAKE
quake (aka netquake/normalquake/nq) protocol
Definition common.h:144
@ PROTOCOL_NEHAHRAMOVIE
Nehahra movie protocol, a big nasty hack dating back to early days of the Quake Standards Group (but ...
Definition common.h:143
@ PROTOCOL_DARKPLACES1
uses EntityFrame entity snapshot encoder/decoder which is a QuakeWorld-like entity snapshot delta com...
Definition common.h:141
model_t * Mod_ForName(const char *name, qbool crash, qbool checkdisk, const char *parentname)
model_t * Mod_FindName(const char *name, const char *parentname)
#define svc_precache
Definition protocol.h:274
@ ss_loading
Definition server.h:52
char model_precache[MAX_MODELS][MAX_QPATH]
Definition server.h:116
server_state_t state
some actions are only valid during load
Definition server.h:124
char worldname[MAX_QPATH]
Definition server.h:110

References Con_Printf(), dp_strlcpy, i, MAX_MODELS, MAX_QPATH, Mod_FindName(), Mod_ForName(), server_t::model_precache, server_t::models, MSG_WriteByte(), MSG_WriteShort(), MSG_WriteString(), NULL, server_t::protocol, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_DARKPLACES5, PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, server_t::reliable_datagram, ss_loading, server_t::state, sv, svc_precache, svs, server_static_t::threaded, and server_t::worldname.

Referenced by SV_CreateBaseline(), SV_WriteClientdataToMessage(), VM_SV_effect(), VM_SV_precache_model(), and VM_SV_setmodel().

◆ SV_ParticleEffectIndex()

int SV_ParticleEffectIndex ( const char * name)

Definition at line 1522 of file sv_main.c.

1523{
1524 int i, argc, linenumber, effectnameindex;
1525 int filepass;
1526 fs_offset_t filesize;
1527 unsigned char *filedata;
1528 const char *text;
1529 const char *textstart;
1530 //const char *textend;
1531 char argv[16][1024];
1532 char filename[MAX_QPATH];
1534 {
1536 memset(sv.particleeffectname, 0, sizeof(sv.particleeffectname));
1537 for (i = 0;i < EFFECT_TOTAL;i++)
1539 for (filepass = 0;;filepass++)
1540 {
1541 if (filepass == 0)
1542 dpsnprintf(filename, sizeof(filename), "effectinfo.txt");
1543 else if (filepass == 1)
1544 dpsnprintf(filename, sizeof(filename), "%s_effectinfo.txt", sv.worldnamenoextension);
1545 else
1546 break;
1547 filedata = FS_LoadFile(filename, tempmempool, true, &filesize);
1548 if (!filedata)
1549 continue;
1550 textstart = (const char *)filedata;
1551 //textend = (const char *)filedata + filesize;
1552 text = textstart;
1553 for (linenumber = 1;;linenumber++)
1554 {
1555 argc = 0;
1556 for (;;)
1557 {
1558 if (!COM_ParseToken_Simple(&text, true, false, true) || !strcmp(com_token, "\n"))
1559 break;
1560 if (argc < 16)
1561 {
1562 dp_strlcpy(argv[argc], com_token, sizeof(argv[argc]));
1563 argc++;
1564 }
1565 }
1566 if (com_token[0] == 0)
1567 break; // if the loop exited and it's not a \n, it's EOF
1568 if (argc < 1)
1569 continue;
1570 if (!strcmp(argv[0], "effect"))
1571 {
1572 if (argc == 2)
1573 {
1574 for (effectnameindex = 1;effectnameindex < MAX_PARTICLEEFFECTNAME;effectnameindex++)
1575 {
1576 if (sv.particleeffectname[effectnameindex][0])
1577 {
1578 if (!strcmp(sv.particleeffectname[effectnameindex], argv[1]))
1579 break;
1580 }
1581 else
1582 {
1583 dp_strlcpy(sv.particleeffectname[effectnameindex], argv[1], sizeof(sv.particleeffectname[effectnameindex]));
1584 break;
1585 }
1586 }
1587 // if we run out of names, abort
1588 if (effectnameindex == MAX_PARTICLEEFFECTNAME)
1589 {
1590 Con_Printf("%s:%i: too many effects!\n", filename, linenumber);
1591 break;
1592 }
1593 }
1594 }
1595 }
1596 Mem_Free(filedata);
1597 }
1598 }
1599 // search for the name
1600 for (effectnameindex = 1;effectnameindex < MAX_PARTICLEEFFECTNAME && sv.particleeffectname[effectnameindex][0];effectnameindex++)
1601 if (!strcmp(sv.particleeffectname[effectnameindex], name))
1602 return effectnameindex;
1603 // return 0 if we couldn't find it
1604 return 0;
1605}
@ EFFECT_TOTAL
char com_token[MAX_INPUTLINE]
Definition common.c:39
qbool COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments)
Definition common.c:463
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
Definition common.c:997
unsigned char * FS_LoadFile(const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
Definition fs.c:3540
int64_t fs_offset_t
Definition fs.h:37
const GLchar * name
Definition glquake.h:601
string argv(float n)
#define MAX_PARTICLEEFFECTNAME
maximum number of unique names of particle effects (for particleeffectnum)
Definition qdefs.h:135
char particleeffectname[MAX_PARTICLEEFFECTNAME][MAX_QPATH]
Definition server.h:144
char worldnamenoextension[MAX_QPATH]
Definition server.h:111
qbool particleeffectnamesloaded
Definition server.h:143
static const char * standardeffectnames[EFFECT_TOTAL]
Definition sv_main.c:232
mempool_t * tempmempool
Definition zone.c:794
#define Mem_Free(mem)
Definition zone.h:96

References argv(), COM_ParseToken_Simple(), com_token, Con_Printf(), dp_strlcpy, dpsnprintf(), EFFECT_TOTAL, FS_LoadFile(), i, MAX_PARTICLEEFFECTNAME, MAX_QPATH, Mem_Free, name, server_t::particleeffectname, server_t::particleeffectnamesloaded, standardeffectnames, sv, tempmempool, and server_t::worldnamenoextension.

Referenced by VM_SV_particleeffectnum().

◆ SV_Prepare_CSQC()

static void SV_Prepare_CSQC ( void )
static

Definition at line 1712 of file sv_main.c.

1713{
1714 fs_offset_t progsize;
1715
1716 if(svs.csqc_progdata)
1717 {
1718 Con_DPrintf("Unloading old CSQC data.\n");
1722 }
1723
1726
1727 sv.csqc_progname[0] = 0;
1729
1730 if(progsize > 0)
1731 {
1732 size_t deflated_size;
1733
1734 sv.csqc_progsize = (int)progsize;
1737 Con_DPrintf("server detected csqc progs file \"%s\" with size %i and crc %i\n", sv.csqc_progname, sv.csqc_progsize, sv.csqc_progcrc);
1738
1739 Con_DPrint("Compressing csprogs.dat\n");
1740 //unsigned char *FS_Deflate(const unsigned char *data, size_t size, size_t *deflated_size, int level, mempool_t *mempool);
1741 svs.csqc_progdata_deflated = FS_Deflate(svs.csqc_progdata, progsize, &deflated_size, -1, sv_mempool);
1742 svs.csqc_progsize_deflated = (int)deflated_size;
1744 {
1745 Con_DPrintf("Deflated: %g%%\n", 100.0 - 100.0 * (deflated_size / (float)progsize));
1746 Con_DPrintf("Uncompressed: %u\nCompressed: %u\n", (unsigned)sv.csqc_progsize, (unsigned)svs.csqc_progsize_deflated);
1747 }
1748 else
1749 Con_DPrintf("Cannot compress - need zlib for this. Using uncompressed progs only.\n");
1750 }
1751}
unsigned short CRC_Block(const unsigned char *data, size_t size)
Definition com_crc16.c:75
void Con_DPrint(const char *msg)
A Con_Print that only shows up if the "developer" cvar is set.
Definition console.c:1531
unsigned char * FS_Deflate(const unsigned char *data, size_t size, size_t *deflated_size, int level, mempool_t *mempool)
Definition fs.c:4178
const char * string
Definition cvar.h:71
int csqc_progcrc
Definition server.h:101

References Con_DPrint(), Con_DPrintf(), CRC_Block(), server_t::csqc_progcrc, server_static_t::csqc_progdata, server_static_t::csqc_progdata_deflated, csqc_progname, server_t::csqc_progname, server_t::csqc_progsize, server_static_t::csqc_progsize_deflated, dp_strlcpy, FS_Deflate(), FS_LoadFile(), int(), Mem_Free, NULL, cvar_t::string, sv, sv_mempool, and svs.

Referenced by SV_VM_Setup().

◆ SV_SaveEntFile_f()

static void SV_SaveEntFile_f ( cmd_state_t * cmd)
static

Definition at line 722 of file sv_main.c.

723{
724 char vabuf[1024];
725 if (!sv.active || !sv.worldmodel)
726 {
727 Con_Print("Not running a server\n");
728 return;
729 }
730 FS_WriteFile(va(vabuf, sizeof(vabuf), "%s.ent", sv.worldnamenoextension), sv.worldmodel->brush.entities, (fs_offset_t)strlen(sv.worldmodel->brush.entities));
731}
char * va(char *buf, size_t buflen, const char *format,...)
Definition common.c:972
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
Definition console.c:1504
qbool FS_WriteFile(const char *filename, const void *data, fs_offset_t len)
Definition fs.c:3592
float strlen(string s)
struct model_s * worldmodel
Definition server.h:112

References server_t::active, Con_Print(), FS_WriteFile(), strlen(), sv, va(), server_t::worldmodel, and server_t::worldnamenoextension.

Referenced by SV_Init().

◆ SV_SaveSpawnparms()

void SV_SaveSpawnparms ( void )

Definition at line 1761 of file sv_main.c.

1762{
1763 prvm_prog_t *prog = SVVM_prog;
1764 int i, j;
1765
1767
1768 for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
1769 {
1770 if (!host_client->active)
1771 continue;
1772
1773 // call the progs to get default spawn parms for the new client
1776 prog->ExecuteProgram(prog, PRVM_serverfunction(SetChangeParms), "QC function SetChangeParms is missing");
1777 for (j=0 ; j<NUM_SPAWN_PARMS ; j++)
1779 }
1780}
float serverflags
Definition progsdefs.qc:33
int serverflags
episode completion information
Definition server.h:32

References client_t::active, server_static_t::clients, client_t::edict, prvm_prog_t::ExecuteProgram, host_client, i, int(), server_static_t::maxclients, NUM_SPAWN_PARMS, parm1, PRVM_EDICT_TO_PROG, PRVM_serverfunction, PRVM_serverglobaledict, PRVM_serverglobalfloat, self, server_static_t::serverflags, serverflags, client_t::spawn_parms, sv, svs, SVVM_prog, server_t::time, and time.

Referenced by SV_Changelevel_f().

◆ SV_SendServerinfo()

void SV_SendServerinfo ( client_t * client)

Definition at line 749 of file sv_main.c.

750{
751 prvm_prog_t *prog = SVVM_prog;
752 int i;
753 char message[128];
754 char vabuf[1024];
755
756 // we know that this client has a netconnection and thus is not a bot
757
758 // edicts get reallocated on level changes, so we need to update it here
759 client->edict = PRVM_EDICT_NUM((client - svs.clients) + 1);
760
761 // clear cached stuff that depends on the level
762 client->weaponmodel[0] = 0;
763 client->weaponmodelindex = 0;
764
765 // LadyHavoc: clear entityframe tracking
766 client->latestframenum = 0;
767
768 // initialize the movetime, so a speedhack can't make use of the time before this client joined
769 client->cmd.time = sv.time;
770
771 if (client->entitydatabase)
773 if (client->entitydatabase4)
775 if (client->entitydatabase5)
777
778 memset(client->stats, 0, sizeof(client->stats));
779 memset(client->statsdeltabits, 0, sizeof(client->statsdeltabits));
780
782 {
785 else if (sv.protocol == PROTOCOL_DARKPLACES4)
787 else
789 }
790
791 // reset csqc entity versions
792 for (i = 0;i < prog->max_edicts;i++)
793 {
794 client->csqcentityscope[i] = 0;
795 client->csqcentitysendflags[i] = 0xFFFFFF;
796 }
797 for (i = 0;i < NUM_CSQCENTITYDB_FRAMES;i++)
798 {
799 client->csqcentityframehistory[i].num = 0;
800 client->csqcentityframehistory[i].framenum = -1;
801 }
802 client->csqcnumedicts = 0;
803 client->csqcentityframehistory_next = 0;
804
805 SZ_Clear (&client->netconnection->message);
807 dpsnprintf (message, sizeof (message), "\nServer: %s (progs %i crc)\n", engineversion, prog->filecrc);
809
810 SV_StopDemoRecording(client); // to split up demos into different files
812 {
813 char demofile[MAX_OSPATH];
814 char ipaddress[MAX_QPATH];
815 char timestring[128];
816 size_t j;
817
818 // start a new demo file
819 LHNETADDRESS_ToString(&(client->netconnection->peeraddress), ipaddress, sizeof(ipaddress), true);
820 for(j = 0; ipaddress[j]; ++j)
821 if(!isalnum(ipaddress[j]))
822 ipaddress[j] = '-';
823 Sys_TimeString(timestring, sizeof(timestring), sv_autodemo_perclient_nameformat.string);
824 dpsnprintf(demofile, sizeof(demofile), "%s_%s_%d_%s.dem", timestring,
825 sv.worldbasename, PRVM_NUM_FOR_EDICT(client->edict), ipaddress);
826
827 SV_StartDemoRecording(client, demofile, -1);
828 }
829
830 //[515]: init csprogs according to version of svprogs, check the crc, etc.
831 if (sv.csqc_progname[0])
832 {
833 Con_DPrintf("sending csqc info to client (\"%s\" with size %i and crc %i)\n", sv.csqc_progname, sv.csqc_progsize, sv.csqc_progcrc);
835 MSG_WriteString (&client->netconnection->message, va(vabuf, sizeof(vabuf), "csqc_progname %s\n", sv.csqc_progname));
837 MSG_WriteString (&client->netconnection->message, va(vabuf, sizeof(vabuf), "csqc_progsize %i\n", sv.csqc_progsize));
839 MSG_WriteString (&client->netconnection->message, va(vabuf, sizeof(vabuf), "csqc_progcrc %i\n", sv.csqc_progcrc));
840
841 if(client->sv_demo_file != NULL)
842 {
843 int k;
844 static char buf[NET_MAXMESSAGE];
845 sizebuf_t sb;
846
847 sb.data = (unsigned char *) buf;
848 sb.maxsize = sizeof(buf);
849 k = 0;
851 SV_WriteDemoMessage(client, &sb, false);
852 }
853
854 //[515]: init stufftext string (it is sent before svc_serverinfo)
855 if (PRVM_GetString(prog, PRVM_serverglobalstring(SV_InitCmd)))
856 {
858 MSG_WriteString (&client->netconnection->message, va(vabuf, sizeof(vabuf), "%s\n", PRVM_GetString(prog, PRVM_serverglobalstring(SV_InitCmd))));
859 }
860 }
861
862 //if (sv_allowdownloads.integer)
863 // always send the info that the server supports the protocol, even if downloads are forbidden
864 // only because of that, the CSQC exception can work
865 {
867 MSG_WriteString (&client->netconnection->message, "cl_serverextension_download 2\n");
868 }
869
870 // send at this time so it's guaranteed to get executed at the right time
871 {
872 client_t *save;
873 save = host_client;
874 host_client = client;
876 host_client = save;
877 }
878
882
885 else
887
889
890 for (i = 1;i < MAX_MODELS && sv.model_precache[i][0];i++)
892 MSG_WriteByte (&client->netconnection->message, 0);
893
894 for (i = 1;i < MAX_SOUNDS && sv.sound_precache[i][0];i++)
896 MSG_WriteByte (&client->netconnection->message, 0);
897
898// send music
902
903// set view
904// store this in clientcamera, too
905 client->clientcamera = PRVM_NUM_FOR_EDICT(client->edict);
908
910 MSG_WriteByte (&client->netconnection->message, 1);
911
912 client->prespawned = false; // need prespawn, spawn, etc
913 client->spawned = false; // need prespawn, spawn, etc
914 client->begun = false; // need prespawn, spawn, etc
915 client->sendsignon = 1; // send this message, and increment to 2, 2 will be set to 0 by the prespawn command
916
917 // clear movement info until client enters the new level properly
918 memset(&client->cmd, 0, sizeof(client->cmd));
919 client->movesequence = 0;
921 memset(&client->movement_count, 0, sizeof(client->movement_count));
922 client->ping = 0;
923
924 // allow the client some time to send his keepalives, even if map loading took ages
926}
entityframe4_database_t * EntityFrame4_AllocDatabase(mempool_t *pool)
Definition com_ents4.c:4
entityframe_database_t * EntityFrame_AllocDatabase(mempool_t *mempool)
Definition com_ents.c:5
void MSG_WriteLong(sizebuf_t *sb, int c)
Definition com_msg.c:147
void SZ_Clear(sizebuf_t *buf)
Definition common.c:44
qbool MakeDownloadPacket(const char *filename, unsigned char *data, size_t len, int crc, int cnt, sizebuf_t *buf, int protocol)
Definition csprogs.c:940
char engineversion[128]
version string for the corner of the console, crash messages, status command, etc
Definition host.c:304
int LHNETADDRESS_ToString(const lhnetaddress_t *vaddress, char *string, int stringbuffersize, int includeport)
Returns the number of bytes written to *string excluding the \0 terminator.
Definition lhnet.c:540
void Curl_SendRequirements(void)
Definition libcurl.c:1853
float sounds
Definition progsdefs.qc:207
string message
Definition progsdefs.qc:205
const char * PRVM_GetString(prvm_prog_t *prog, int num)
#define PRVM_NUM_FOR_EDICT(e)
Definition progsvm.h:870
#define PRVM_serverglobalstring(fieldname)
Definition progsvm.h:179
#define PRVM_serveredictstring(ed, fieldname)
Definition progsvm.h:174
int Protocol_NumberForEnum(protocolversion_t p)
Definition protocol.c:95
#define GAME_COOP
Definition protocol.h:203
#define svc_setview
Definition protocol.h:219
#define svc_print
Definition protocol.h:222
#define GAME_DEATHMATCH
Definition protocol.h:204
#define svc_stufftext
Definition protocol.h:223
#define svc_signonnum
Definition protocol.h:247
entityframe5_database_t * EntityFrame5_AllocDatabase(struct mempool_s *pool)
#define svc_serverinfo
Definition protocol.h:227
#define svc_cdtrack
Definition protocol.h:259
#define MAX_OSPATH
max length of a filesystem pathname
Definition qdefs.h:175
#define NET_MAXMESSAGE
max reliable packet size (sent as multiple fragments of MAX_PACKETFRAGMENT)
Definition qdefs.h:103
#define MAX_SOUNDS
max number of sounds loaded at once
Definition qdefs.h:107
#define NUM_CSQCENTITYDB_FRAMES
Definition server.h:254
signed char movement_count[NETGRAPH_PACKETS]
Definition server.h:213
char weaponmodel[MAX_QPATH]
cache weaponmodel name lookups
Definition server.h:266
csqcentityframedb_t csqcentityframehistory[NUM_CSQCENTITYDB_FRAMES]
Definition server.h:255
unsigned int movesequence
Definition server.h:212
unsigned char csqcentityscope[MAX_EDICTS]
Definition server.h:251
int csqcnumedicts
Definition server.h:250
unsigned int csqcentitysendflags[MAX_EDICTS]
Definition server.h:252
int weaponmodelindex
Definition server.h:267
int latestframenum
latest received clc_ackframe (used to detect packet loss)
Definition server.h:263
int csqcentityframehistory_next
Definition server.h:256
int clientcamera
clientcamera (entity to use as camera)
Definition server.h:270
int stats[MAX_CL_STATS]
Definition server.h:278
qfile_t * sv_demo_file
demo recording
Definition server.h:297
unsigned int movement_highestsequence_seen
Definition server.h:214
float ping
LadyHavoc: can be used for prediction or whatever...
Definition server.h:224
unsigned char statsdeltabits[(MAX_CL_STATS+7)/8]
Definition server.h:277
usercmd_t cmd
movement
Definition server.h:216
lhnetaddress_t peeraddress
Definition netconn.h:147
unsigned short filecrc
Definition progsvm.h:631
prvm_edict_t * edicts
Definition progsvm.h:680
char worldbasename[MAX_QPATH]
Definition server.h:109
char sound_precache[MAX_SOUNDS][MAX_QPATH]
Definition server.h:121
double time
Definition protocol.h:392
void SV_StartDemoRecording(client_t *client, const char *filename, int forcetrack)
Definition sv_demo.c:6
void SV_WriteDemoMessage(client_t *client, sizebuf_t *sendbuffer, qbool clienttoserver)
Definition sv_demo.c:32
cvar_t net_connecttimeout
Definition netconn.c:82
size_t Sys_TimeString(char buf[], size_t bufsize, const char *timeformat)
Definition sys_shared.c:45

References client_t::begun, buf, client_t::clientcamera, server_static_t::clients, client_t::cmd, Con_DPrintf(), coop, server_t::csqc_progcrc, server_static_t::csqc_progdata, server_t::csqc_progname, server_t::csqc_progsize, client_t::csqcentityframehistory, client_t::csqcentityframehistory_next, client_t::csqcentityscope, client_t::csqcentitysendflags, client_t::csqcnumedicts, Curl_SendRequirements(), sizebuf_t::data, deathmatch, dpsnprintf(), client_t::edict, prvm_prog_t::edicts, engineversion, client_t::entitydatabase, client_t::entitydatabase4, client_t::entitydatabase5, EntityFrame4_AllocDatabase(), EntityFrame4_FreeDatabase(), EntityFrame5_AllocDatabase(), EntityFrame5_FreeDatabase(), EntityFrame_AllocDatabase(), EntityFrame_FreeDatabase(), prvm_prog_t::filecrc, csqcentityframedb_t::framenum, GAME_COOP, GAME_DEATHMATCH, host, host_client, i, cvar_t::integer, client_t::latestframenum, LHNETADDRESS_ToString(), MakeDownloadPacket(), prvm_prog_t::max_edicts, MAX_MODELS, MAX_OSPATH, MAX_QPATH, MAX_SOUNDS, server_static_t::maxclients, sizebuf_t::maxsize, message, netconn_t::message, server_t::model_precache, client_t::movement_count, client_t::movement_highestsequence_seen, client_t::movesequence, MSG_WriteByte(), MSG_WriteLong(), MSG_WriteShort(), MSG_WriteString(), net_connecttimeout, NET_MAXMESSAGE, client_t::netconnection, NULL, csqcentityframedb_t::num, NUM_CSQCENTITYDB_FRAMES, netconn_t::peeraddress, client_t::ping, client_t::prespawned, server_t::protocol, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_NEHAHRAMOVIE, Protocol_NumberForEnum(), PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PRVM_EDICT_NUM, PRVM_GetString(), PRVM_NUM_FOR_EDICT, PRVM_serveredictfloat, PRVM_serveredictstring, PRVM_serverglobalstring, host_static_t::realtime, client_t::sendsignon, server_t::sound_precache, sounds, client_t::spawned, client_t::stats, client_t::statsdeltabits, cvar_t::string, sv, sv_autodemo_perclient, sv_autodemo_perclient_nameformat, client_t::sv_demo_file, sv_mempool, SV_StartDemoRecording(), SV_StopDemoRecording(), SV_WriteDemoMessage(), svc_cdtrack, svc_print, svc_serverinfo, svc_setview, svc_signonnum, svc_stufftext, svs, SVVM_prog, Sys_TimeString(), SZ_Clear(), server_t::time, usercmd_t::time, netconn_t::timeout, va(), cvar_t::value, client_t::weaponmodel, client_t::weaponmodelindex, and server_t::worldbasename.

Referenced by NetConn_ServerParsePacket(), SV_ConnectClient(), and SV_SpawnServer().

◆ SV_ServerOptions()

static void SV_ServerOptions ( void )
static

Definition at line 449 of file sv_main.c.

450{
451 int i;
452
453 // general default
454 svs.maxclients = 8;
455
456// COMMANDLINEOPTION: Server: -dedicated [playerlimit] starts a dedicated server (with a command console), default playerlimit is 8
457// COMMANDLINEOPTION: Server: -listen [playerlimit] starts a multiplayer server with graphical client, like singleplayer but other players can connect, default playerlimit is 8
458 // if no client is in the executable or -dedicated is specified on
459 // commandline, start a dedicated server
460 i = Sys_CheckParm ("-dedicated");
461 if (i || !cl_available)
462 {
463 // check for -dedicated specifying how many players
464 if (i && i + 1 < sys.argc && atoi (sys.argv[i+1]) >= 1)
465 svs.maxclients = atoi (sys.argv[i+1]);
466 if (Sys_CheckParm ("-listen"))
467 Con_Printf ("Only one of -dedicated or -listen can be specified\n");
468 // default sv_public on for dedicated servers (often hosted by serious administrators), off for listen servers (often hosted by clueless users)
471 }
472 else if (cl_available)
473 {
474 // client exists and not dedicated, check if -listen is specified
476 i = Sys_CheckParm ("-listen");
477 if (i)
478 {
479 // default players unless specified
480 if (i + 1 < sys.argc && atoi (sys.argv[i+1]) >= 1)
481 svs.maxclients = atoi (sys.argv[i+1]);
482 }
483 else
484 {
485 // default players in some games, singleplayer in most
487 svs.maxclients = 1;
488 }
489 }
490
492
494
497}
@ ca_disconnected
Definition client.h:531
gamemode_t gamemode
Definition com_game.c:26
#define IS_NEXUIZ_DERIVED(g)
Definition com_game.h:71
@ GAME_BATTLEMECH
Definition com_game.h:38
@ GAME_GOODVSBAD2
Definition com_game.h:36
void Cvar_SetQuick(cvar_t *var, const char *value)
Definition cvar.c:436
#define bound(min, num, max)
Definition mathlib.h:34
cvar_t sv_public
Definition netconn.c:36
#define MAX_SCOREBOARD
max number of players in game at once (255 protocol limit)
Definition qdefs.h:110
int maxclients_next
Definition server.h:28
int argc
Definition sys.h:146
const char ** argv
Definition sys.h:147
sys_t sys
Definition sys_shared.c:42
int Sys_CheckParm(const char *parm)
Definition sys_shared.c:327
int cl_available
Definition vid_null.c:24
#define Mem_Alloc(pool, size)
Definition zone.h:92

References sys_t::argc, sys_t::argv, bound, ca_disconnected, cl_available, server_static_t::clients, cls, Con_Printf(), coop, Cvar_SetQuick(), Cvar_SetValueQuick(), deathmatch, GAME_BATTLEMECH, GAME_GOODVSBAD2, gamemode, i, cvar_t::integer, IS_NEXUIZ_DERIVED, MAX_SCOREBOARD, server_static_t::maxclients, server_static_t::maxclients_next, Mem_Alloc, client_static_t::state, sv_dedicated, sv_mempool, sv_public, svs, sys, and Sys_CheckParm().

Referenced by SV_Init().

◆ SV_Shutdown()

void SV_Shutdown ( void )

Definition at line 2128 of file sv_main.c.

2129{
2130 int i;
2131
2133
2134 if (!sv.active)
2135 goto end;
2136
2137 Con_DPrintf("SV_Shutdown\n");
2138
2141
2142 // make sure all the clients know we're disconnecting
2143 for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
2144 if (host_client->active)
2145 SV_DropClient(false, "Server shutting down"); // server shutdown
2146
2147 SV_VM_Shutdown(true);
2148
2150
2151 sv.active = false;
2152//
2153// clear structures
2154//
2155 memset(&sv, 0, sizeof(sv));
2156 memset(svs.clients, 0, svs.maxclients*sizeof(client_t));
2157end:
2159}
void NetConn_CloseServerPorts(void)
Definition netconn.c:1121
#define SV_LockThreadMutex()
Definition server.h:606
#define SV_UnlockThreadMutex()
Definition server.h:607
static void SV_VM_Shutdown(qbool prog_reset)
Definition sv_main.c:1788

References client_t::active, server_t::active, server_static_t::clients, Con_DPrintf(), host_client, i, server_static_t::maxclients, NetConn_CloseServerPorts(), NetConn_Heartbeat(), sv, SV_DropClient(), SV_LockThreadMutex, SV_UnlockThreadMutex, SV_VM_Shutdown(), and svs.

Referenced by PRVM_Crash(), SV_Init(), SV_Map_f(), and SV_VM_Shutdown().

◆ SV_SoundIndex()

int SV_SoundIndex ( const char * s,
int precachemode )

Definition at line 1474 of file sv_main.c.

1475{
1477 char filename[MAX_QPATH];
1478 if (!s || !*s)
1479 return 0;
1480 // testing
1481 //if (precachemode == 2)
1482 // return 0;
1483 dp_strlcpy(filename, s, sizeof(filename));
1484 for (i = 1;i < limit;i++)
1485 {
1486 if (!sv.sound_precache[i][0])
1487 {
1488 if (precachemode)
1489 {
1491 {
1492 Con_Printf("SV_SoundIndex(\"%s\"): precache_sound can only be done in spawn functions\n", filename);
1493 return 0;
1494 }
1495 if (precachemode == 1)
1496 Con_Printf("SV_SoundIndex(\"%s\"): not precached (fix your code), precaching anyway\n", filename);
1497 dp_strlcpy(sv.sound_precache[i], filename, sizeof(sv.sound_precache[i]));
1498 if (sv.state != ss_loading)
1499 {
1503 }
1504 return i;
1505 }
1506 Con_Printf("SV_SoundIndex(\"%s\"): not precached\n", filename);
1507 return 0;
1508 }
1509 if (!strcmp(sv.sound_precache[i], filename))
1510 return i;
1511 }
1512 Con_Printf("SV_SoundIndex(\"%s\"): i (%i) == MAX_SOUNDS (%i)\n", filename, i, MAX_SOUNDS);
1513 return 0;
1514}

References Con_Printf(), dp_strlcpy, i, MAX_QPATH, MAX_SOUNDS, MSG_WriteByte(), MSG_WriteShort(), MSG_WriteString(), server_t::protocol, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_DARKPLACES5, PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, server_t::reliable_datagram, server_t::sound_precache, ss_loading, server_t::state, sv, and svc_precache.

Referenced by SV_StartPointSound(), SV_StartSound(), VM_SV_ambientsound(), and VM_SV_precache_sound().

◆ SV_SpawnServer()

void SV_SpawnServer ( const char * map)

Definition at line 1811 of file sv_main.c.

1812{
1813 prvm_prog_t *prog = SVVM_prog;
1814 prvm_edict_t *ent;
1815 int i;
1816 char *entities;
1817 model_t *worldmodel;
1818 char modelname[sizeof(sv.worldname)];
1819 const char *canonicalname;
1820 char vabuf[1024];
1821
1822 Con_Printf("SpawnServer: %s\n", map);
1823
1824 dpsnprintf (modelname, sizeof(modelname), "maps/%s.bsp", map);
1825
1826 if (!(canonicalname = FS_FileExists(modelname)))
1827 {
1828 dpsnprintf (modelname, sizeof(modelname), "maps/%s", map);
1829 if (!(canonicalname = FS_FileExists(modelname)))
1830 {
1831 Con_Printf(CON_ERROR "SpawnServer: no map file named %s.bsp\n", modelname);
1832 return;
1833 }
1834 }
1835 // if it's not in a pak canonicalname will be the same pointer as modelname
1836 // if it's in a pak canonicalname may differ by case
1837 if (modelname != canonicalname)
1838 dp_strlcpy(modelname, canonicalname, sizeof(modelname));
1839
1840// SV_LockThreadMutex();
1841
1844 else
1845 {
1848 }
1849
1850 if(sv.active)
1851 SV_VM_Shutdown(false);
1852
1853 // free q3 shaders so that any newly downloaded shaders will be active
1855
1856 worldmodel = Mod_ForName(modelname, false, developer.integer > 0, NULL);
1857 if (!worldmodel || !worldmodel->TraceBox)
1858 {
1859 Con_Printf(CON_ERROR "Couldn't load map %s\n", modelname);
1860
1863
1864// SV_UnlockThreadMutex();
1865
1866 return;
1867 }
1868
1870
1871 // let's not have any servers with no name
1872 if (hostname.string[0] == 0)
1873 Cvar_SetQuick(&hostname, "UNNAMED");
1875
1876 svs.changelevel_issued = false; // now safe to issue another
1877
1878 // make the map a required file for clients
1880 Curl_RequireFile(modelname);
1881
1882//
1883// tell all connected clients that we are going to a new level
1884//
1885 if (sv.active)
1886 {
1887 client_t *client;
1888 for (i = 0, client = svs.clients;i < svs.maxclients;i++, client++)
1889 {
1890 if (client->netconnection)
1891 {
1893 MSG_WriteString(&client->netconnection->message, "reconnect\n");
1894 }
1895 }
1896 }
1897 else
1898 {
1899 // open server port
1901 }
1902
1903//
1904// make cvars consistant
1905//
1906 if (coop.integer)
1908 // LadyHavoc: it can be useful to have skills outside the range 0-3...
1909 //current_skill = bound(0, (int)(skill.value + 0.5), 3);
1910 //Cvar_SetValue ("skill", (float)current_skill);
1911 current_skill = (int)(skill.value + 0.5);
1912
1913//
1914// set up the new server
1915//
1916 memset (&sv, 0, sizeof(sv));
1917
1918 // tell SV_Frame() to reset its timers
1920
1921 // if running a local client, make sure it doesn't try to access the last
1922 // level's data which is no longer valiud
1923 cls.signon = 0;
1924
1928
1930 {
1931 srand(sv_random_seed.integer);
1932 Con_Printf(CON_WARN "NOTE: random seed is %d; use for debugging/benchmarking only!\nUnset sv_random_seed to get real random numbers again.\n", sv_random_seed.integer);
1933 }
1934
1935 SV_VM_Setup();
1936
1937 sv.active = true;
1938
1939 // set level base name variables for later use
1940 dp_strlcpy(sv.worldname, modelname, sizeof(sv.worldname));
1943// dp_strlcpy(sv.name, sv.worldbasename, sizeof (sv.name)); // TODO can we just remove this now?
1944 //Cvar_SetQuick(&sv_worldmessage, sv.worldmessage); // set later after QC is spawned
1948
1951 {
1952 char buffer[1024];
1953 Protocol_Names(buffer, sizeof(buffer));
1954 Con_Printf(CON_ERROR "Unknown sv_protocolname \"%s\", valid values are:\n%s\n", sv_protocolname.string, buffer);
1956 }
1957
1958// load progs to get entity field count
1959 //PR_LoadProgs ( sv_progs.string );
1960
1961 sv.datagram.maxsize = sizeof(sv.datagram_buf);
1962 sv.datagram.cursize = 0;
1964
1968
1969 sv.signon.maxsize = sizeof(sv.signon_buf);
1970 sv.signon.cursize = 0;
1972
1973// leave slots at start for clients only
1974 //prog->num_edicts = svs.maxclients+1;
1975
1977 prog->allowworldwrites = true;
1978 sv.paused = false;
1979
1980 sv.time = 1.0;
1981
1982 Mod_ClearUsed();
1983 worldmodel->used = true;
1984
1985 sv.worldmodel = worldmodel;
1986 sv.models[1] = sv.worldmodel;
1987
1988//
1989// clear world interaction links
1990//
1991 World_SetSize(&sv.world, sv.worldname, sv.worldmodel->normalmins, sv.worldmodel->normalmaxs, prog);
1993
1994 dp_strlcpy(sv.sound_precache[0], "", sizeof(sv.sound_precache[0]));
1995
1996 dp_strlcpy(sv.model_precache[0], "", sizeof(sv.model_precache[0]));
1998 for (i = 1;i < sv.worldmodel->brush.numsubmodels && i+1 < MAX_MODELS;i++)
1999 {
2000 dpsnprintf(sv.model_precache[i+1], sizeof(sv.model_precache[i+1]), "*%i", i);
2001 sv.models[i+1] = Mod_ForName (sv.model_precache[i+1], false, false, sv.worldname);
2002 }
2003 if(i < sv.worldmodel->brush.numsubmodels)
2004 Con_Printf(CON_WARN "Too many submodels (MAX_MODELS is %i)\n", MAX_MODELS);
2005
2006//
2007// load the rest of the entities
2008//
2009 // AK possible hack since num_edicts is still 0
2010 ent = PRVM_EDICT_NUM(0);
2011 memset (ent->fields.fp, 0, prog->entityfields * sizeof(prvm_vec_t));
2012 ent->free = false;
2014 PRVM_serveredictfloat(ent, modelindex) = 1; // world model
2021
2022 if (coop.value)
2024 else
2026
2028
2029// serverflags are for cross level information (sigils)
2031
2032 // we need to reset the spawned flag on all connected clients here so that
2033 // their thinks don't run during startup (before PutClientInServer)
2034 // we also need to set up the client entities now
2035 // and we need to set the ->edict pointers to point into the progs edicts
2036 for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
2037 {
2038 host_client->begun = false;
2041 }
2042
2043 // load replacement entity file if found
2044 if (sv_entpatch.integer && (entities = (char *)FS_LoadFile(va(vabuf, sizeof(vabuf), "%s.ent", sv.worldnamenoextension), tempmempool, true, NULL)))
2045 {
2046 Con_Printf("Loaded %s.ent\n", sv.worldnamenoextension);
2047 PRVM_ED_LoadFromFile(prog, entities);
2048 Mem_Free(entities);
2049 }
2050 else
2051 PRVM_ED_LoadFromFile(prog, sv.worldmodel->brush.entities);
2052
2053
2054 // LadyHavoc: clear world angles (to fix e3m3.bsp)
2056
2057// all setup is completed, any further precache statements are errors
2058// sv.state = ss_active; // LadyHavoc: workaround for svc_precache bug
2059 prog->allowworldwrites = false;
2060
2061// run two frames to allow everything to settle
2062 sv.time = 1.0001;
2063 for (i = 0;i < sv_init_frame_count.integer;i++)
2064 {
2065 sv.frametime = 0.1;
2066 SV_Physics ();
2067 }
2068
2069 // Once all init frames have been run, we consider svqc code fully initialized.
2070 prog->inittime = host.realtime;
2071
2074
2075// create a baseline for more efficient communications
2078
2079 sv.state = ss_active; // LadyHavoc: workaround for svc_precache bug
2080
2081// send serverinfo to all connected clients, and set up botclients coming back from a level change
2082 for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
2083 {
2084 host_client->clientconnectcalled = false; // do NOT call ClientDisconnect if he drops before ClientConnect!
2085 if (!host_client->active)
2086 continue;
2089 else
2090 {
2091 int j;
2092 // if client is a botclient coming from a level change, we need to
2093 // set up client info that normally requires networking
2094
2095 // copy spawn parms out of the client_t
2096 for (j=0 ; j< NUM_SPAWN_PARMS ; j++)
2098
2099 // call the spawn function
2103 prog->ExecuteProgram(prog, PRVM_serverfunction(ClientConnect), "QC function ClientConnect is missing");
2104 prog->ExecuteProgram(prog, PRVM_serverfunction(PutClientInServer), "QC function PutClientInServer is missing");
2105 host_client->begun = true;
2106 }
2107 }
2108
2109 // update the map title cvar (not related to filename)
2111
2112 Con_Printf("Server spawned.\n");
2114
2117
2118// SV_UnlockThreadMutex();
2119}
void SCR_BeginLoadingPlaque(qbool startup)
Definition cl_screen.c:1838
void Collision_Cache_Reset(qbool resetlimits)
Definition collision.c:1480
@ PROTOCOL_UNKNOWN
Definition common.h:133
#define CON_ERROR
Definition console.h:102
float movetype
string mapname
vector mins
vector maxs
vector absmax
string model
float solid
vector absmin
void FS_StripExtension(const char *in, char *out, size_t size_out)
Definition fs.c:3611
GLuint buffer
Definition glquake.h:630
cvar_t developer
Definition host.c:48
void Curl_ClearRequirements(void)
Definition libcurl.c:1795
void Curl_RequireFile(const char *filename)
Definition libcurl.c:1779
#define VectorClear(a)
Definition mathlib.h:97
void Mod_ClearUsed(void)
void Mod_PurgeUnused(void)
void Mod_FreeQ3Shaders(void)
void NetConn_OpenServerPorts(int opennetports)
Definition netconn.c:1168
cvar_t hostname
Definition netconn.c:88
void PRVM_ED_LoadFromFile(prvm_prog_t *prog, const char *data)
int PRVM_SetEngineString(prvm_prog_t *prog, const char *s)
protocolversion_t Protocol_EnumForName(const char *s)
Definition protocol.c:68
void Protocol_Names(char *buffer, size_t buffersize)
Definition protocol.c:104
float prvm_vec_t
Definition qtypes.h:55
int current_skill
skill level for currently loaded level (in case the user changes the cvar while the level is running,...
Definition sv_ccmds.c:27
@ ss_active
Definition server.h:52
#define MOVETYPE_PUSH
no clip to world, push and crush
Definition server.h:319
#define SOLID_BSP
bsp clip, touch on edge, block
Definition server.h:336
void S_StopAllSounds(void)
Definition snd_main.c:1710
model_brush_t brush
void(* TraceBox)(struct model_s *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask)
qbool used
prvm_vec_t * fp
Definition progsvm.h:102
union prvm_edict_t::@30 fields
int entityfields
number of vec_t fields in progs (some variables are 3)
Definition progsvm.h:548
double inittime
system time when QC initialization code finished (any entity created before is not a leak)
Definition progsvm.h:539
qbool allowworldwrites
allow writing to world entity fields, this is set by server init and cleared before first server fram...
Definition progsvm.h:697
qbool changelevel_issued
cleared when at SV_SpawnServer
Definition server.h:34
unsigned char reliable_datagram_buf[NET_MAXMESSAGE]
Definition server.h:131
sizebuf_t datagram
Definition server.h:126
unsigned char signon_buf[NET_MAXMESSAGE]
LadyHavoc: increased signon message buffer from 8192.
Definition server.h:135
unsigned char datagram_buf[NET_MAXMESSAGE]
Definition server.h:127
int cursize
Definition common.h:54
vec3_t maxs
Definition world.h:72
vec3_t mins
Definition world.h:71
static void SV_VM_Setup(void)
Definition sv_main.c:2314
static void SV_CreateBaseline(void)
Definition sv_main.c:1628
float scr_centertime_off
Definition cl_screen.c:129
void Sys_MakeProcessNice(void)
Definition sys_shared.c:958
void Sys_MakeProcessMean(void)
Definition sys_shared.c:961
void World_SetSize(world_t *world, const char *filename, const vec3_t mins, const vec3_t maxs, prvm_prog_t *prog)
Definition world.c:118
void World_Start(world_t *world)
Definition world.c:59

References absmax, absmin, client_t::active, server_t::active, prvm_prog_t::allowworldwrites, angles, client_t::begun, model_t::brush, buffer, server_static_t::changelevel_issued, client_t::clientconnectcalled, server_static_t::clients, cls, Collision_Cache_Reset(), CON_ERROR, Con_Printf(), CON_WARN, coop, Curl_ClearRequirements(), Curl_RequireFile(), current_skill, sizebuf_t::cursize, Cvar_SetQuick(), Cvar_SetValueQuick(), sizebuf_t::data, server_t::datagram, server_t::datagram_buf, deathmatch, developer, dp_strlcpy, dpsnprintf(), client_t::edict, prvm_prog_t::edicts, prvm_prog_t::entityfields, prvm_prog_t::ExecuteProgram, prvm_edict_t::fields, prvm_edict_t::fp, host_static_t::framecount, server_t::frametime, prvm_edict_t::free, FS_FileExists(), FS_LoadFile(), FS_StripExtension(), halflifebsp, host, host_client, host_isclient, hostname, i, prvm_prog_t::inittime, int(), cvar_t::integer, model_brush_t::ishlbsp, model_brush_t::isq2bsp, model_brush_t::isq3bsp, mapname, MAX_MODELS, server_static_t::maxclients, maxs, world_t::maxs, sizebuf_t::maxsize, Mem_Free, message, netconn_t::message, mins, world_t::mins, Mod_ClearUsed(), Mod_ForName(), Mod_FreeQ3Shaders(), Mod_PurgeUnused(), model, server_t::model_precache, modelindex, server_t::models, movetype, MOVETYPE_PUSH, MSG_WriteByte(), MSG_WriteString(), NetConn_Heartbeat(), NetConn_OpenServerPorts(), client_t::netconnection, NULL, NUM_SPAWN_PARMS, parm1, server_t::paused, server_t::protocol, Protocol_EnumForName(), Protocol_Names(), PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PROTOCOL_UNKNOWN, PRVM_ED_ClearEdict(), PRVM_ED_LoadFromFile(), PRVM_EDICT_NUM, PRVM_EDICT_TO_PROG, PRVM_GetString(), PRVM_serveredictfloat, PRVM_serveredictstring, PRVM_serveredictvector, PRVM_serverfunction, PRVM_serverglobaledict, PRVM_serverglobalfloat, PRVM_serverglobalstring, PRVM_SetEngineString(), host_static_t::realtime, server_t::reliable_datagram, server_t::reliable_datagram_buf, S_StopAllSounds(), SCR_BeginLoadingPlaque(), scr_centertime_off, self, server_static_t::serverflags, serverflags, client_static_t::signon, server_t::signon, server_t::signon_buf, skill, solid, SOLID_BSP, server_t::sound_precache, client_t::spawn_parms, server_t::spawnframe, ss_active, ss_loading, server_t::state, cvar_t::string, sv, SV_CreateBaseline(), sv_entpatch, sv_init_frame_count, sv_mapformat_is_quake2, sv_mapformat_is_quake3, SV_Physics(), sv_protocolname, sv_random_seed, SV_SendServerinfo(), SV_VM_Setup(), SV_VM_Shutdown(), sv_worldbasename, sv_worldmessage, sv_worldname, sv_worldnamenoextension, svc_stufftext, svs, SVVM_prog, Sys_MakeProcessMean(), Sys_MakeProcessNice(), tempmempool, server_t::time, time, model_t::TraceBox, model_t::used, va(), cvar_t::value, VectorClear, VectorCopy, server_t::world, World_SetSize(), World_Start(), server_t::worldbasename, server_t::worldmodel, server_t::worldname, and server_t::worldnamenoextension.

Referenced by SV_Changelevel_f(), SV_Loadgame_f(), SV_Map_f(), and SV_Restart_f().

◆ SV_StartDownload_f()

static void SV_StartDownload_f ( cmd_state_t * cmd)
static

Definition at line 1160 of file sv_main.c.

1161{
1164}

References client_t::download_file, client_t::download_started, and host_client.

Referenced by SV_Init().

◆ SV_StartThread()

void SV_StartThread ( void )

Definition at line 2850 of file sv_main.c.

2851{
2853 return;
2854 svs.threaded = true;
2855 svs.threadstop = false;
2858}
void * threadmutex
Definition server.h:46
void * thread
Definition server.h:47
qbool volatile threadstop
Definition server.h:45
static int SV_ThreadFunc(void *voiddata)
Definition sv_main.c:2716
qbool Thread_HasThreads(void)
Definition thread_null.c:13
#define Thread_CreateMutex()
Definition thread.h:15
#define Thread_CreateThread(fn, data)
Definition thread.h:24

References cvar_t::integer, NULL, sv_threaded, SV_ThreadFunc(), svs, server_static_t::thread, Thread_CreateMutex, Thread_CreateThread, Thread_HasThreads(), server_static_t::threaded, server_static_t::threadmutex, and server_static_t::threadstop.

Referenced by Host_Init().

◆ SV_StopThread()

void SV_StopThread ( void )

Definition at line 2860 of file sv_main.c.

2861{
2862 if (!svs.threaded)
2863 return;
2864 svs.threadstop = true;
2867 svs.threaded = false;
2868}
#define Thread_DestroyMutex(m)
Definition thread.h:16
#define Thread_WaitThread(thread, retval)
Definition thread.h:25

References svs, server_static_t::thread, Thread_DestroyMutex, Thread_WaitThread, server_static_t::threaded, server_static_t::threadmutex, and server_static_t::threadstop.

Referenced by Host_Shutdown().

◆ SV_ThreadFunc()

static int SV_ThreadFunc ( void * voiddata)
static

Definition at line 2716 of file sv_main.c.

2717{
2718 prvm_prog_t *prog = SVVM_prog;
2719 qbool playing = false;
2720 double sv_timer = 0;
2721 double sv_deltarealtime, sv_oldrealtime, sv_realtime;
2722 int i;
2723 char vabuf[1024];
2724 sv_realtime = Sys_DirtyTime();
2725 while (!svs.threadstop)
2726 {
2727 // FIXME: we need to handle Host_Error in the server thread somehow
2728// if (setjmp(sv_abortframe))
2729// continue; // something bad happened in the server game
2730
2731 sv_oldrealtime = sv_realtime;
2732 sv_realtime = Sys_DirtyTime();
2733 sv_deltarealtime = sv_realtime - sv_oldrealtime;
2734 if (sv_deltarealtime < 0 || sv_deltarealtime >= 1800) sv_deltarealtime = 0;
2735
2736 sv_timer += sv_deltarealtime;
2737
2738 sv.perf_acc_realtime += sv_deltarealtime;
2739
2740 // at this point we start doing real server work, and must block on any client activity pertaining to the server (such as executing SV_SpawnServer)
2742
2743 // Look for clients who have spawned
2744 playing = false;
2745 if (sv.active)
2746 for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
2747 if(host_client->begun)
2749 playing = true;
2750 if(sv.time < 10)
2751 {
2752 // don't accumulate time for the first 10 seconds of a match
2753 // so things can settle
2755 }
2756 else if(sv.perf_acc_realtime > 5)
2757 {
2761 {
2765 }
2767 if(playing)
2768 Con_DPrintf("Server can't keep up: %s\n", SV_TimingReport(vabuf, sizeof(vabuf)));
2770 }
2771
2772 // get new packets
2773 if (sv.active)
2774 {
2777 }
2778
2779 // if the accumulators haven't become positive yet, wait a while
2780 if (sv_timer < 0)
2781 {
2782 SV_UnlockThreadMutex(); // don't keep mutex locked while sleeping
2783 sv.perf_acc_sleeptime += Sys_Sleep(-sv_timer);
2784 continue;
2785 }
2786
2787 if (sv.active && sv_timer > 0)
2788 {
2789 // execute one server frame
2790 double advancetime;
2791 float offset;
2792
2793 if (sys_ticrate.value <= 0)
2794 advancetime = min(sv_timer, 0.1); // don't step more than 100ms
2795 else
2796 advancetime = sys_ticrate.value;
2797
2798 if(advancetime > 0)
2799 {
2800 offset = sv_timer + (Sys_DirtyTime() - sv_realtime); // LadyHavoc: FIXME: I don't understand this line
2806 }
2807
2808 // only advance time if not paused
2809 // the game also pauses in singleplayer when menu or console is used
2810 sv.frametime = advancetime * host_timescale.value;
2813 if (sv.paused || host.paused)
2814 sv.frametime = 0;
2815
2816 sv_timer -= advancetime;
2817
2818 // move things around and think unless paused
2819 if (sv.frametime)
2820 SV_Physics();
2821
2822 // send all messages to the clients
2824
2825 if (sv.paused == 1 && sv_realtime > sv.pausedstart && sv.pausedstart > 0)
2826 {
2828 prog->globals.fp[OFS_PARM0] = sv_realtime - sv.pausedstart;
2829 prog->ExecuteProgram(prog, PRVM_serverfunction(SV_PausedTic), "QC function SV_PausedTic is missing");
2830 }
2831
2832 // send an heartbeat if enough time has passed since the last one
2834
2835 }
2836
2837 // we're back to safe code now
2839
2840 // if there is some time remaining from this frame, reset the timers
2841 if (sv_timer >= 0)
2842 {
2843 sv.perf_acc_lost += sv_timer;
2844 sv_timer = 0;
2845 }
2846 }
2847 return 0;
2848}
double Sys_Sleep(double time)
called to yield for a little bit so as not to hog cpu when paused or debugging
Definition sys_shared.c:500

References server_t::active, client_t::begun, server_static_t::clients, Con_DPrintf(), developer_extra, prvm_prog_t::ExecuteProgram, prvm_prog_t::fp, server_t::frametime, prvm_prog_t::globals, host, host_client, host_framerate, host_timescale, i, cvar_t::integer, server_static_t::maxclients, min, NetConn_Heartbeat(), NetConn_ServerFrame(), client_t::netconnection, offset, OFS_PARM0, host_static_t::paused, server_t::paused, server_t::pausedstart, server_t::perf_acc_lost, server_t::perf_acc_offset, server_t::perf_acc_offset_max, server_t::perf_acc_offset_samples, server_t::perf_acc_offset_squared, server_t::perf_acc_realtime, server_t::perf_acc_sleeptime, server_t::perf_cpuload, server_t::perf_lost, server_t::perf_offset_avg, server_t::perf_offset_max, server_t::perf_offset_sdev, PRVM_serverfunction, PRVM_serverglobalfloat, sqrt(), sv, SV_CheckTimeouts(), SV_LockThreadMutex, SV_Physics(), SV_SendClientMessages(), SV_TimingReport(), SV_UnlockThreadMutex, svs, SVVM_prog, Sys_DirtyTime(), Sys_Sleep(), sys_ticrate, server_static_t::threadstop, server_t::time, time, and cvar_t::value.

Referenced by SV_StartThread().

◆ SV_TimingReport()

const char * SV_TimingReport ( char * buf,
size_t buflen )

for output in SV_Status_f

Definition at line 2521 of file sv_main.c.

2522{
2523 return va(buf, buflen, "%.1f%% CPU, %.2f%% lost, offset avg %.1fms, max %.1fms, sdev %.1fms", sv.perf_cpuload * 100, sv.perf_lost * 100, sv.perf_offset_avg * 1000, sv.perf_offset_max * 1000, sv.perf_offset_sdev * 1000);
2524}

References buf, server_t::perf_cpuload, server_t::perf_lost, server_t::perf_offset_avg, server_t::perf_offset_max, server_t::perf_offset_sdev, sv, and va().

Referenced by SV_Frame(), SV_Status_f(), and SV_ThreadFunc().

◆ SV_VM_Setup()

static void SV_VM_Setup ( void )
static

Definition at line 2314 of file sv_main.c.

2315{
2316 prvm_prog_t *prog = SVVM_prog;
2318
2319 // allocate the mempools
2320 // TODO: move the magic numbers/constants into #defines [9/13/2006 Black]
2321 prog->progs_mempool = Mem_AllocPool("Server Progs", 0, NULL);
2322 prog->builtins = vm_sv_builtins;
2324 prog->max_edicts = 512;
2325 if (sv.protocol == PROTOCOL_QUAKE)
2326 prog->limit_edicts = 640; // before quake mission pack 1 this was 512
2327 else if (sv.protocol == PROTOCOL_QUAKEDP)
2328 prog->limit_edicts = 2048; // guessing
2329 else if (sv.protocol == PROTOCOL_NEHAHRAMOVIE)
2330 prog->limit_edicts = 2048; // guessing!
2332 prog->limit_edicts = 4096; // guessing!
2333 else
2334 prog->limit_edicts = MAX_EDICTS;
2337 prog->name = "server";
2339 prog->loadintoworld = true;
2340
2341 // all callbacks must be defined (pointers are not checked before calling)
2348 prog->init_cmd = SVVM_init_cmd;
2349 prog->reset_cmd = SVVM_reset_cmd;
2350 prog->error_cmd = Host_Error;
2352
2354
2355 // some mods compiled with scrambling compilers lack certain critical
2356 // global names and field names such as "self" and "time" and "nextthink"
2357 // so we have to set these offsets manually, matching the entvars_t
2358 // but we only do this if the prog header crc matches, otherwise it's totally freeform
2360 {
2482// PRVM_ED_FindGlobalOffset_FromStruct(globalvars_t, main);
2483// PRVM_ED_FindGlobalOffset_FromStruct(globalvars_t, StartFrame);
2484// PRVM_ED_FindGlobalOffset_FromStruct(globalvars_t, PlayerPreThink);
2485// PRVM_ED_FindGlobalOffset_FromStruct(globalvars_t, PlayerPostThink);
2486// PRVM_ED_FindGlobalOffset_FromStruct(globalvars_t, ClientKill);
2487// PRVM_ED_FindGlobalOffset_FromStruct(globalvars_t, ClientConnect);
2488// PRVM_ED_FindGlobalOffset_FromStruct(globalvars_t, PutClientInServer);
2489// PRVM_ED_FindGlobalOffset_FromStruct(globalvars_t, ClientDisconnect);
2490// PRVM_ED_FindGlobalOffset_FromStruct(globalvars_t, SetNewParms);
2491// PRVM_ED_FindGlobalOffset_FromStruct(globalvars_t, SetChangeParms);
2492 }
2493 else
2494 Con_DPrintf("%s: %s system vars have been modified (CRC %i != engine %i), will not load in other engines\n", prog->name, sv_progs.string, prog->progs_crc, PROGHEADER_CRC);
2495
2496 // OP_STATE is always supported on server because we add fields/globals for it
2497 prog->flag |= PRVM_OP_STATE;
2498
2499 VM_CustomStats_Clear();//[515]: csqc
2500
2502}
cmd_state_t * cmd_local
command interpreter for local commands injected by SVQC, CSQC, MQC, server or client engine code uses...
Definition cmd.c:25
vector v_up
vector size
string classname
float flags
entity trace_ent
entity other
string netname
vector avelocity
float frametime
entity owner
vector velocity
entity world
entity chain
float effects
vector v_right
vector trace_endpos
float trace_startsolid
entity enemy
float nextthink
float trace_inopen
float colormap
vector v_forward
float trace_fraction
vector oldorigin
float trace_allsolid
vector trace_plane_normal
float trace_plane_dist
float trace_inwater
float idealpitch
void Host_Error(const char *error,...)
Definition host.c:85
#define PROGHEADER_CRC_TENEBRAE
Definition progdefs.h:167
#define PROGHEADER_CRC
Definition progdefs.h:166
float parm6
Definition progsdefs.qc:45
float max_health
Definition progsdefs.qc:174
string noise
Definition progsdefs.qc:209
float button2
Definition progsdefs.qc:156
float ammo_rockets
Definition progsdefs.qc:143
float ideal_yaw
Definition progsdefs.qc:184
float parm5
Definition progsdefs.qc:45
float frags
Definition progsdefs.qc:138
float parm4
Definition progsdefs.qc:45
string noise1
Definition progsdefs.qc:209
float killed_monsters
Definition progsdefs.qc:40
vector punchangle
Definition progsdefs.qc:117
float weapon
Definition progsdefs.qc:139
float ammo_shells
Definition progsdefs.qc:143
float team
Definition progsdefs.qc:172
float button0
Definition progsdefs.qc:154
float parm14
Definition progsdefs.qc:45
entity msg_entity
Definition progsdefs.qc:63
float parm11
Definition progsdefs.qc:45
float dmg_take
Definition progsdefs.qc:198
float total_secrets
Definition progsdefs.qc:36
vector v_angle
Definition progsdefs.qc:161
entity goalentity
Definition progsdefs.qc:189
float teleport_time
Definition progsdefs.qc:176
vector view_ofs
Definition progsdefs.qc:151
string targetname
Definition progsdefs.qc:194
float parm8
Definition progsdefs.qc:45
float yaw_speed
Definition progsdefs.qc:185
float health
Definition progsdefs.qc:137
float watertype
Definition progsdefs.qc:182
float waterlevel
Definition progsdefs.qc:181
float parm10
Definition progsdefs.qc:45
float force_retouch
Definition progsdefs.qc:19
entity groundentity
Definition progsdefs.qc:134
float weaponframe
Definition progsdefs.qc:141
float items
Definition progsdefs.qc:145
float armorvalue
Definition progsdefs.qc:179
float parm2
Definition progsdefs.qc:45
float parm15
Definition progsdefs.qc:45
entity aiment
Definition progsdefs.qc:187
float fixangle
Definition progsdefs.qc:160
vector movedir
Definition progsdefs.qc:203
float total_monsters
Definition progsdefs.qc:37
float ammo_nails
Definition progsdefs.qc:143
float parm16
Definition progsdefs.qc:45
string noise3
Definition progsdefs.qc:209
float deadflag
Definition progsdefs.qc:149
float impulse
Definition progsdefs.qc:158
float currentammo
Definition progsdefs.qc:142
float parm9
Definition progsdefs.qc:45
float parm7
Definition progsdefs.qc:45
float spawnflags
Definition progsdefs.qc:191
string noise2
Definition progsdefs.qc:209
float parm12
Definition progsdefs.qc:45
float button1
Definition progsdefs.qc:155
float ammo_cells
Definition progsdefs.qc:143
float parm3
Definition progsdefs.qc:45
string weaponmodel
Definition progsdefs.qc:140
float dmg_save
Definition progsdefs.qc:199
float parm13
Definition progsdefs.qc:45
float found_secrets
Definition progsdefs.qc:39
float armortype
Definition progsdefs.qc:178
float ltime
Definition progsdefs.qc:107
entity dmg_inflictor
Definition progsdefs.qc:200
string target
Definition progsdefs.qc:193
float takedamage
Definition progsdefs.qc:147
#define PRVM_OP_STATE
Definition progsvm.h:238
void PRVM_Prog_Load(prvm_prog_t *prog, const char *filename, unsigned char *data, fs_offset_t size, void CheckRequiredFuncs(prvm_prog_t *prog, const char *filename), int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, prvm_required_field_t *required_global)
#define PRVM_ED_FindFieldOffset_FromStruct(st, field)
Definition progsvm.h:841
void PRVM_Prog_Init(prvm_prog_t *prog, struct cmd_state_s *cmd)
Initializing a vm: Call InitProg with the num Set up the fields marked with [INIT] in the prog struct...
const char * vm_sv_extensions[]
client also uses this
Definition svvm_cmds.c:11
prvm_builtin_t vm_sv_builtins[]
Definition svvm_cmds.c:3265
void SVVM_ExecuteProgram(prvm_prog_t *prog, func_t fnum, const char *errormessage)
Definition prvm_exec.c:1183
void SVVM_reset_cmd(prvm_prog_t *prog)
Definition svvm_cmds.c:3923
void SVVM_init_cmd(prvm_prog_t *prog)
Definition svvm_cmds.c:3918
const int vm_sv_numbuiltins
Definition svvm_cmds.c:3916
#define PRVM_ED_FindGlobalOffset_FromStruct(st, field)
Definition progsvm.h:842
#define MAX_EDICTS
max number of objects in game world at once (32768 protocol limit)
Definition qdefs.h:105
void VM_CustomStats_Clear(void)
Definition svvm_cmds.c:1717
void(* reset_cmd)(struct prvm_prog_s *prog)
[INIT] used by PRVM_ResetProg
Definition progsvm.h:745
int numbuiltins
Definition progsvm.h:605
prvm_builtin_t * builtins
Definition progsvm.h:604
int edictprivate_size
size of the engine private struct
Definition progsvm.h:689
const char * name
name of the prog, e.g. "Server", "Client" or "Menu" (used for text output)
Definition progsvm.h:700
void(* begin_increase_edicts)(struct prvm_prog_s *prog)
[INIT] used by PRVM_MEM_Increase_Edicts
Definition progsvm.h:734
void(* free_edict)(struct prvm_prog_s *prog, prvm_edict_t *ed)
[INIT] used by PRVM_ED_Free
Definition progsvm.h:738
void(* error_cmd)(const char *format,...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN
[INIT]
Definition progsvm.h:747
int progs_crc
Definition progsvm.h:553
void(* count_edicts)(struct prvm_prog_s *prog)
[INIT] used by PRVM_ED_Count_f
Definition progsvm.h:740
qbool loadintoworld
Definition progsvm.h:707
int limit_edicts
used instead of the constant MAX_EDICTS
Definition progsvm.h:675
unsigned flag
flag - used to store general flags like PRVM_GE_SELF, etc.
Definition progsvm.h:703
void(* init_edict)(struct prvm_prog_s *prog, prvm_edict_t *edict)
[INIT] used by PRVM_ED_ClearEdict
Definition progsvm.h:737
mempool_t * progs_mempool
all memory allocations related to this vm_prog (code, edicts, strings)
Definition progsvm.h:602
qbool(* load_edict)(struct prvm_prog_s *prog, prvm_edict_t *ent)
[INIT] used by PRVM_ED_LoadFromFile
Definition progsvm.h:742
void(* init_cmd)(struct prvm_prog_s *prog)
[INIT] used by PRVM_InitProg
Definition progsvm.h:744
const char ** extensionstring
Definition progsvm.h:705
void(* end_increase_edicts)(struct prvm_prog_s *prog)
[INIT]
Definition progsvm.h:735
int reserved_edicts
number of reserved edicts (allocated from 1)
Definition progsvm.h:678
static void SVVM_end_increase_edicts(prvm_prog_t *prog)
Definition sv_main.c:2170
static void SVVM_init_edict(prvm_prog_t *prog, prvm_edict_t *e)
Definition sv_main.c:2181
static void SV_Prepare_CSQC(void)
Definition sv_main.c:1712
static void SVVM_free_edict(prvm_prog_t *prog, prvm_edict_t *ed)
Definition sv_main.c:2234
prvm_required_field_t sv_reqfields[]
Definition sv_main.c:280
#define SV_REQGLOBALS
Definition sv_main.c:357
#define SV_REQFIELDS
Definition sv_main.c:278
static qbool SVVM_load_edict(prvm_prog_t *prog, prvm_edict_t *ent)
Definition sv_main.c:2292
prvm_required_field_t sv_reqglobals[]
Definition sv_main.c:359
static void SVVM_begin_increase_edicts(prvm_prog_t *prog)
Definition sv_main.c:2164
static void SVVM_count_edicts(prvm_prog_t *prog)
Definition sv_main.c:2264
static void SV_CheckRequiredFuncs(prvm_prog_t *prog, const char *filename)
Definition sv_main.c:273

References absmax, absmin, aiment, ammo_cells, ammo_nails, ammo_rockets, ammo_shells, angles, armortype, armorvalue, avelocity, prvm_prog_t::begin_increase_edicts, prvm_prog_t::builtins, button0, button1, button2, chain, classname, cmd_local, colormap, Con_DPrintf(), coop, prvm_prog_t::count_edicts, currentammo, deadflag, deathmatch, dmg_inflictor, dmg_save, dmg_take, prvm_prog_t::edictprivate_size, effects, prvm_prog_t::end_increase_edicts, enemy, prvm_prog_t::error_cmd, prvm_prog_t::ExecuteProgram, prvm_prog_t::extensionstring, fixangle, prvm_prog_t::flag, flags, force_retouch, found_secrets, frags, frame, frametime, prvm_prog_t::free_edict, goalentity, groundentity, health, Host_Error(), ideal_yaw, idealpitch, impulse, prvm_prog_t::init_cmd, prvm_prog_t::init_edict, items, killed_monsters, prvm_prog_t::limit_edicts, prvm_prog_t::load_edict, prvm_prog_t::loadintoworld, ltime, mapname, MAX_EDICTS, prvm_prog_t::max_edicts, max_health, server_static_t::maxclients, maxs, Mem_AllocPool, message, mins, model, modelindex, movedir, movetype, msg_entity, prvm_prog_t::name, netname, nextthink, noise, noise1, noise2, noise3, NULL, prvm_prog_t::numbuiltins, oldorigin, origin, other, owner, parm1, parm10, parm11, parm12, parm13, parm14, parm15, parm16, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, PROGHEADER_CRC, PROGHEADER_CRC_TENEBRAE, prvm_prog_t::progs_crc, prvm_prog_t::progs_mempool, server_t::protocol, PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PRVM_ED_FindFieldOffset_FromStruct, PRVM_ED_FindGlobalOffset_FromStruct, PRVM_OP_STATE, PRVM_Prog_Init(), PRVM_Prog_Load(), punchangle, prvm_prog_t::reserved_edicts, prvm_prog_t::reset_cmd, self, serverflags, size, skin, solid, sounds, spawnflags, cvar_t::string, sv, SV_CheckRequiredFuncs(), SV_Prepare_CSQC(), sv_progs, SV_REQFIELDS, sv_reqfields, SV_REQGLOBALS, sv_reqglobals, svs, SVVM_begin_increase_edicts(), SVVM_count_edicts(), SVVM_end_increase_edicts(), SVVM_ExecuteProgram(), SVVM_free_edict(), SVVM_init_cmd(), SVVM_init_edict(), SVVM_load_edict(), SVVM_prog, SVVM_reset_cmd(), takedamage, target, targetname, team, teamplay, teleport_time, time, total_monsters, total_secrets, trace_allsolid, trace_endpos, trace_ent, trace_fraction, trace_inopen, trace_inwater, trace_plane_dist, trace_plane_normal, trace_startsolid, v_angle, v_forward, v_right, v_up, velocity, view_ofs, VM_CustomStats_Clear(), vm_sv_builtins, vm_sv_extensions, vm_sv_numbuiltins, waterlevel, watertype, weapon, weaponframe, weaponmodel, world, and yaw_speed.

Referenced by SV_SpawnServer().

◆ SV_VM_Shutdown()

static void SV_VM_Shutdown ( qbool prog_reset)
static

Definition at line 1788 of file sv_main.c.

1789{
1790 prvm_prog_t *prog = SVVM_prog;
1791
1793 {
1796 PRVM_serverfunction(SV_Shutdown) = 0; // prevent it from getting called again
1797 prog->ExecuteProgram(prog, s,"SV_Shutdown() required");
1798 }
1799 if (prog_reset)
1800 PRVM_Prog_Reset(prog);
1801}
unsigned int func_t
Definition pr_comp.h:26
void PRVM_Prog_Reset(prvm_prog_t *prog)
qbool loaded
used to indicate whether a prog is loaded
Definition progsvm.h:710

References prvm_prog_t::ExecuteProgram, prvm_prog_t::loaded, PRVM_Prog_Reset(), PRVM_serverfunction, PRVM_serverglobalfloat, sv, SV_Shutdown(), SVVM_prog, server_t::time, and time.

Referenced by SV_Shutdown(), and SV_SpawnServer().

◆ SVVM_begin_increase_edicts()

static void SVVM_begin_increase_edicts ( prvm_prog_t * prog)
static

Definition at line 2164 of file sv_main.c.

2165{
2166 // links don't survive the transition, so unlink everything
2168}
void World_UnlinkAll(world_t *world)
unlinks all entities (used before reallocation of edicts)
Definition world.c:159

References sv, server_t::world, and World_UnlinkAll().

Referenced by SV_VM_Setup().

◆ SVVM_count_edicts()

static void SVVM_count_edicts ( prvm_prog_t * prog)
static

Definition at line 2264 of file sv_main.c.

2265{
2266 int i;
2267 prvm_edict_t *ent;
2268 int active, models, solid, step;
2269
2270 active = models = solid = step = 0;
2271 for (i=0 ; i<prog->num_edicts ; i++)
2272 {
2273 ent = PRVM_EDICT_NUM(i);
2274 if (ent->free)
2275 continue;
2276 active++;
2277 if (PRVM_serveredictfloat(ent, solid))
2278 solid++;
2279 if (PRVM_serveredictstring(ent, model))
2280 models++;
2282 step++;
2283 }
2284
2285 Con_Printf("num_edicts:%3i\n", prog->num_edicts);
2286 Con_Printf("active :%3i\n", active);
2287 Con_Printf("view :%3i\n", models);
2288 Con_Printf("touch :%3i\n", solid);
2289 Con_Printf("step :%3i\n", step);
2290}
static memexpandablearray_t models
#define MOVETYPE_STEP
gravity, special edge handling, special step based client side interpolation
Definition server.h:316
int num_edicts
copies of some vars that were former read from sv
Definition progsvm.h:671

References Con_Printf(), prvm_edict_t::free, i, model, models, movetype, MOVETYPE_STEP, prvm_prog_t::num_edicts, PRVM_EDICT_NUM, PRVM_serveredictfloat, PRVM_serveredictstring, and solid.

Referenced by SV_VM_Setup().

◆ SVVM_end_increase_edicts()

static void SVVM_end_increase_edicts ( prvm_prog_t * prog)
static

Definition at line 2170 of file sv_main.c.

2171{
2172 int i;
2173 prvm_edict_t *ent;
2174
2175 // link every entity except world
2176 for (i = 1, ent = prog->edicts;i < prog->num_edicts;i++, ent++)
2177 if (!ent->free)
2178 SV_LinkEdict(ent);
2179}
void SV_LinkEdict(prvm_edict_t *ent)
Definition sv_phys.c:804

References prvm_prog_t::edicts, prvm_edict_t::free, i, and SV_LinkEdict().

Referenced by SV_VM_Setup().

◆ SVVM_free_edict()

static void SVVM_free_edict ( prvm_prog_t * prog,
prvm_edict_t * ed )
static

Definition at line 2234 of file sv_main.c.

2235{
2236 int i;
2237 int e;
2238
2239 World_UnlinkEdict(ed); // unlink from world bsp
2240
2245 PRVM_serveredictfloat(ed, skin) = 0;
2251
2252 VM_RemoveEdictSkeleton(prog, ed);
2253#ifdef USEODE
2256#endif
2257 // make sure csqc networking is aware of the removed entity
2258 e = PRVM_NUM_FOR_EDICT(ed);
2259 sv.csqcentityversion[e] = 0;
2260 for (i = 0;i < svs.maxclients;i++)
2261 svs.clients[i].csqcentitysendflags[e] = 0xFFFFFF;
2262}
void VM_RemoveEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed)
Definition prvm_cmds.c:261
unsigned char csqcentityversion[MAX_EDICTS]
legacy support for self.Version based csqc entity networking
Definition server.h:168
void World_UnlinkEdict(prvm_edict_t *ent)
Definition world.c:178
void World_Physics_RemoveJointFromEntity(world_t *world, struct prvm_edict_s *ed)
void World_Physics_RemoveFromEntity(world_t *world, struct prvm_edict_s *ed)

References angles, server_static_t::clients, colormap, server_t::csqcentityversion, frame, i, server_static_t::maxclients, model, modelindex, nextthink, origin, PRVM_NUM_FOR_EDICT, PRVM_serveredictfloat, PRVM_serveredictstring, PRVM_serveredictvector, skin, solid, sv, svs, takedamage, VectorClear, VM_RemoveEdictSkeleton(), server_t::world, World_Physics_RemoveFromEntity(), World_Physics_RemoveJointFromEntity(), and World_UnlinkEdict().

Referenced by SV_VM_Setup().

◆ SVVM_init_edict()

static void SVVM_init_edict ( prvm_prog_t * prog,
prvm_edict_t * e )
static

Definition at line 2181 of file sv_main.c.

2182{
2183 // LadyHavoc: for consistency set these here
2184 int num = PRVM_NUM_FOR_EDICT(e) - 1;
2185
2186 e->priv.server->move = false; // don't move on first frame
2187
2188 if (num >= 0 && num < svs.maxclients)
2189 {
2190 // set colormap and team on newly created player entity
2191 PRVM_serveredictfloat(e, colormap) = num + 1;
2192 PRVM_serveredictfloat(e, team) = (svs.clients[num].colors & 15) + 1;
2193 // set netname/clientcolors back to client values so that
2194 // DP_SV_CLIENTNAME and DP_SV_CLIENTCOLORS will not immediately
2195 // reset them
2198 // NEXUIZ_PLAYERMODEL and NEXUIZ_PLAYERSKIN
2201 // Assign netaddress (IP Address, etc)
2202 if(svs.clients[num].netconnection != NULL)
2203 {
2204 // Acquire Readable Address
2205 LHNETADDRESS_ToString(&svs.clients[num].netconnection->peeraddress, svs.clients[num].netaddress, sizeof(svs.clients[num].netaddress), false);
2207 }
2208 else
2209 PRVM_serveredictstring(e, netaddress) = PRVM_SetEngineString(prog, "null/botclient");
2210 if(svs.clients[num].netconnection != NULL && svs.clients[num].netconnection->crypto.authenticated && svs.clients[num].netconnection->crypto.client_idfp[0])
2211 PRVM_serveredictstring(e, crypto_idfp) = PRVM_SetEngineString(prog, svs.clients[num].netconnection->crypto.client_idfp);
2212 else
2214 PRVM_serveredictfloat(e, crypto_idfp_signed) = (svs.clients[num].netconnection != NULL && svs.clients[num].netconnection->crypto.authenticated && svs.clients[num].netconnection->crypto.client_issigned);
2215 if(svs.clients[num].netconnection != NULL && svs.clients[num].netconnection->crypto.authenticated && svs.clients[num].netconnection->crypto.client_keyfp[0])
2216 PRVM_serveredictstring(e, crypto_keyfp) = PRVM_SetEngineString(prog, svs.clients[num].netconnection->crypto.client_keyfp);
2217 else
2219 if(svs.clients[num].netconnection != NULL && svs.clients[num].netconnection->crypto.authenticated && svs.clients[num].netconnection->crypto.server_keyfp[0])
2220 PRVM_serveredictstring(e, crypto_mykeyfp) = PRVM_SetEngineString(prog, svs.clients[num].netconnection->crypto.server_keyfp);
2221 else
2223 if(svs.clients[num].netconnection != NULL && svs.clients[num].netconnection->crypto.authenticated && svs.clients[num].netconnection->crypto.use_aes)
2225 else
2227 if(svs.clients[num].netconnection != NULL && svs.clients[num].netconnection->crypto.authenticated)
2229 else
2231 }
2232}
string crypto_keyfp
string playerskin
string crypto_encryptmethod
string netaddress
string crypto_idfp
float crypto_idfp_signed
string crypto_mykeyfp
string crypto_signmethod
string playermodel
float clientcolors

References clientcolors, server_static_t::clients, colormap, crypto_encryptmethod, crypto_idfp, crypto_idfp_signed, crypto_keyfp, crypto_mykeyfp, crypto_signmethod, LHNETADDRESS_ToString(), server_static_t::maxclients, netaddress, netname, NULL, playermodel, playerskin, prvm_edict_t::priv, PRVM_NUM_FOR_EDICT, PRVM_serveredictfloat, PRVM_serveredictstring, PRVM_SetEngineString(), prvm_edict_t::server, svs, and team.

Referenced by SV_VM_Setup().

◆ SVVM_load_edict()

static qbool SVVM_load_edict ( prvm_prog_t * prog,
prvm_edict_t * ent )
static

Definition at line 2292 of file sv_main.c.

2293{
2294 // remove things from different skill levels or deathmatch
2295 if (gamemode != GAME_TRANSFUSION) //Transfusion does this in QC
2296 {
2297 if (deathmatch.integer)
2298 {
2300 {
2301 return false;
2302 }
2303 }
2304 else if ((current_skill <= 0 && ((int)PRVM_serveredictfloat(ent, spawnflags) & SPAWNFLAG_NOT_EASY ))
2307 {
2308 return false;
2309 }
2310 }
2311 return true;
2312}
@ GAME_TRANSFUSION
Definition com_game.h:35
#define SPAWNFLAG_NOT_EASY
Definition server.h:371
#define SPAWNFLAG_NOT_DEATHMATCH
Definition server.h:374
#define SPAWNFLAG_NOT_MEDIUM
Definition server.h:372
#define SPAWNFLAG_NOT_HARD
Definition server.h:373

References current_skill, deathmatch, GAME_TRANSFUSION, gamemode, cvar_t::integer, PRVM_serveredictfloat, SPAWNFLAG_NOT_DEATHMATCH, SPAWNFLAG_NOT_EASY, SPAWNFLAG_NOT_HARD, SPAWNFLAG_NOT_MEDIUM, and spawnflags.

Referenced by SV_VM_Setup().

Variable Documentation

◆ coop

cvar_t coop = {CF_SERVER, "coop","0", "coop mode, 0 = no coop, 1 = coop mode, multiple players playing through the singleplayer game (coop mode also shuts off deathmatch)"}

Definition at line 43 of file sv_main.c.

43{CF_SERVER, "coop","0", "coop mode, 0 = no coop, 1 = coop mode, multiple players playing through the singleplayer game (coop mode also shuts off deathmatch)"};
#define CF_SERVER
cvar/command that only the server can change/execute
Definition cmd.h:49

Referenced by SV_Init(), SV_SendServerinfo(), SV_ServerOptions(), SV_SpawnServer(), and SV_VM_Setup().

◆ cutscene

cvar_t cutscene = {CF_SERVER, "cutscene", "1", "enables cutscenes in nehahra, can be used by other mods"}

Definition at line 209 of file sv_main.c.

209{CF_SERVER, "cutscene", "1", "enables cutscenes in nehahra, can be used by other mods"};

Referenced by SV_Init().

◆ deathmatch

cvar_t deathmatch = {CF_SERVER, "deathmatch","0", "deathmatch mode, values depend on mod but typically 0 = no deathmatch, 1 = normal deathmatch with respawning weapons, 2 = weapons stay (players can only pick up new weapons)"}

Definition at line 44 of file sv_main.c.

44{CF_SERVER, "deathmatch","0", "deathmatch mode, values depend on mod but typically 0 = no deathmatch, 1 = normal deathmatch with respawning weapons, 2 = weapons stay (players can only pick up new weapons)"};

Referenced by SV_Init(), SV_SendServerinfo(), SV_ServerOptions(), SV_SpawnServer(), SV_VM_Setup(), and SVVM_load_edict().

◆ fraglimit

cvar_t fraglimit = {CF_SERVER | CF_NOTIFY, "fraglimit","0", "ends level if this many frags is reached by any player"}

Definition at line 45 of file sv_main.c.

45{CF_SERVER | CF_NOTIFY, "fraglimit","0", "ends level if this many frags is reached by any player"};
#define CF_NOTIFY
cvar should trigger a chat notification to all connected clients when changed
Definition cmd.h:55

Referenced by M_GameOptions_Draw(), M_NetStart_Change(), SV_Init(), and SV_WriteClientdataToMessage().

◆ gamecfg

cvar_t gamecfg = {CF_SERVER, "gamecfg", "0", "unused cvar in quake, can be used by mods"}

Definition at line 46 of file sv_main.c.

46{CF_SERVER, "gamecfg", "0", "unused cvar in quake, can be used by mods"};

Referenced by SV_Init().

◆ halflifebsp

cvar_t halflifebsp = {CF_SERVER, "halflifebsp", "0", "indicates the current map is hlbsp format (useful to know because of different bounding box sizes)"}

Definition at line 215 of file sv_main.c.

215{CF_SERVER, "halflifebsp", "0", "indicates the current map is hlbsp format (useful to know because of different bounding box sizes)"};

Referenced by SV_Init(), and SV_SpawnServer().

◆ host_client

client_t* host_client

◆ host_framerate

cvar_t host_framerate
extern

Definition at line 44 of file host.c.

44{CF_CLIENT | CF_SERVER, "host_framerate","0", "locks frame timing to this value in seconds, 0.05 is 20fps for example, note that this can easily run too fast, use cl_maxfps if you want to limit your framerate instead, or sys_ticrate to limit server speed"};

Referenced by Host_InitLocal(), SV_Frame(), and SV_ThreadFunc().

◆ host_limitlocal

cvar_t host_limitlocal = {CF_SERVER, "host_limitlocal", "0", "whether to apply rate limiting to the local player in a listen server (only useful for testing)"}

Definition at line 150 of file sv_main.c.

150{CF_SERVER, "host_limitlocal", "0", "whether to apply rate limiting to the local player in a listen server (only useful for testing)"};

Referenced by SV_Init(), and SV_SendClientDatagram().

◆ host_timescale

cvar_t host_timescale = {CF_CLIENT | CF_SERVER, "host_timescale", "1.0", "controls game speed, 0.5 is half speed, 2 is double speed"}

Definition at line 53 of file sv_main.c.

53{CF_CLIENT | CF_SERVER, "host_timescale", "1.0", "controls game speed, 0.5 is half speed, 2 is double speed"};

Referenced by CL_Frame(), CL_UpdateMoveVars(), SV_Frame(), SV_Init(), SV_ThreadFunc(), and SV_WriteClientdataToMessage().

◆ nehx00

cvar_t nehx00 = {CF_SERVER, "nehx00", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 189 of file sv_main.c.

189{CF_SERVER, "nehx00", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx01

cvar_t nehx01 = {CF_SERVER, "nehx01", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 190 of file sv_main.c.

190{CF_SERVER, "nehx01", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx02

cvar_t nehx02 = {CF_SERVER, "nehx02", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 191 of file sv_main.c.

191{CF_SERVER, "nehx02", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx03

cvar_t nehx03 = {CF_SERVER, "nehx03", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 192 of file sv_main.c.

192{CF_SERVER, "nehx03", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx04

cvar_t nehx04 = {CF_SERVER, "nehx04", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 193 of file sv_main.c.

193{CF_SERVER, "nehx04", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx05

cvar_t nehx05 = {CF_SERVER, "nehx05", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 194 of file sv_main.c.

194{CF_SERVER, "nehx05", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx06

cvar_t nehx06 = {CF_SERVER, "nehx06", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 195 of file sv_main.c.

195{CF_SERVER, "nehx06", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx07

cvar_t nehx07 = {CF_SERVER, "nehx07", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 196 of file sv_main.c.

196{CF_SERVER, "nehx07", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx08

cvar_t nehx08 = {CF_SERVER, "nehx08", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 197 of file sv_main.c.

197{CF_SERVER, "nehx08", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx09

cvar_t nehx09 = {CF_SERVER, "nehx09", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 198 of file sv_main.c.

198{CF_SERVER, "nehx09", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx10

cvar_t nehx10 = {CF_SERVER, "nehx10", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 199 of file sv_main.c.

199{CF_SERVER, "nehx10", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx11

cvar_t nehx11 = {CF_SERVER, "nehx11", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 200 of file sv_main.c.

200{CF_SERVER, "nehx11", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx12

cvar_t nehx12 = {CF_SERVER, "nehx12", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 201 of file sv_main.c.

201{CF_SERVER, "nehx12", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx13

cvar_t nehx13 = {CF_SERVER, "nehx13", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 202 of file sv_main.c.

202{CF_SERVER, "nehx13", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx14

cvar_t nehx14 = {CF_SERVER, "nehx14", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 203 of file sv_main.c.

203{CF_SERVER, "nehx14", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx15

cvar_t nehx15 = {CF_SERVER, "nehx15", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 204 of file sv_main.c.

204{CF_SERVER, "nehx15", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx16

cvar_t nehx16 = {CF_SERVER, "nehx16", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 205 of file sv_main.c.

205{CF_SERVER, "nehx16", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx17

cvar_t nehx17 = {CF_SERVER, "nehx17", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 206 of file sv_main.c.

206{CF_SERVER, "nehx17", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx18

cvar_t nehx18 = {CF_SERVER, "nehx18", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 207 of file sv_main.c.

207{CF_SERVER, "nehx18", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ nehx19

cvar_t nehx19 = {CF_SERVER, "nehx19", "0", "nehahra data storage cvar (used in singleplayer)"}

Definition at line 208 of file sv_main.c.

208{CF_SERVER, "nehx19", "0", "nehahra data storage cvar (used in singleplayer)"};

Referenced by SV_Init().

◆ net_connecttimeout

cvar_t net_connecttimeout
extern

Definition at line 82 of file netconn.c.

82{CF_CLIENT | CF_SERVER, "net_connecttimeout","15", "after requesting a connection, the client must reply within this many seconds or be dropped (cuts down on connect floods). Must be above 10 seconds."};

Referenced by NetConn_Init(), NetConn_Open(), NetConn_ServerParsePacket(), and SV_SendServerinfo().

◆ noexit

cvar_t noexit = {CF_SERVER | CF_NOTIFY, "noexit","0", "kills anyone attempting to use an exit"}

Definition at line 47 of file sv_main.c.

47{CF_SERVER | CF_NOTIFY, "noexit","0", "kills anyone attempting to use an exit"};

Referenced by SV_Init().

◆ nomonsters

cvar_t nomonsters = {CF_SERVER, "nomonsters", "0", "unused cvar in quake, can be used by mods"}

Definition at line 48 of file sv_main.c.

48{CF_SERVER, "nomonsters", "0", "unused cvar in quake, can be used by mods"};

Referenced by SV_Init().

◆ pausable

cvar_t pausable = {CF_SERVER, "pausable","1", "allow players to pause or not (otherwise, only the server admin can)"}

Definition at line 49 of file sv_main.c.

49{CF_SERVER, "pausable","1", "allow players to pause or not (otherwise, only the server admin can)"};

Referenced by SV_Init(), and SV_Pause_f().

◆ pr_checkextension

cvar_t pr_checkextension = {CF_SERVER | CF_READONLY, "pr_checkextension", "1", "indicates to QuakeC that the standard quakec extensions system is available (if 0, quakec should not attempt to use extensions)"}

Definition at line 50 of file sv_main.c.

50{CF_SERVER | CF_READONLY, "pr_checkextension", "1", "indicates to QuakeC that the standard quakec extensions system is available (if 0, quakec should not attempt to use extensions)"};
#define CF_READONLY
cvar cannot be changed from the console or the command buffer, and is considered CF_PERSISTENT
Definition cmd.h:54

Referenced by SV_Init().

◆ samelevel

cvar_t samelevel = {CF_SERVER | CF_NOTIFY, "samelevel","0", "repeats same level if level ends (due to timelimit or someone hitting an exit)"}

Definition at line 51 of file sv_main.c.

51{CF_SERVER | CF_NOTIFY, "samelevel","0", "repeats same level if level ends (due to timelimit or someone hitting an exit)"};

Referenced by SV_Init().

◆ saved1

cvar_t saved1 = {CF_SERVER | CF_ARCHIVE, "saved1", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"}

Definition at line 178 of file sv_main.c.

178{CF_SERVER | CF_ARCHIVE, "saved1", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
Definition cmd.h:53

Referenced by SV_Init().

◆ saved2

cvar_t saved2 = {CF_SERVER | CF_ARCHIVE, "saved2", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"}

Definition at line 179 of file sv_main.c.

179{CF_SERVER | CF_ARCHIVE, "saved2", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};

Referenced by SV_Init().

◆ saved3

cvar_t saved3 = {CF_SERVER | CF_ARCHIVE, "saved3", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"}

Definition at line 180 of file sv_main.c.

180{CF_SERVER | CF_ARCHIVE, "saved3", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};

Referenced by SV_Init().

◆ saved4

cvar_t saved4 = {CF_SERVER | CF_ARCHIVE, "saved4", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"}

Definition at line 181 of file sv_main.c.

181{CF_SERVER | CF_ARCHIVE, "saved4", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};

Referenced by SV_Init().

◆ savedgamecfg

cvar_t savedgamecfg = {CF_SERVER | CF_ARCHIVE, "savedgamecfg", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"}

Definition at line 182 of file sv_main.c.

182{CF_SERVER | CF_ARCHIVE, "savedgamecfg", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};

Referenced by SV_Init().

◆ scr_centertime_off

float scr_centertime_off
extern

Definition at line 129 of file cl_screen.c.

Referenced by SCR_CenterPrint(), SCR_CheckDrawCenterString(), and SV_SpawnServer().

◆ scratch1

cvar_t scratch1 = {CF_SERVER, "scratch1", "0", "unused cvar in quake, can be used by mods"}

Definition at line 183 of file sv_main.c.

183{CF_SERVER, "scratch1", "0", "unused cvar in quake, can be used by mods"};

Referenced by SV_Init().

◆ scratch2

cvar_t scratch2 = {CF_SERVER,"scratch2", "0", "unused cvar in quake, can be used by mods"}

Definition at line 184 of file sv_main.c.

184{CF_SERVER,"scratch2", "0", "unused cvar in quake, can be used by mods"};

Referenced by SV_Init().

◆ scratch3

cvar_t scratch3 = {CF_SERVER, "scratch3", "0", "unused cvar in quake, can be used by mods"}

Definition at line 185 of file sv_main.c.

185{CF_SERVER, "scratch3", "0", "unused cvar in quake, can be used by mods"};

Referenced by SV_Init().

◆ scratch4

cvar_t scratch4 = {CF_SERVER, "scratch4", "0", "unused cvar in quake, can be used by mods"}

Definition at line 186 of file sv_main.c.

186{CF_SERVER, "scratch4", "0", "unused cvar in quake, can be used by mods"};

Referenced by SV_Init().

◆ skill

cvar_t skill = {CF_SERVER, "skill","1", "difficulty level of game, affects monster layouts in levels, 0 = easy, 1 = normal, 2 = hard, 3 = nightmare (same layout as hard but monsters fire twice)"}

Definition at line 52 of file sv_main.c.

52{CF_SERVER, "skill","1", "difficulty level of game, affects monster layouts in levels, 0 = easy, 1 = normal, 2 = hard, 3 = nightmare (same layout as hard but monsters fire twice)"};

Referenced by M_GameOptions_Draw(), M_NetStart_Change(), SV_Init(), SV_Loadgame_f(), and SV_SpawnServer().

◆ standardeffectnames

const char* standardeffectnames[EFFECT_TOTAL]
static

Definition at line 232 of file sv_main.c.

233{
234 "",
235 "TE_GUNSHOT",
236 "TE_GUNSHOTQUAD",
237 "TE_SPIKE",
238 "TE_SPIKEQUAD",
239 "TE_SUPERSPIKE",
240 "TE_SUPERSPIKEQUAD",
241 "TE_WIZSPIKE",
242 "TE_KNIGHTSPIKE",
243 "TE_EXPLOSION",
244 "TE_EXPLOSIONQUAD",
245 "TE_TAREXPLOSION",
246 "TE_TELEPORT",
247 "TE_LAVASPLASH",
248 "TE_SMALLFLASH",
249 "TE_FLAMEJET",
250 "EF_FLAME",
251 "TE_BLOOD",
252 "TE_SPARK",
253 "TE_PLASMABURN",
254 "TE_TEI_G3",
255 "TE_TEI_SMOKE",
256 "TE_TEI_BIGEXPLOSION",
257 "TE_TEI_PLASMAHIT",
258 "EF_STARDUST",
259 "TR_ROCKET",
260 "TR_GRENADE",
261 "TR_BLOOD",
262 "TR_WIZSPIKE",
263 "TR_SLIGHTBLOOD",
264 "TR_KNIGHTSPIKE",
265 "TR_VORESPIKE",
266 "TR_NEHAHRASMOKE",
267 "TR_NEXUIZPLASMA",
268 "TR_GLOWTRAIL",
269 "SVC_PARTICLE"
270};

Referenced by SV_ParticleEffectIndex().

◆ sv

local server

Definition at line 223 of file sv_main.c.

Referenced by CL_BeginDownloads(), CL_KeepaliveMessage(), CL_ParseServerInfo(), CL_Startdemos_f(), Cvar_SetQuick_Internal(), DropPunchAngle(), droptofloor_bsp_failcond(), EntityFrame5_WriteFrame(), EntityFrameCSQC_WriteFrame(), EntityFrameQuake_WriteFrame(), EntityState5_WriteUpdate(), EntityState_WriteFields(), FS_GameDir_f(), Host_Frame(), Host_Init(), M_GameOptions_Key(), M_Main_Key(), M_Menu_Main_f(), M_Menu_Save_f(), M_SinglePlayer_Key(), M_Transfusion_Skill_Key(), ModList_Enable(), Net_Heartbeat_f(), NetConn_BuildStatusResponse(), NetConn_ClientFrame(), NetConn_Close(), NetConn_Heartbeat(), NetConn_IsLocalGame(), NetConn_ServerParsePacket(), NetConn_sv_netport_Callback(), PHYS_NudgeOutOfSolid(), PHYS_TestEntityPosition(), PrintStats(), Protocol_WriteStatsReliable(), PRVM_ED_CallPostspawnFunction(), PRVM_ED_CallPrespawnFunction(), PRVM_ED_CallSpawnFunction(), PRVM_GarbageCollection(), QW_CL_RequestNextDownload(), R_DrawDebugModel(), Sbar_ShowFPS(), SCR_DrawNetGraph(), SCR_SetUpToDrawConsole(), SV_Accelerate(), SV_AirAccelerate(), SV_AirMove(), SV_AreaStats_f(), SV_Begin_f(), SV_CanSeeBox(), SV_Changelevel_f(), SV_CheckContentsTransition(), SV_Color_f(), SV_ConnectClient(), SV_CreateBaseline(), SV_Download_f(), SV_DropClient(), SV_EntitiesInBox(), SV_ExecuteClientMoves(), SV_FlushBroadcastMessages(), SV_Frame(), SV_GetEntityLocalTagMatrix(), SV_GetModelByIndex(), SV_GetModelFromEdict(), SV_GetTagMatrix(), SV_Gravity(), SV_Impact(), SV_IsLocalServer(), SV_Kick_f(), SV_Kill_f(), SV_LinkEdict(), SV_LinkEdict_TouchAreaGrid_Call(), SV_Loadgame_f(), SV_Map_f(), SV_MarkWriteEntityStateToClient(), SV_MaxPlayers_f(), SV_ModelIndex(), SV_Name(), SV_ParticleEffectIndex(), SV_Pause_f(), SV_Physics(), SV_Physics_ClientEntity(), SV_Physics_ClientEntity_NoThink(), SV_Physics_ClientEntity_PostThink(), SV_Physics_ClientEntity_PreThink(), SV_Physics_ClientMove(), SV_Physics_Entity(), SV_Physics_Pusher(), SV_Physics_Step(), SV_Physics_Toss(), SV_Ping_f(), SV_Pings_f(), SV_PlayerPhysics(), SV_PointSuperContents(), SV_Prepare_CSQC(), SV_PrepareEntitiesForSending(), SV_PrepareEntityForSending(), SV_PreSpawn_f(), SV_PushMove(), SV_ReadClientMessage(), SV_ReadClientMove(), SV_Restart_f(), SV_RunThink(), SV_SaveEntFile_f(), SV_Savegame_f(), SV_Savegame_to(), SV_SaveSpawnparms(), SV_SendClientDatagram(), SV_SendClientMessages(), SV_SendCvar_f(), SV_SendServerinfo(), SV_Shutdown(), SV_SoundIndex(), SV_Spawn_f(), SV_SpawnServer(), SV_StartEffect(), SV_StartParticle(), SV_StartPointSound(), SV_StartSound(), SV_Status_f(), SV_ThreadFunc(), SV_TimingReport(), SV_TraceBox(), SV_TraceLine(), SV_TracePoint(), SV_UpdateToReliableMessages(), SV_UserFriction(), SV_Viewframe_f(), SV_Viewmodel_f(), SV_Viewnext_f(), SV_Viewprev_f(), SV_VM_ConsoleCommand(), SV_VM_Setup(), SV_VM_Shutdown(), SV_WalkMove(), SV_WaterJump(), SV_WaterMove(), SV_WriteClientdataToMessage(), SV_WriteEntitiesToClient(), SVVM_begin_increase_edicts(), SVVM_free_edict(), SVVM_reset_cmd(), Sys_Error(), VM_bprint(), VM_changelevel(), VM_isserver(), VM_M_WriteAngle(), VM_M_WriteCoord(), VM_M_WriteDest(), VM_sprint(), VM_SV_ambientsound(), VM_SV_checkclient(), VM_SV_checkpvs(), VM_SV_droptofloor(), VM_SV_getlight(), VM_SV_gettaginfo(), VM_SV_lightstyle(), VM_SV_makestatic(), VM_SV_modelnameforindex(), VM_SV_newcheckclient(), VM_SV_pointparticles(), VM_SV_setcolor(), VM_SV_setmodel(), VM_SV_setmodelindex(), VM_SV_setpause(), VM_SV_skel_build(), VM_SV_te_beam(), VM_SV_te_blood(), VM_SV_te_bloodshower(), VM_SV_te_customflash(), VM_SV_te_explosion(), VM_SV_te_explosion2(), VM_SV_te_explosionquad(), VM_SV_te_explosionrgb(), VM_SV_te_flamejet(), VM_SV_te_gunshot(), VM_SV_te_gunshotquad(), VM_SV_te_knightspike(), VM_SV_te_lavasplash(), VM_SV_te_lightning1(), VM_SV_te_lightning2(), VM_SV_te_lightning3(), VM_SV_te_particlecube(), VM_SV_te_particlerain(), VM_SV_te_particlesnow(), VM_SV_te_plasmaburn(), VM_SV_te_smallflash(), VM_SV_te_spark(), VM_SV_te_spike(), VM_SV_te_spikequad(), VM_SV_te_superspike(), VM_SV_te_superspikequad(), VM_SV_te_tarexplosion(), VM_SV_te_teleport(), VM_SV_te_wizspike(), VM_SV_trailparticles(), VM_SV_WriteAngle(), VM_SV_WriteCoord(), and WriteDest().

◆ sv_accelerate

cvar_t sv_accelerate = {CF_SERVER, "sv_accelerate", "10", "rate at which a player accelerates to sv_maxspeed"}

Definition at line 55 of file sv_main.c.

55{CF_SERVER, "sv_accelerate", "10", "rate at which a player accelerates to sv_maxspeed"};

Referenced by SV_Accelerate(), SV_AirAccelerate(), SV_Init(), SV_WaterMove(), and SV_WriteClientdataToMessage().

◆ sv_aim

cvar_t sv_aim = {CF_SERVER | CF_ARCHIVE, "sv_aim", "2", "maximum cosine angle for quake's vertical autoaim, a value above 1 completely disables the autoaim, quake used 0.93"}

Definition at line 56 of file sv_main.c.

56{CF_SERVER | CF_ARCHIVE, "sv_aim", "2", "maximum cosine angle for quake's vertical autoaim, a value above 1 completely disables the autoaim, quake used 0.93"};

Referenced by SV_Init(), and VM_SV_aim().

◆ sv_airaccel_qw

cvar_t sv_airaccel_qw = {CF_SERVER, "sv_airaccel_qw", "1", "ratio of QW-style air control as opposed to simple acceleration; when < 0, the speed is clamped against the maximum allowed forward speed after the move"}

Definition at line 57 of file sv_main.c.

57{CF_SERVER, "sv_airaccel_qw", "1", "ratio of QW-style air control as opposed to simple acceleration; when < 0, the speed is clamped against the maximum allowed forward speed after the move"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_airaccel_qw_stretchfactor

cvar_t sv_airaccel_qw_stretchfactor = {CF_SERVER, "sv_airaccel_qw_stretchfactor", "0", "when set, the maximum acceleration increase the player may get compared to forward-acceleration when strafejumping"}

Definition at line 58 of file sv_main.c.

58{CF_SERVER, "sv_airaccel_qw_stretchfactor", "0", "when set, the maximum acceleration increase the player may get compared to forward-acceleration when strafejumping"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_airaccel_sideways_friction

cvar_t sv_airaccel_sideways_friction = {CF_SERVER, "sv_airaccel_sideways_friction", "", "anti-sideways movement stabilization (reduces speed gain when zigzagging); when < 0, only so much friction is applied that braking (by accelerating backwards) cannot be stronger"}

Definition at line 59 of file sv_main.c.

59{CF_SERVER, "sv_airaccel_sideways_friction", "", "anti-sideways movement stabilization (reduces speed gain when zigzagging); when < 0, only so much friction is applied that braking (by accelerating backwards) cannot be stronger"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_airaccelerate

cvar_t sv_airaccelerate = {CF_SERVER, "sv_airaccelerate", "-1", "rate at which a player accelerates to sv_maxairspeed while in the air, if less than 0 the sv_accelerate variable is used instead"}

Definition at line 60 of file sv_main.c.

60{CF_SERVER, "sv_airaccelerate", "-1", "rate at which a player accelerates to sv_maxairspeed while in the air, if less than 0 the sv_accelerate variable is used instead"};

Referenced by SV_AirAccelerate(), SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_aircontrol

cvar_t sv_aircontrol = {CF_SERVER, "sv_aircontrol", "0", "CPMA-style air control"}

Definition at line 66 of file sv_main.c.

66{CF_SERVER, "sv_aircontrol", "0", "CPMA-style air control"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_aircontrol_penalty

cvar_t sv_aircontrol_penalty = {CF_SERVER, "sv_aircontrol_penalty", "0", "deceleration while using CPMA-style air control"}

Definition at line 68 of file sv_main.c.

68{CF_SERVER, "sv_aircontrol_penalty", "0", "deceleration while using CPMA-style air control"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_aircontrol_power

cvar_t sv_aircontrol_power = {CF_SERVER, "sv_aircontrol_power", "2", "CPMA-style air control exponent"}

Definition at line 67 of file sv_main.c.

67{CF_SERVER, "sv_aircontrol_power", "2", "CPMA-style air control exponent"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_airspeedlimit_nonqw

cvar_t sv_airspeedlimit_nonqw = {CF_SERVER, "sv_airspeedlimit_nonqw", "0", "when set, this is a soft speed limit while in air when using airaccel_qw not equal to 1"}

Definition at line 62 of file sv_main.c.

62{CF_SERVER, "sv_airspeedlimit_nonqw", "0", "when set, this is a soft speed limit while in air when using airaccel_qw not equal to 1"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_airstopaccelerate

cvar_t sv_airstopaccelerate = {CF_SERVER, "sv_airstopaccelerate", "0", "when set, replacement for sv_airaccelerate when moving backwards"}

Definition at line 61 of file sv_main.c.

61{CF_SERVER, "sv_airstopaccelerate", "0", "when set, replacement for sv_airaccelerate when moving backwards"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_airstrafeaccel_qw

cvar_t sv_airstrafeaccel_qw = {CF_SERVER, "sv_airstrafeaccel_qw", "0", "when set, replacement for sv_airaccel_qw when just strafing"}

Definition at line 65 of file sv_main.c.

65{CF_SERVER, "sv_airstrafeaccel_qw", "0", "when set, replacement for sv_airaccel_qw when just strafing"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_airstrafeaccelerate

cvar_t sv_airstrafeaccelerate = {CF_SERVER, "sv_airstrafeaccelerate", "0", "when set, replacement for sv_airaccelerate when just strafing"}

Definition at line 63 of file sv_main.c.

63{CF_SERVER, "sv_airstrafeaccelerate", "0", "when set, replacement for sv_airaccelerate when just strafing"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_allowdownloads

cvar_t sv_allowdownloads = {CF_SERVER, "sv_allowdownloads", "1", "whether to allow clients to download files from the server (does not affect http downloads)"}

Definition at line 69 of file sv_main.c.

69{CF_SERVER, "sv_allowdownloads", "1", "whether to allow clients to download files from the server (does not affect http downloads)"};

Referenced by SV_Download_f(), and SV_Init().

◆ sv_allowdownloads_archive

cvar_t sv_allowdownloads_archive = {CF_SERVER, "sv_allowdownloads_archive", "0", "whether to allow downloads of archives (pak/pk3)"}

Definition at line 70 of file sv_main.c.

70{CF_SERVER, "sv_allowdownloads_archive", "0", "whether to allow downloads of archives (pak/pk3)"};

Referenced by SV_Download_f(), and SV_Init().

◆ sv_allowdownloads_config

cvar_t sv_allowdownloads_config = {CF_SERVER, "sv_allowdownloads_config", "0", "whether to allow downloads of config files (cfg)"}

Definition at line 71 of file sv_main.c.

71{CF_SERVER, "sv_allowdownloads_config", "0", "whether to allow downloads of config files (cfg)"};

Referenced by SV_Download_f(), and SV_Init().

◆ sv_allowdownloads_dlcache

cvar_t sv_allowdownloads_dlcache = {CF_SERVER, "sv_allowdownloads_dlcache", "0", "whether to allow downloads of dlcache files (dlcache/)"}

Definition at line 72 of file sv_main.c.

72{CF_SERVER, "sv_allowdownloads_dlcache", "0", "whether to allow downloads of dlcache files (dlcache/)"};

Referenced by SV_Download_f(), and SV_Init().

◆ sv_allowdownloads_inarchive

cvar_t sv_allowdownloads_inarchive = {CF_SERVER, "sv_allowdownloads_inarchive", "0", "whether to allow downloads from archives (pak/pk3)"}

Definition at line 73 of file sv_main.c.

73{CF_SERVER, "sv_allowdownloads_inarchive", "0", "whether to allow downloads from archives (pak/pk3)"};

Referenced by SV_Download_f(), and SV_Init().

◆ sv_areadebug

cvar_t sv_areadebug = {CF_SERVER, "sv_areadebug", "0", "disables physics culling for debugging purposes (only for development)"}

Definition at line 164 of file sv_main.c.

164{CF_SERVER, "sv_areadebug", "0", "disables physics culling for debugging purposes (only for development)"};

Referenced by SV_EntitiesInBox(), and SV_Init().

◆ sv_areagrid_link_SOLID_NOT

cvar_t sv_areagrid_link_SOLID_NOT = {CF_SERVER | CF_NOTIFY, "sv_areagrid_link_SOLID_NOT", "1", "set to 0 to prevent SOLID_NOT entities from being linked to the area grid, and unlink any that are already linked (in the code paths that would otherwise link them), for better performance"}

Definition at line 74 of file sv_main.c.

74{CF_SERVER | CF_NOTIFY, "sv_areagrid_link_SOLID_NOT", "1", "set to 0 to prevent SOLID_NOT entities from being linked to the area grid, and unlink any that are already linked (in the code paths that would otherwise link them), for better performance"};

Referenced by SV_Init(), and SV_LinkEdict().

◆ sv_areagrid_mingridsize

cvar_t sv_areagrid_mingridsize = {CF_SERVER | CF_NOTIFY, "sv_areagrid_mingridsize", "128", "minimum areagrid cell size, smaller values work better for lots of small objects, higher values for large objects"}

Definition at line 75 of file sv_main.c.

75{CF_SERVER | CF_NOTIFY, "sv_areagrid_mingridsize", "128", "minimum areagrid cell size, smaller values work better for lots of small objects, higher values for large objects"};

Referenced by SV_Init(), and World_SetSize().

◆ sv_autodemo_perclient

cvar_t sv_autodemo_perclient = {CF_SERVER | CF_ARCHIVE, "sv_autodemo_perclient", "0", "set to 1 to enable autorecorded per-client demos (they'll start to record at the beginning of a match); set it to 2 to also record client->server packets (for debugging)"}

Definition at line 211 of file sv_main.c.

211{CF_SERVER | CF_ARCHIVE, "sv_autodemo_perclient", "0", "set to 1 to enable autorecorded per-client demos (they'll start to record at the beginning of a match); set it to 2 to also record client->server packets (for debugging)"};

Referenced by SV_Init(), SV_ReadClientMessage(), and SV_SendServerinfo().

◆ sv_autodemo_perclient_discardable

cvar_t sv_autodemo_perclient_discardable = {CF_SERVER | CF_ARCHIVE, "sv_autodemo_perclient_discardable", "0", "Allow game code to decide whether a demo should be kept or discarded."}

Definition at line 213 of file sv_main.c.

213{CF_SERVER | CF_ARCHIVE, "sv_autodemo_perclient_discardable", "0", "Allow game code to decide whether a demo should be kept or discarded."};

Referenced by SV_Init(), and SV_StopDemoRecording().

◆ sv_autodemo_perclient_nameformat

cvar_t sv_autodemo_perclient_nameformat = {CF_SERVER | CF_ARCHIVE, "sv_autodemo_perclient_nameformat", "sv_autodemos/%Y-%m-%d_%H-%M", "The format of the sv_autodemo_perclient filename, followed by the map name, the client number and the IP address + port number, separated by underscores (the date is encoded using strftime escapes)" }

Definition at line 212 of file sv_main.c.

212{CF_SERVER | CF_ARCHIVE, "sv_autodemo_perclient_nameformat", "sv_autodemos/%Y-%m-%d_%H-%M", "The format of the sv_autodemo_perclient filename, followed by the map name, the client number and the IP address + port number, separated by underscores (the date is encoded using strftime escapes)" };

Referenced by SV_Init(), and SV_SendServerinfo().

◆ sv_checkforpacketsduringsleep

cvar_t sv_checkforpacketsduringsleep = {CF_SERVER, "sv_checkforpacketsduringsleep", "0", "uses select() function to wait between frames which can be interrupted by packets being received, instead of Sleep()/usleep()/SDL_Sleep() functions which do not check for packets"}

Definition at line 76 of file sv_main.c.

76{CF_SERVER, "sv_checkforpacketsduringsleep", "0", "uses select() function to wait between frames which can be interrupted by packets being received, instead of Sleep()/usleep()/SDL_Sleep() functions which do not check for packets"};

Referenced by SV_Init(), and Sys_Sleep().

◆ sv_clmovement_enable

cvar_t sv_clmovement_enable = {CF_SERVER, "sv_clmovement_enable", "1", "whether to allow clients to use cl_movement prediction, which can cause choppy movement on the server which may annoy other players"}

Definition at line 77 of file sv_main.c.

77{CF_SERVER, "sv_clmovement_enable", "1", "whether to allow clients to use cl_movement prediction, which can cause choppy movement on the server which may annoy other players"};

Referenced by SV_ExecuteClientMoves(), and SV_Init().

◆ sv_clmovement_inputtimeout

cvar_t sv_clmovement_inputtimeout = {CF_SERVER, "sv_clmovement_inputtimeout", "0.1", "when a client does not send input for this many seconds (max 0.1), force them to move anyway (unlike QuakeWorld)"}

Definition at line 80 of file sv_main.c.

80{CF_SERVER, "sv_clmovement_inputtimeout", "0.1", "when a client does not send input for this many seconds (max 0.1), force them to move anyway (unlike QuakeWorld)"};

Referenced by SV_ExecuteClientMoves(), and SV_Init().

◆ sv_clmovement_minping

cvar_t sv_clmovement_minping = {CF_SERVER, "sv_clmovement_minping", "0", "if client ping is below this time in milliseconds, then their ability to use cl_movement prediction is disabled for a while (as they don't need it)"}

Definition at line 78 of file sv_main.c.

78{CF_SERVER, "sv_clmovement_minping", "0", "if client ping is below this time in milliseconds, then their ability to use cl_movement prediction is disabled for a while (as they don't need it)"};

Referenced by SV_ExecuteClientMoves(), and SV_Init().

◆ sv_clmovement_minping_disabletime

cvar_t sv_clmovement_minping_disabletime = {CF_SERVER, "sv_clmovement_minping_disabletime", "1000", "when client falls below minping, disable their prediction for this many milliseconds (should be at least 1000 or else their prediction may turn on/off frequently)"}

Definition at line 79 of file sv_main.c.

79{CF_SERVER, "sv_clmovement_minping_disabletime", "1000", "when client falls below minping, disable their prediction for this many milliseconds (should be at least 1000 or else their prediction may turn on/off frequently)"};

Referenced by SV_ExecuteClientMoves(), and SV_Init().

◆ sv_cullentities_nevercullbmodels

cvar_t sv_cullentities_nevercullbmodels = {CF_SERVER, "sv_cullentities_nevercullbmodels", "0", "if enabled the clients are always notified of moving doors and lifts and other submodels of world (warning: eats a lot of network bandwidth on some levels!)"}

Definition at line 81 of file sv_main.c.

81{CF_SERVER, "sv_cullentities_nevercullbmodels", "0", "if enabled the clients are always notified of moving doors and lifts and other submodels of world (warning: eats a lot of network bandwidth on some levels!)"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_cullentities_pvs

cvar_t sv_cullentities_pvs = {CF_SERVER, "sv_cullentities_pvs", "1", "fast but loose culling of hidden entities"}

Definition at line 82 of file sv_main.c.

82{CF_SERVER, "sv_cullentities_pvs", "1", "fast but loose culling of hidden entities"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_cullentities_stats

cvar_t sv_cullentities_stats = {CF_SERVER, "sv_cullentities_stats", "0", "displays stats on network entities culled by various methods for each client"}

Definition at line 83 of file sv_main.c.

83{CF_SERVER, "sv_cullentities_stats", "0", "displays stats on network entities culled by various methods for each client"};

Referenced by SV_Init(), and SV_WriteEntitiesToClient().

◆ sv_cullentities_trace

cvar_t sv_cullentities_trace = {CF_SERVER, "sv_cullentities_trace", "0", "somewhat slow but very tight culling of hidden entities, minimizes network traffic and makes wallhack cheats useless"}

Definition at line 84 of file sv_main.c.

84{CF_SERVER, "sv_cullentities_trace", "0", "somewhat slow but very tight culling of hidden entities, minimizes network traffic and makes wallhack cheats useless"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_cullentities_trace_delay

cvar_t sv_cullentities_trace_delay = {CF_SERVER, "sv_cullentities_trace_delay", "1", "number of seconds until the entity gets actually culled (also applies to portal camera eyes even if sv_cullentities_trace is 0)"}

Definition at line 85 of file sv_main.c.

85{CF_SERVER, "sv_cullentities_trace_delay", "1", "number of seconds until the entity gets actually culled (also applies to portal camera eyes even if sv_cullentities_trace is 0)"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_cullentities_trace_delay_players

cvar_t sv_cullentities_trace_delay_players = {CF_SERVER, "sv_cullentities_trace_delay_players", "0.2", "number of seconds until the entity gets actually culled if it is a player entity"}

Definition at line 86 of file sv_main.c.

86{CF_SERVER, "sv_cullentities_trace_delay_players", "0.2", "number of seconds until the entity gets actually culled if it is a player entity"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_cullentities_trace_enlarge

cvar_t sv_cullentities_trace_enlarge = {CF_SERVER, "sv_cullentities_trace_enlarge", "0", "box enlargement for entity culling (also applies to portal camera eyes even if sv_cullentities_trace is 0)"}

Definition at line 87 of file sv_main.c.

87{CF_SERVER, "sv_cullentities_trace_enlarge", "0", "box enlargement for entity culling (also applies to portal camera eyes even if sv_cullentities_trace is 0)"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_cullentities_trace_entityocclusion

cvar_t sv_cullentities_trace_entityocclusion = {CF_SERVER, "sv_cullentities_trace_entityocclusion", "0", "also check if doors and other bsp models are in the way"}

Definition at line 92 of file sv_main.c.

92{CF_SERVER, "sv_cullentities_trace_entityocclusion", "0", "also check if doors and other bsp models are in the way"};

Referenced by SV_CanSeeBox(), and SV_Init().

◆ sv_cullentities_trace_expand

cvar_t sv_cullentities_trace_expand = {CF_SERVER, "sv_cullentities_trace_expand", "0", "box is expanded by this many units for entity culling (also applies to portal camera eyes even if sv_cullentities_trace is 0)"}

Definition at line 88 of file sv_main.c.

88{CF_SERVER, "sv_cullentities_trace_expand", "0", "box is expanded by this many units for entity culling (also applies to portal camera eyes even if sv_cullentities_trace is 0)"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_cullentities_trace_eyejitter

cvar_t sv_cullentities_trace_eyejitter = {CF_SERVER, "sv_cullentities_trace_eyejitter", "16", "jitter the eye by this much for each trace (also applies to portal camera eyes even if sv_cullentities_trace is 0)"}

Definition at line 89 of file sv_main.c.

89{CF_SERVER, "sv_cullentities_trace_eyejitter", "16", "jitter the eye by this much for each trace (also applies to portal camera eyes even if sv_cullentities_trace is 0)"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_cullentities_trace_prediction

cvar_t sv_cullentities_trace_prediction = {CF_SERVER, "sv_cullentities_trace_prediction", "1", "also trace from the predicted player position"}

Definition at line 90 of file sv_main.c.

90{CF_SERVER, "sv_cullentities_trace_prediction", "1", "also trace from the predicted player position"};

Referenced by SV_Init(), and SV_WriteEntitiesToClient().

◆ sv_cullentities_trace_prediction_time

cvar_t sv_cullentities_trace_prediction_time = {CF_SERVER, "sv_cullentities_trace_prediction_time", "0.2", "maximum ping time to predict in seconds"}

Definition at line 91 of file sv_main.c.

91{CF_SERVER, "sv_cullentities_trace_prediction_time", "0.2", "maximum ping time to predict in seconds"};

Referenced by SV_Init(), and SV_WriteEntitiesToClient().

◆ sv_cullentities_trace_samples

cvar_t sv_cullentities_trace_samples = {CF_SERVER, "sv_cullentities_trace_samples", "2", "number of samples to test for entity culling"}

Definition at line 93 of file sv_main.c.

93{CF_SERVER, "sv_cullentities_trace_samples", "2", "number of samples to test for entity culling"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_cullentities_trace_samples_extra

cvar_t sv_cullentities_trace_samples_extra = {CF_SERVER, "sv_cullentities_trace_samples_extra", "2", "number of samples to test for entity culling when the entity affects its surroundings by e.g. dlight (also applies to portal camera eyes even if sv_cullentities_trace is 0)"}

Definition at line 94 of file sv_main.c.

94{CF_SERVER, "sv_cullentities_trace_samples_extra", "2", "number of samples to test for entity culling when the entity affects its surroundings by e.g. dlight (also applies to portal camera eyes even if sv_cullentities_trace is 0)"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_cullentities_trace_samples_players

cvar_t sv_cullentities_trace_samples_players = {CF_SERVER, "sv_cullentities_trace_samples_players", "8", "number of samples to test for entity culling when the entity is a player entity"}

Definition at line 95 of file sv_main.c.

95{CF_SERVER, "sv_cullentities_trace_samples_players", "8", "number of samples to test for entity culling when the entity is a player entity"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_cullentities_trace_spectators

cvar_t sv_cullentities_trace_spectators = {CF_SERVER, "sv_cullentities_trace_spectators", "0", "enables trace entity culling for clients that are spectating"}

Definition at line 96 of file sv_main.c.

96{CF_SERVER, "sv_cullentities_trace_spectators", "0", "enables trace entity culling for clients that are spectating"};

Referenced by SV_Init(), and SV_MarkWriteEntityStateToClient().

◆ sv_debugmove

cvar_t sv_debugmove = {CF_SERVER | CF_NOTIFY, "sv_debugmove", "0", "disables collision detection optimizations for debugging purposes"}

Definition at line 97 of file sv_main.c.

97{CF_SERVER | CF_NOTIFY, "sv_debugmove", "0", "disables collision detection optimizations for debugging purposes"};

Referenced by CL_TraceBox(), CL_TraceLine(), CL_TracePoint(), SV_Init(), SV_TraceBox(), SV_TraceLine(), and SV_TracePoint().

◆ sv_dedicated

cvar_t sv_dedicated = {CF_SERVER | CF_READONLY, "sv_dedicated", "0", "for scripts and SVQC to detect when they're running on a dedicated server"}

Definition at line 98 of file sv_main.c.

98{CF_SERVER | CF_READONLY, "sv_dedicated", "0", "for scripts and SVQC to detect when they're running on a dedicated server"};

Referenced by SV_Init(), and SV_ServerOptions().

◆ sv_disablenotify

cvar_t sv_disablenotify = {CF_SERVER, "sv_disablenotify", "0", "suppress broadcast prints when certain cvars are changed (CF_NOTIFY flag in engine code)"}

Definition at line 42 of file sv_main.c.

42{CF_SERVER, "sv_disablenotify", "0", "suppress broadcast prints when certain cvars are changed (CF_NOTIFY flag in engine code)"};

Referenced by Cvar_SetQuick_Internal(), and SV_Init().

◆ sv_echobprint

cvar_t sv_echobprint = {CF_SERVER | CF_ARCHIVE, "sv_echobprint", "1", "prints gamecode bprint() calls to server console"}

Definition at line 99 of file sv_main.c.

99{CF_SERVER | CF_ARCHIVE, "sv_echobprint", "1", "prints gamecode bprint() calls to server console"};

Referenced by SV_BroadcastPrint(), and SV_Init().

◆ sv_edgefriction

cvar_t sv_edgefriction = {CF_SERVER, "edgefriction", "1", "how much you slow down when nearing a ledge you might fall off, multiplier of sv_friction (Quake used 2, QuakeWorld used 1 due to a bug in physics code)"}

Definition at line 100 of file sv_main.c.

100{CF_SERVER, "edgefriction", "1", "how much you slow down when nearing a ledge you might fall off, multiplier of sv_friction (Quake used 2, QuakeWorld used 1 due to a bug in physics code)"};

Referenced by SV_Init(), SV_UserFriction(), and SV_WriteClientdataToMessage().

◆ sv_entpatch

cvar_t sv_entpatch = {CF_SERVER, "sv_entpatch", "1", "enables loading of .ent files to override entities in the bsp (for example Threewave CTF server pack contains .ent patch files enabling play of CTF on id1 maps)"}

Definition at line 101 of file sv_main.c.

101{CF_SERVER, "sv_entpatch", "1", "enables loading of .ent files to override entities in the bsp (for example Threewave CTF server pack contains .ent patch files enabling play of CTF on id1 maps)"};

Referenced by SV_Init(), and SV_SpawnServer().

◆ sv_freezenonclients

cvar_t sv_freezenonclients = {CF_SERVER | CF_NOTIFY, "sv_freezenonclients", "0", "freezes time, except for players, allowing you to walk around and take screenshots of explosions"}

Definition at line 102 of file sv_main.c.

102{CF_SERVER | CF_NOTIFY, "sv_freezenonclients", "0", "freezes time, except for players, allowing you to walk around and take screenshots of explosions"};

Referenced by SV_Init(), and SV_Physics().

◆ sv_friction

cvar_t sv_friction = {CF_SERVER | CF_NOTIFY, "sv_friction","4", "how fast you slow down"}

Definition at line 103 of file sv_main.c.

103{CF_SERVER | CF_NOTIFY, "sv_friction","4", "how fast you slow down"};

Referenced by SV_Init(), SV_UserFriction(), SV_WaterMove(), and SV_WriteClientdataToMessage().

◆ sv_gameplayfix_blowupfallenzombies

cvar_t sv_gameplayfix_blowupfallenzombies = {CF_SERVER, "sv_gameplayfix_blowupfallenzombies", "1", "causes findradius to detect SOLID_NOT entities such as zombies and corpses on the floor, allowing splash damage to apply to them"}

Definition at line 104 of file sv_main.c.

104{CF_SERVER, "sv_gameplayfix_blowupfallenzombies", "1", "causes findradius to detect SOLID_NOT entities such as zombies and corpses on the floor, allowing splash damage to apply to them"};

Referenced by SV_Init(), VM_CL_findradius(), and VM_SV_findradius().

◆ sv_gameplayfix_consistentplayerprethink

cvar_t sv_gameplayfix_consistentplayerprethink = {CF_SERVER, "sv_gameplayfix_consistentplayerprethink", "0", "improves fairness in multiplayer by running all PlayerPreThink functions (which fire weapons) before performing physics, then running all PlayerPostThink functions"}

Definition at line 105 of file sv_main.c.

105{CF_SERVER, "sv_gameplayfix_consistentplayerprethink", "0", "improves fairness in multiplayer by running all PlayerPreThink functions (which fire weapons) before performing physics, then running all PlayerPostThink functions"};

Referenced by SV_Init(), and SV_Physics().

◆ sv_gameplayfix_delayprojectiles

cvar_t sv_gameplayfix_delayprojectiles = {CF_SERVER, "sv_gameplayfix_delayprojectiles", "1", "causes entities to not move on the same frame they are spawned, meaning that projectiles wait until the next frame to perform their first move, giving proper interpolation and rocket trails, but making weapons harder to use at low framerates"}

Definition at line 106 of file sv_main.c.

106{CF_SERVER, "sv_gameplayfix_delayprojectiles", "1", "causes entities to not move on the same frame they are spawned, meaning that projectiles wait until the next frame to perform their first move, giving proper interpolation and rocket trails, but making weapons harder to use at low framerates"};

Referenced by SV_Init(), SV_Physics(), and SV_Physics_Entity().

◆ sv_gameplayfix_downtracesupportsongroundflag

cvar_t sv_gameplayfix_downtracesupportsongroundflag = {CF_SERVER, "sv_gameplayfix_downtracesupportsongroundflag", "1", "prevents very short moves from clearing onground (which may make the player stick to the floor at high netfps), fixes groundentity not being set when walking onto a mover with sv_gameplayfix_nogravityonground"}

Definition at line 128 of file sv_main.c.

128{CF_SERVER, "sv_gameplayfix_downtracesupportsongroundflag", "1", "prevents very short moves from clearing onground (which may make the player stick to the floor at high netfps), fixes groundentity not being set when walking onto a mover with sv_gameplayfix_nogravityonground"};

Referenced by SV_Init(), and SV_WalkMove().

◆ sv_gameplayfix_droptofloorstartsolid

cvar_t sv_gameplayfix_droptofloorstartsolid = {CF_SERVER, "sv_gameplayfix_droptofloorstartsolid", "1", "prevents items and monsters that start in a solid area from falling out of the level (makes droptofloor treat trace_startsolid as an acceptable outcome)"}

Definition at line 107 of file sv_main.c.

107{CF_SERVER, "sv_gameplayfix_droptofloorstartsolid", "1", "prevents items and monsters that start in a solid area from falling out of the level (makes droptofloor treat trace_startsolid as an acceptable outcome)"};

Referenced by SV_Init(), and VM_SV_droptofloor().

◆ sv_gameplayfix_droptofloorstartsolid_nudgetocorrect

cvar_t sv_gameplayfix_droptofloorstartsolid_nudgetocorrect = {CF_SERVER, "sv_gameplayfix_droptofloorstartsolid_nudgetocorrect", "1", "tries to nudge stuck items and monsters out of walls before droptofloor is performed"}

Definition at line 108 of file sv_main.c.

108{CF_SERVER, "sv_gameplayfix_droptofloorstartsolid_nudgetocorrect", "1", "tries to nudge stuck items and monsters out of walls before droptofloor is performed"};

Referenced by SV_Init(), and VM_SV_droptofloor().

◆ sv_gameplayfix_easierwaterjump

cvar_t sv_gameplayfix_easierwaterjump = {CF_SERVER, "sv_gameplayfix_easierwaterjump", "1", "changes water jumping to make it easier to get out of water (exactly like in QuakeWorld)"}

Definition at line 109 of file sv_main.c.

109{CF_SERVER, "sv_gameplayfix_easierwaterjump", "1", "changes water jumping to make it easier to get out of water (exactly like in QuakeWorld)"};

Referenced by SV_FlyMove(), and SV_Init().

◆ sv_gameplayfix_findradiusdistancetobox

cvar_t sv_gameplayfix_findradiusdistancetobox = {CF_SERVER, "sv_gameplayfix_findradiusdistancetobox", "1", "causes findradius to check the distance to the corner of a box rather than the center of the box, makes findradius detect bmodels such as very large doors that would otherwise be unaffected by splash damage"}

Definition at line 110 of file sv_main.c.

110{CF_SERVER, "sv_gameplayfix_findradiusdistancetobox", "1", "causes findradius to check the distance to the corner of a box rather than the center of the box, makes findradius detect bmodels such as very large doors that would otherwise be unaffected by splash damage"};

Referenced by SV_Init(), VM_CL_findradius(), and VM_SV_findradius().

◆ sv_gameplayfix_fixedcheckwatertransition

cvar_t sv_gameplayfix_fixedcheckwatertransition = {CF_SERVER, "sv_gameplayfix_fixedcheckwatertransition", "1", "fix two very stupid bugs in SV_CheckWaterTransition when watertype is CONTENTS_EMPTY (the bugs causes waterlevel to be 1 on first frame, -1 on second frame - the fix makes it 0 on both frames)"}

Definition at line 132 of file sv_main.c.

132{CF_SERVER, "sv_gameplayfix_fixedcheckwatertransition", "1", "fix two very stupid bugs in SV_CheckWaterTransition when watertype is CONTENTS_EMPTY (the bugs causes waterlevel to be 1 on first frame, -1 on second frame - the fix makes it 0 on both frames)"};

Referenced by SV_CheckWaterTransition(), and SV_Init().

◆ sv_gameplayfix_gravityunaffectedbyticrate

cvar_t sv_gameplayfix_gravityunaffectedbyticrate = {CF_SERVER, "sv_gameplayfix_gravityunaffectedbyticrate", "0", "fix some ticrate issues in physics."}

Definition at line 111 of file sv_main.c.

111{CF_SERVER, "sv_gameplayfix_gravityunaffectedbyticrate", "0", "fix some ticrate issues in physics."};

Referenced by SV_FlyMove(), SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_gameplayfix_grenadebouncedownslopes

cvar_t sv_gameplayfix_grenadebouncedownslopes = {CF_SERVER, "sv_gameplayfix_grenadebouncedownslopes", "1", "prevents MOVETYPE_BOUNCE (grenades) from getting stuck when fired down a downward sloping surface"}

Definition at line 112 of file sv_main.c.

112{CF_SERVER, "sv_gameplayfix_grenadebouncedownslopes", "1", "prevents MOVETYPE_BOUNCE (grenades) from getting stuck when fired down a downward sloping surface"};

Referenced by SV_Init(), and SV_Physics_Toss().

◆ sv_gameplayfix_impactbeforeonground

cvar_t sv_gameplayfix_impactbeforeonground = {CF_SERVER, "sv_gameplayfix_impactbeforeonground", "0", "enables a bug from old DP versions in which entity .touch functions are called before FL_ONGROUND is set when a collision is detected in SV_FlyMove() (used by MOVETYPE_WALK and MOVETYPE_STEP), Quake 1.5 and Combat+ mods require this, it breaks id1 fiends"}

Definition at line 113 of file sv_main.c.

113{CF_SERVER, "sv_gameplayfix_impactbeforeonground", "0", "enables a bug from old DP versions in which entity .touch functions are called before FL_ONGROUND is set when a collision is detected in SV_FlyMove() (used by MOVETYPE_WALK and MOVETYPE_STEP), Quake 1.5 and Combat+ mods require this, it breaks id1 fiends"};

Referenced by SV_FlyMove(), and SV_Init().

◆ sv_gameplayfix_multiplethinksperframe

cvar_t sv_gameplayfix_multiplethinksperframe = {CF_SERVER, "sv_gameplayfix_multiplethinksperframe", "1", "allows entities to think more often than the server framerate, primarily useful for very high fire rate weapons"}

Definition at line 114 of file sv_main.c.

114{CF_SERVER, "sv_gameplayfix_multiplethinksperframe", "1", "allows entities to think more often than the server framerate, primarily useful for very high fire rate weapons"};

Referenced by SV_Init(), and SV_RunThink().

◆ sv_gameplayfix_noairborncorpse

cvar_t sv_gameplayfix_noairborncorpse = {CF_SERVER, "sv_gameplayfix_noairborncorpse", "1", "causes entities (corpses, items, etc) sitting ontop of moving entities (players) to fall when the moving entity (player) is no longer supporting them"}

Definition at line 115 of file sv_main.c.

115{CF_SERVER, "sv_gameplayfix_noairborncorpse", "1", "causes entities (corpses, items, etc) sitting ontop of moving entities (players) to fall when the moving entity (player) is no longer supporting them"};

Referenced by SV_Init(), and SV_Physics_Toss().

◆ sv_gameplayfix_noairborncorpse_allowsuspendeditems

cvar_t sv_gameplayfix_noairborncorpse_allowsuspendeditems = {CF_SERVER, "sv_gameplayfix_noairborncorpse_allowsuspendeditems", "1", "causes entities sitting ontop of objects that are instantaneously remove to float in midair (special hack to allow a common level design trick for floating items)"}

Definition at line 116 of file sv_main.c.

116{CF_SERVER, "sv_gameplayfix_noairborncorpse_allowsuspendeditems", "1", "causes entities sitting ontop of objects that are instantaneously remove to float in midair (special hack to allow a common level design trick for floating items)"};

Referenced by SV_Init(), and SV_Physics_Toss().

◆ sv_gameplayfix_nogravityonground

cvar_t sv_gameplayfix_nogravityonground = {CF_SERVER, "sv_gameplayfix_nogravityonground", "0", "turn off gravity when on ground (to get rid of sliding)"}

Definition at line 120 of file sv_main.c.

120{CF_SERVER, "sv_gameplayfix_nogravityonground", "0", "turn off gravity when on ground (to get rid of sliding)"};

Referenced by SV_FlyMove(), SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_gameplayfix_nosquashentities

cvar_t sv_gameplayfix_nosquashentities = {CF_SERVER, "sv_gameplayfix_nosquashentities", "0", "Entity hitboxes will not be resized or disabled when they are crushed by movers, and will continue to be affected by movers."}

Definition at line 133 of file sv_main.c.

133{CF_SERVER, "sv_gameplayfix_nosquashentities", "0", "Entity hitboxes will not be resized or disabled when they are crushed by movers, and will continue to be affected by movers."};

Referenced by SV_Init(), and SV_PushMove().

◆ sv_gameplayfix_nostepmoveonsteepslopes

cvar_t sv_gameplayfix_nostepmoveonsteepslopes = {CF_SERVER, "sv_gameplayfix_nostepmoveonsteepslopes", "0", "crude fix which prevents MOVETYPE_STEP (not swimming or flying) to move on slopes whose angle is bigger than 45 degree"}

Definition at line 125 of file sv_main.c.

125{CF_SERVER, "sv_gameplayfix_nostepmoveonsteepslopes", "0", "crude fix which prevents MOVETYPE_STEP (not swimming or flying) to move on slopes whose angle is bigger than 45 degree"};

Referenced by SV_Init(), and SV_movestep().

◆ sv_gameplayfix_nudgeoutofsolid

cvar_t sv_gameplayfix_nudgeoutofsolid = {CF_SERVER, "sv_gameplayfix_nudgeoutofsolid", "0", "attempts to fix physics errors where an object ended up in solid for some reason, smarter than sv_gameplayfix_unstick* except on Q1BSP with mod_q1bsp_polygoncollisions disabled (there it falls back to the unsticking method)"}

Definition at line 117 of file sv_main.c.

117{CF_SERVER, "sv_gameplayfix_nudgeoutofsolid", "0", "attempts to fix physics errors where an object ended up in solid for some reason, smarter than sv_gameplayfix_unstick* except on Q1BSP with mod_q1bsp_polygoncollisions disabled (there it falls back to the unsticking method)"};

Referenced by SV_Init(), and SV_UnstickEntity().

◆ sv_gameplayfix_nudgeoutofsolid_separation

cvar_t sv_gameplayfix_nudgeoutofsolid_separation = {CF_SERVER, "sv_gameplayfix_nudgeoutofsolid_separation", "0.03125", "keep objects this distance apart to prevent collision issues on seams"}

Definition at line 118 of file sv_main.c.

118{CF_SERVER, "sv_gameplayfix_nudgeoutofsolid_separation", "0.03125", "keep objects this distance apart to prevent collision issues on seams"};

Referenced by PHYS_NudgeOutOfSolid(), SV_Init(), and SV_UnstickEntity().

◆ sv_gameplayfix_q1bsptracelinereportstexture

cvar_t sv_gameplayfix_q1bsptracelinereportstexture = {CF_SERVER, "sv_gameplayfix_q1bsptracelinereportstexture", "1", "enables mods to get accurate trace_texture results on q1bsp by using a surface-hitting traceline implementation rather than the standard solidbsp method, q3bsp always reports texture accurately"}

Definition at line 129 of file sv_main.c.

129{CF_SERVER, "sv_gameplayfix_q1bsptracelinereportstexture", "1", "enables mods to get accurate trace_texture results on q1bsp by using a surface-hitting traceline implementation rather than the standard solidbsp method, q3bsp always reports texture accurately"};

Referenced by Mod_Q1BSP_TraceLine(), and SV_Init().

◆ sv_gameplayfix_q2airaccelerate

cvar_t sv_gameplayfix_q2airaccelerate = {CF_SERVER, "sv_gameplayfix_q2airaccelerate", "0", "Quake2-style air acceleration"}

Definition at line 119 of file sv_main.c.

119{CF_SERVER, "sv_gameplayfix_q2airaccelerate", "0", "Quake2-style air acceleration"};

Referenced by SV_AirAccelerate(), SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_gameplayfix_setmodelrealbox

cvar_t sv_gameplayfix_setmodelrealbox = {CF_SERVER, "sv_gameplayfix_setmodelrealbox", "1", "fixes a bug in Quake that made setmodel always set the entity box to ('-16 -16 -16', '16 16 16') rather than properly checking the model box, breaks some poorly coded mods"}

Definition at line 121 of file sv_main.c.

121{CF_SERVER, "sv_gameplayfix_setmodelrealbox", "1", "fixes a bug in Quake that made setmodel always set the entity box to ('-16 -16 -16', '16 16 16') rather than properly checking the model box, breaks some poorly coded mods"};

Referenced by SV_Init(), VM_SV_setmodel(), and VM_SV_setmodelindex().

◆ sv_gameplayfix_slidemoveprojectiles

cvar_t sv_gameplayfix_slidemoveprojectiles = {CF_SERVER, "sv_gameplayfix_slidemoveprojectiles", "1", "allows MOVETYPE_FLY/FLYMISSILE/TOSS/BOUNCE/BOUNCEMISSILE entities to finish their move in a frame even if they hit something, fixes 'gravity accumulation' bug for grenades on steep slopes"}

Definition at line 122 of file sv_main.c.

122{CF_SERVER, "sv_gameplayfix_slidemoveprojectiles", "1", "allows MOVETYPE_FLY/FLYMISSILE/TOSS/BOUNCE/BOUNCEMISSILE entities to finish their move in a frame even if they hit something, fixes 'gravity accumulation' bug for grenades on steep slopes"};

Referenced by SV_Init(), and SV_Physics_Toss().

◆ sv_gameplayfix_stepdown

cvar_t sv_gameplayfix_stepdown = {CF_SERVER, "sv_gameplayfix_stepdown", "0", "attempts to step down stairs, not just up them (prevents the familiar thud..thud..thud.. when running down stairs and slopes)"}

Definition at line 123 of file sv_main.c.

123{CF_SERVER, "sv_gameplayfix_stepdown", "0", "attempts to step down stairs, not just up them (prevents the familiar thud..thud..thud.. when running down stairs and slopes)"};

Referenced by SV_Init(), and SV_WalkMove().

◆ sv_gameplayfix_stepmultipletimes

cvar_t sv_gameplayfix_stepmultipletimes = {CF_SERVER, "sv_gameplayfix_stepmultipletimes", "0", "applies step-up onto a ledge more than once in a single frame, when running quickly up stairs"}

Definition at line 124 of file sv_main.c.

124{CF_SERVER, "sv_gameplayfix_stepmultipletimes", "0", "applies step-up onto a ledge more than once in a single frame, when running quickly up stairs"};

Referenced by SV_Init(), and SV_WalkMove().

◆ sv_gameplayfix_swiminbmodels

cvar_t sv_gameplayfix_swiminbmodels = {CF_SERVER, "sv_gameplayfix_swiminbmodels", "1", "causes pointcontents (used to determine if you are in a liquid) to check bmodel entities as well as the world model, so you can swim around in (possibly moving) water bmodel entities"}

Definition at line 126 of file sv_main.c.

126{CF_SERVER, "sv_gameplayfix_swiminbmodels", "1", "causes pointcontents (used to determine if you are in a liquid) to check bmodel entities as well as the world model, so you can swim around in (possibly moving) water bmodel entities"};

Referenced by SV_Init(), and SV_PointSuperContents().

◆ sv_gameplayfix_unstickentities

cvar_t sv_gameplayfix_unstickentities = {CF_SERVER, "sv_gameplayfix_unstickentities", "0", "hack to check if entities are crossing world collision hull and try to move them to the right position. Quake didn't do this so maps shouldn't depend on it."}

Definition at line 131 of file sv_main.c.

131{CF_SERVER, "sv_gameplayfix_unstickentities", "0", "hack to check if entities are crossing world collision hull and try to move them to the right position. Quake didn't do this so maps shouldn't depend on it."};

Referenced by SV_Init(), and SV_UnstickEntity().

◆ sv_gameplayfix_unstickplayers

cvar_t sv_gameplayfix_unstickplayers = {CF_SERVER, "sv_gameplayfix_unstickplayers", "1", "big hack to try and fix the rare case of MOVETYPE_WALK entities getting stuck in the world clipping hull. Quake did something similar."}

Definition at line 130 of file sv_main.c.

130{CF_SERVER, "sv_gameplayfix_unstickplayers", "1", "big hack to try and fix the rare case of MOVETYPE_WALK entities getting stuck in the world clipping hull. Quake did something similar."};

Referenced by SV_Init(), and SV_UnstickEntity().

◆ sv_gameplayfix_upwardvelocityclearsongroundflag

cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag = {CF_SERVER, "sv_gameplayfix_upwardvelocityclearsongroundflag", "1", "prevents monsters, items, and most other objects from being stuck to the floor when pushed around by damage, and other situations in mods"}

Definition at line 127 of file sv_main.c.

127{CF_SERVER, "sv_gameplayfix_upwardvelocityclearsongroundflag", "1", "prevents monsters, items, and most other objects from being stuck to the floor when pushed around by damage, and other situations in mods"};

Referenced by SV_Init(), SV_Physics_Step(), and SV_Physics_Toss().

◆ sv_gravity

cvar_t sv_gravity = {CF_SERVER | CF_NOTIFY, "sv_gravity","800", "how fast you fall (512 = roughly earth gravity)"}

Definition at line 134 of file sv_main.c.

134{CF_SERVER | CF_NOTIFY, "sv_gravity","800", "how fast you fall (512 = roughly earth gravity)"};

Referenced by CL_UpdateMoveVars(), SV_Gravity(), SV_Init(), SV_Physics(), SV_Physics_Step(), SV_Physics_Toss(), SV_Trace_Toss(), and SV_WriteClientdataToMessage().

◆ sv_idealpitchscale

cvar_t sv_idealpitchscale = {CF_SERVER, "sv_idealpitchscale","0.8", "how much to look up/down slopes and stairs when not using freelook"}

Definition at line 136 of file sv_main.c.

136{CF_SERVER, "sv_idealpitchscale","0.8", "how much to look up/down slopes and stairs when not using freelook"};

Referenced by SV_Init(), and SV_SetIdealPitch().

◆ sv_init_frame_count

cvar_t sv_init_frame_count = {CF_SERVER, "sv_init_frame_count", "2", "number of frames to run to allow everything to settle before letting clients connect"}

Definition at line 135 of file sv_main.c.

135{CF_SERVER, "sv_init_frame_count", "2", "number of frames to run to allow everything to settle before letting clients connect"};

Referenced by SV_Init(), and SV_SpawnServer().

◆ sv_jumpstep

cvar_t sv_jumpstep = {CF_SERVER | CF_NOTIFY, "sv_jumpstep", "0", "whether you can step up while jumping"}

Definition at line 137 of file sv_main.c.

137{CF_SERVER | CF_NOTIFY, "sv_jumpstep", "0", "whether you can step up while jumping"};

Referenced by SV_Init(), and SV_WalkMove().

◆ sv_jumpvelocity

cvar_t sv_jumpvelocity = {CF_SERVER, "sv_jumpvelocity", "270", "cvar that can be used by QuakeC code for jump velocity"}

Definition at line 138 of file sv_main.c.

138{CF_SERVER, "sv_jumpvelocity", "270", "cvar that can be used by QuakeC code for jump velocity"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_lagreporting_always

cvar_t sv_lagreporting_always = {CF_SERVER, "sv_lagreporting_always", "0", "report lag even in singleplayer, listen, an empty dedicated server, or during intermission"}

Definition at line 168 of file sv_main.c.

168{CF_SERVER, "sv_lagreporting_always", "0", "report lag even in singleplayer, listen, an empty dedicated server, or during intermission"};

Referenced by SV_Frame(), and SV_Init().

◆ sv_lagreporting_strict

cvar_t sv_lagreporting_strict = {CF_SERVER, "sv_lagreporting_strict", "0", "log any extra frames run to catch up after a holdup (only applies when sv_maxphysicsframesperserverframe > 1)"}

Definition at line 169 of file sv_main.c.

169{CF_SERVER, "sv_lagreporting_strict", "0", "log any extra frames run to catch up after a holdup (only applies when sv_maxphysicsframesperserverframe > 1)"};

Referenced by SV_Frame(), and SV_Init().

◆ sv_legacy_bbox_expand

cvar_t sv_legacy_bbox_expand = {CF_SERVER, "sv_legacy_bbox_expand", "1", "before linking an entity to the area grid, decrease its mins and increase its maxs by '1 1 1', or '15 15 1' if it has flag FL_ITEM (this is the Quake/QuakeWorld behaviour); disable to make SVQC bboxes consistent with CSQC which never does this expansion"}

Definition at line 139 of file sv_main.c.

139{CF_SERVER, "sv_legacy_bbox_expand", "1", "before linking an entity to the area grid, decrease its mins and increase its maxs by '1 1 1', or '15 15 1' if it has flag FL_ITEM (this is the Quake/QuakeWorld behaviour); disable to make SVQC bboxes consistent with CSQC which never does this expansion"};

Referenced by SV_Init(), and SV_LinkEdict().

◆ sv_mapformat_is_quake2

cvar_t sv_mapformat_is_quake2 = {CF_SERVER, "sv_mapformat_is_quake2", "0", "indicates the current map is q2bsp format (useful to know because of different entity behaviors, .frame on submodels and other things)"}

Definition at line 216 of file sv_main.c.

216{CF_SERVER, "sv_mapformat_is_quake2", "0", "indicates the current map is q2bsp format (useful to know because of different entity behaviors, .frame on submodels and other things)"};

Referenced by SV_Init(), and SV_SpawnServer().

◆ sv_mapformat_is_quake3

cvar_t sv_mapformat_is_quake3 = {CF_SERVER, "sv_mapformat_is_quake3", "0", "indicates the current map is q3bsp format (useful to know because of different entity behaviors)"}

Definition at line 217 of file sv_main.c.

217{CF_SERVER, "sv_mapformat_is_quake3", "0", "indicates the current map is q3bsp format (useful to know because of different entity behaviors)"};

Referenced by SV_Init(), and SV_SpawnServer().

◆ sv_maxairspeed

cvar_t sv_maxairspeed = {CF_SERVER, "sv_maxairspeed", "30", "maximum speed a player can accelerate to when airborn (note that it is possible to completely stop by moving the opposite direction)"}

Definition at line 140 of file sv_main.c.

140{CF_SERVER, "sv_maxairspeed", "30", "maximum speed a player can accelerate to when airborn (note that it is possible to completely stop by moving the opposite direction)"};

Referenced by SV_AirAccelerate(), SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_maxairstrafespeed

cvar_t sv_maxairstrafespeed = {CF_SERVER, "sv_maxairstrafespeed", "0", "when set, replacement for sv_maxairspeed when just strafing"}

Definition at line 64 of file sv_main.c.

64{CF_SERVER, "sv_maxairstrafespeed", "0", "when set, replacement for sv_maxairspeed when just strafing"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_maxphysicsframesperserverframe

cvar_t sv_maxphysicsframesperserverframe = {CF_SERVER, "sv_maxphysicsframesperserverframe","10", "maximum number of physics frames per server frame"}

Definition at line 167 of file sv_main.c.

167{CF_SERVER, "sv_maxphysicsframesperserverframe","10", "maximum number of physics frames per server frame"};

Referenced by SV_Frame(), and SV_Init().

◆ sv_maxrate

cvar_t sv_maxrate = {CF_SERVER | CF_ARCHIVE | CF_NOTIFY, "sv_maxrate", "1000000", "upper limit on client rate cvar, should reflect your network connection quality"}

Definition at line 141 of file sv_main.c.

141{CF_SERVER | CF_ARCHIVE | CF_NOTIFY, "sv_maxrate", "1000000", "upper limit on client rate cvar, should reflect your network connection quality"};

Referenced by M_GameOptions_Draw(), M_NetStart_Change(), SV_Init(), and SV_SendClientDatagram().

◆ sv_maxspeed

cvar_t sv_maxspeed = {CF_SERVER | CF_NOTIFY, "sv_maxspeed", "320", "maximum speed a player can accelerate to when on ground (can be exceeded by tricks)"}

Definition at line 142 of file sv_main.c.

142{CF_SERVER | CF_NOTIFY, "sv_maxspeed", "320", "maximum speed a player can accelerate to when on ground (can be exceeded by tricks)"};

Referenced by SV_AirMove(), SV_Init(), SV_WaterMove(), and SV_WriteClientdataToMessage().

◆ sv_maxvelocity

cvar_t sv_maxvelocity = {CF_SERVER | CF_NOTIFY, "sv_maxvelocity","2000", "universal speed limit on all entities"}

Definition at line 143 of file sv_main.c.

143{CF_SERVER | CF_NOTIFY, "sv_maxvelocity","2000", "universal speed limit on all entities"};

Referenced by SV_CheckVelocity(), and SV_Init().

◆ sv_mempool

◆ sv_nostep

cvar_t sv_nostep = {CF_SERVER | CF_NOTIFY, "sv_nostep","0", "prevents MOVETYPE_STEP entities (monsters) from moving"}

Definition at line 144 of file sv_main.c.

144{CF_SERVER | CF_NOTIFY, "sv_nostep","0", "prevents MOVETYPE_STEP entities (monsters) from moving"};

Referenced by SV_Init(), and SV_WalkMove().

◆ sv_onlycsqcnetworking

cvar_t sv_onlycsqcnetworking = {CF_SERVER, "sv_onlycsqcnetworking", "0", "disables legacy entity networking code for higher performance (except on clients, which can still be legacy)"}

Definition at line 163 of file sv_main.c.

163{CF_SERVER, "sv_onlycsqcnetworking", "0", "disables legacy entity networking code for higher performance (except on clients, which can still be legacy)"};

Referenced by SV_Init(), and SV_PrepareEntityForSending().

◆ sv_playerphysicsqc

cvar_t sv_playerphysicsqc = {CF_SERVER | CF_NOTIFY, "sv_playerphysicsqc", "1", "enables QuakeC function to override player physics"}

Definition at line 145 of file sv_main.c.

145{CF_SERVER | CF_NOTIFY, "sv_playerphysicsqc", "1", "enables QuakeC function to override player physics"};

Referenced by SV_Init(), and SV_PlayerPhysics().

◆ sv_progs

cvar_t sv_progs = {CF_SERVER, "sv_progs", "progs.dat", "selects which quakec progs.dat file to run" }

Definition at line 146 of file sv_main.c.

146{CF_SERVER, "sv_progs", "progs.dat", "selects which quakec progs.dat file to run" };

Referenced by SV_Init(), and SV_VM_Setup().

◆ sv_protocolname

cvar_t sv_protocolname = {CF_SERVER, "sv_protocolname", "DP7", "selects network protocol to host for (values include QUAKE, QUAKEDP, NEHAHRAMOVIE, DP1 and up)"}

Definition at line 147 of file sv_main.c.

147{CF_SERVER, "sv_protocolname", "DP7", "selects network protocol to host for (values include QUAKE, QUAKEDP, NEHAHRAMOVIE, DP1 and up)"};

Referenced by SV_Init(), and SV_SpawnServer().

◆ sv_qcstats

cvar_t sv_qcstats = {CF_SERVER, "sv_qcstats", "0", "Disables engine sending of stats 220 and above, for use by certain games such as Xonotic, NOTE: it's strongly recommended that SVQC send correct STAT_MOVEVARS_TICRATE and STAT_MOVEVARS_TIMESCALE"}

Definition at line 148 of file sv_main.c.

148{CF_SERVER, "sv_qcstats", "0", "Disables engine sending of stats 220 and above, for use by certain games such as Xonotic, NOTE: it's strongly recommended that SVQC send correct STAT_MOVEVARS_TICRATE and STAT_MOVEVARS_TIMESCALE"};

Referenced by SV_Init(), SV_WriteClientdataToMessage(), and VM_SV_AddStat().

◆ sv_random_seed

cvar_t sv_random_seed = {CF_SERVER, "sv_random_seed", "", "random seed; when set, on every map start this random seed is used to initialize the random number generator. Don't touch it unless for benchmarking or debugging"}

Definition at line 149 of file sv_main.c.

149{CF_SERVER, "sv_random_seed", "", "random seed; when set, on every map start this random seed is used to initialize the random number generator. Don't touch it unless for benchmarking or debugging"};

Referenced by Host_Frame(), SV_Init(), and SV_SpawnServer().

◆ sv_reqfields

prvm_required_field_t sv_reqfields[]

Definition at line 280 of file sv_main.c.

281{
282#define PRVM_DECLARE_serverglobalfloat(x)
283#define PRVM_DECLARE_serverglobalvector(x)
284#define PRVM_DECLARE_serverglobalstring(x)
285#define PRVM_DECLARE_serverglobaledict(x)
286#define PRVM_DECLARE_serverglobalfunction(x)
287#define PRVM_DECLARE_clientglobalfloat(x)
288#define PRVM_DECLARE_clientglobalvector(x)
289#define PRVM_DECLARE_clientglobalstring(x)
290#define PRVM_DECLARE_clientglobaledict(x)
291#define PRVM_DECLARE_clientglobalfunction(x)
292#define PRVM_DECLARE_menuglobalfloat(x)
293#define PRVM_DECLARE_menuglobalvector(x)
294#define PRVM_DECLARE_menuglobalstring(x)
295#define PRVM_DECLARE_menuglobaledict(x)
296#define PRVM_DECLARE_menuglobalfunction(x)
297#define PRVM_DECLARE_serverfieldfloat(x) {ev_float, #x},
298#define PRVM_DECLARE_serverfieldvector(x) {ev_vector, #x},
299#define PRVM_DECLARE_serverfieldstring(x) {ev_string, #x},
300#define PRVM_DECLARE_serverfieldedict(x) {ev_entity, #x},
301#define PRVM_DECLARE_serverfieldfunction(x) {ev_function, #x},
302#define PRVM_DECLARE_clientfieldfloat(x)
303#define PRVM_DECLARE_clientfieldvector(x)
304#define PRVM_DECLARE_clientfieldstring(x)
305#define PRVM_DECLARE_clientfieldedict(x)
306#define PRVM_DECLARE_clientfieldfunction(x)
307#define PRVM_DECLARE_menufieldfloat(x)
308#define PRVM_DECLARE_menufieldvector(x)
309#define PRVM_DECLARE_menufieldstring(x)
310#define PRVM_DECLARE_menufieldedict(x)
311#define PRVM_DECLARE_menufieldfunction(x)
312#define PRVM_DECLARE_serverfunction(x)
313#define PRVM_DECLARE_clientfunction(x)
314#define PRVM_DECLARE_menufunction(x)
315#define PRVM_DECLARE_field(x)
316#define PRVM_DECLARE_global(x)
317#define PRVM_DECLARE_function(x)
318#include "prvm_offsets.h"
319#undef PRVM_DECLARE_serverglobalfloat
320#undef PRVM_DECLARE_serverglobalvector
321#undef PRVM_DECLARE_serverglobalstring
322#undef PRVM_DECLARE_serverglobaledict
323#undef PRVM_DECLARE_serverglobalfunction
324#undef PRVM_DECLARE_clientglobalfloat
325#undef PRVM_DECLARE_clientglobalvector
326#undef PRVM_DECLARE_clientglobalstring
327#undef PRVM_DECLARE_clientglobaledict
328#undef PRVM_DECLARE_clientglobalfunction
329#undef PRVM_DECLARE_menuglobalfloat
330#undef PRVM_DECLARE_menuglobalvector
331#undef PRVM_DECLARE_menuglobalstring
332#undef PRVM_DECLARE_menuglobaledict
333#undef PRVM_DECLARE_menuglobalfunction
334#undef PRVM_DECLARE_serverfieldfloat
335#undef PRVM_DECLARE_serverfieldvector
336#undef PRVM_DECLARE_serverfieldstring
337#undef PRVM_DECLARE_serverfieldedict
338#undef PRVM_DECLARE_serverfieldfunction
339#undef PRVM_DECLARE_clientfieldfloat
340#undef PRVM_DECLARE_clientfieldvector
341#undef PRVM_DECLARE_clientfieldstring
342#undef PRVM_DECLARE_clientfieldedict
343#undef PRVM_DECLARE_clientfieldfunction
344#undef PRVM_DECLARE_menufieldfloat
345#undef PRVM_DECLARE_menufieldvector
346#undef PRVM_DECLARE_menufieldstring
347#undef PRVM_DECLARE_menufieldedict
348#undef PRVM_DECLARE_menufieldfunction
349#undef PRVM_DECLARE_serverfunction
350#undef PRVM_DECLARE_clientfunction
351#undef PRVM_DECLARE_menufunction
352#undef PRVM_DECLARE_field
353#undef PRVM_DECLARE_global
354#undef PRVM_DECLARE_function
355};

Referenced by SV_VM_Setup().

◆ sv_reqglobals

prvm_required_field_t sv_reqglobals[]

Definition at line 359 of file sv_main.c.

360{
361#define PRVM_DECLARE_serverglobalfloat(x) {ev_float, #x},
362#define PRVM_DECLARE_serverglobalvector(x) {ev_vector, #x},
363#define PRVM_DECLARE_serverglobalstring(x) {ev_string, #x},
364#define PRVM_DECLARE_serverglobaledict(x) {ev_entity, #x},
365#define PRVM_DECLARE_serverglobalfunction(x) {ev_function, #x},
366#define PRVM_DECLARE_clientglobalfloat(x)
367#define PRVM_DECLARE_clientglobalvector(x)
368#define PRVM_DECLARE_clientglobalstring(x)
369#define PRVM_DECLARE_clientglobaledict(x)
370#define PRVM_DECLARE_clientglobalfunction(x)
371#define PRVM_DECLARE_menuglobalfloat(x)
372#define PRVM_DECLARE_menuglobalvector(x)
373#define PRVM_DECLARE_menuglobalstring(x)
374#define PRVM_DECLARE_menuglobaledict(x)
375#define PRVM_DECLARE_menuglobalfunction(x)
376#define PRVM_DECLARE_serverfieldfloat(x)
377#define PRVM_DECLARE_serverfieldvector(x)
378#define PRVM_DECLARE_serverfieldstring(x)
379#define PRVM_DECLARE_serverfieldedict(x)
380#define PRVM_DECLARE_serverfieldfunction(x)
381#define PRVM_DECLARE_clientfieldfloat(x)
382#define PRVM_DECLARE_clientfieldvector(x)
383#define PRVM_DECLARE_clientfieldstring(x)
384#define PRVM_DECLARE_clientfieldedict(x)
385#define PRVM_DECLARE_clientfieldfunction(x)
386#define PRVM_DECLARE_menufieldfloat(x)
387#define PRVM_DECLARE_menufieldvector(x)
388#define PRVM_DECLARE_menufieldstring(x)
389#define PRVM_DECLARE_menufieldedict(x)
390#define PRVM_DECLARE_menufieldfunction(x)
391#define PRVM_DECLARE_serverfunction(x)
392#define PRVM_DECLARE_clientfunction(x)
393#define PRVM_DECLARE_menufunction(x)
394#define PRVM_DECLARE_field(x)
395#define PRVM_DECLARE_global(x)
396#define PRVM_DECLARE_function(x)
397#include "prvm_offsets.h"
398#undef PRVM_DECLARE_serverglobalfloat
399#undef PRVM_DECLARE_serverglobalvector
400#undef PRVM_DECLARE_serverglobalstring
401#undef PRVM_DECLARE_serverglobaledict
402#undef PRVM_DECLARE_serverglobalfunction
403#undef PRVM_DECLARE_clientglobalfloat
404#undef PRVM_DECLARE_clientglobalvector
405#undef PRVM_DECLARE_clientglobalstring
406#undef PRVM_DECLARE_clientglobaledict
407#undef PRVM_DECLARE_clientglobalfunction
408#undef PRVM_DECLARE_menuglobalfloat
409#undef PRVM_DECLARE_menuglobalvector
410#undef PRVM_DECLARE_menuglobalstring
411#undef PRVM_DECLARE_menuglobaledict
412#undef PRVM_DECLARE_menuglobalfunction
413#undef PRVM_DECLARE_serverfieldfloat
414#undef PRVM_DECLARE_serverfieldvector
415#undef PRVM_DECLARE_serverfieldstring
416#undef PRVM_DECLARE_serverfieldedict
417#undef PRVM_DECLARE_serverfieldfunction
418#undef PRVM_DECLARE_clientfieldfloat
419#undef PRVM_DECLARE_clientfieldvector
420#undef PRVM_DECLARE_clientfieldstring
421#undef PRVM_DECLARE_clientfieldedict
422#undef PRVM_DECLARE_clientfieldfunction
423#undef PRVM_DECLARE_menufieldfloat
424#undef PRVM_DECLARE_menufieldvector
425#undef PRVM_DECLARE_menufieldstring
426#undef PRVM_DECLARE_menufieldedict
427#undef PRVM_DECLARE_menufieldfunction
428#undef PRVM_DECLARE_serverfunction
429#undef PRVM_DECLARE_clientfunction
430#undef PRVM_DECLARE_menufunction
431#undef PRVM_DECLARE_field
432#undef PRVM_DECLARE_global
433#undef PRVM_DECLARE_function
434};

Referenced by SV_VM_Setup().

◆ sv_rollangle

cvar_t sv_rollangle = {CF_CLIENT, "sv_rollangle", "2.0", "how much to tilt the view when strafing"}

Definition at line 176 of file sv_main.c.

176{CF_CLIENT, "sv_rollangle", "2.0", "how much to tilt the view when strafing"};

Referenced by SV_Init(), and SV_PlayerPhysics().

◆ sv_rollspeed

cvar_t sv_rollspeed = {CF_CLIENT, "sv_rollspeed", "200", "how much strafing is necessary to tilt the view"}

Definition at line 175 of file sv_main.c.

175{CF_CLIENT, "sv_rollspeed", "200", "how much strafing is necessary to tilt the view"};

Referenced by SV_Init(), and SV_PlayerPhysics().

◆ sv_sendentities_csqc_randomize_order

cvar_t sv_sendentities_csqc_randomize_order = {CF_SERVER, "sv_sendentities_csqc_randomize_order", "1", "Randomize the order of sending CSQC entities (should behave better when packet size or bandwidth limits are exceeded)."}

Definition at line 221 of file sv_main.c.

221{CF_SERVER, "sv_sendentities_csqc_randomize_order", "1", "Randomize the order of sending CSQC entities (should behave better when packet size or bandwidth limits are exceeded)."};

Referenced by EntityFrameCSQC_WriteFrame(), and SV_Init().

◆ sv_sound_land

cvar_t sv_sound_land = {CF_SERVER, "sv_sound_land", "demon/dland2.wav", "sound to play when MOVETYPE_STEP entity hits the ground at high speed (empty cvar disables the sound)"}

Definition at line 151 of file sv_main.c.

151{CF_SERVER, "sv_sound_land", "demon/dland2.wav", "sound to play when MOVETYPE_STEP entity hits the ground at high speed (empty cvar disables the sound)"};

Referenced by SV_Init(), and SV_Physics_Step().

◆ sv_sound_watersplash

cvar_t sv_sound_watersplash = {CF_SERVER, "sv_sound_watersplash", "misc/h2ohit1.wav", "sound to play when MOVETYPE_FLY/TOSS/BOUNCE/STEP entity enters or leaves water (empty cvar disables the sound)"}

Definition at line 152 of file sv_main.c.

152{CF_SERVER, "sv_sound_watersplash", "misc/h2ohit1.wav", "sound to play when MOVETYPE_FLY/TOSS/BOUNCE/STEP entity enters or leaves water (empty cvar disables the sound)"};

Referenced by SV_CheckWaterTransition(), and SV_Init().

◆ sv_stepheight

cvar_t sv_stepheight = {CF_SERVER | CF_NOTIFY, "sv_stepheight", "18", "how high you can step up (TW_SV_STEPCONTROL extension)"}

Definition at line 153 of file sv_main.c.

153{CF_SERVER | CF_NOTIFY, "sv_stepheight", "18", "how high you can step up (TW_SV_STEPCONTROL extension)"};

Referenced by CL_CheckBottom(), CL_movestep(), SV_CheckBottom(), SV_Init(), SV_movestep(), SV_WalkMove(), SV_WriteClientdataToMessage(), and VM_CL_checkbottom().

◆ sv_stopspeed

cvar_t sv_stopspeed = {CF_SERVER | CF_NOTIFY, "sv_stopspeed","100", "how fast you come to a complete stop"}

Definition at line 154 of file sv_main.c.

154{CF_SERVER | CF_NOTIFY, "sv_stopspeed","100", "how fast you come to a complete stop"};

Referenced by SV_Init(), SV_UserFriction(), and SV_WriteClientdataToMessage().

◆ sv_threaded

cvar_t sv_threaded = {CF_SERVER, "sv_threaded", "0", "enables a separate thread for server code, improving performance, especially when hosting a game while playing, EXPERIMENTAL, may be crashy"}

Definition at line 170 of file sv_main.c.

170{CF_SERVER, "sv_threaded", "0", "enables a separate thread for server code, improving performance, especially when hosting a game while playing, EXPERIMENTAL, may be crashy"};

Referenced by SV_Init(), and SV_StartThread().

◆ sv_wallfriction

cvar_t sv_wallfriction = {CF_SERVER | CF_NOTIFY, "sv_wallfriction", "1", "how much you slow down when sliding along a wall"}

Definition at line 155 of file sv_main.c.

155{CF_SERVER | CF_NOTIFY, "sv_wallfriction", "1", "how much you slow down when sliding along a wall"};

Referenced by SV_Init(), and SV_WalkMove().

◆ sv_warsowbunny_accel

cvar_t sv_warsowbunny_accel = {CF_SERVER, "sv_warsowbunny_accel", "0.1585", "how fast you accelerate until after reaching sv_maxspeed (it gets harder as you near sv_warsowbunny_topspeed)"}

Definition at line 159 of file sv_main.c.

159{CF_SERVER, "sv_warsowbunny_accel", "0.1585", "how fast you accelerate until after reaching sv_maxspeed (it gets harder as you near sv_warsowbunny_topspeed)"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_warsowbunny_airforwardaccel

cvar_t sv_warsowbunny_airforwardaccel = {CF_SERVER, "sv_warsowbunny_airforwardaccel", "1.00001", "how fast you accelerate until you reach sv_maxspeed"}

Definition at line 158 of file sv_main.c.

158{CF_SERVER, "sv_warsowbunny_airforwardaccel", "1.00001", "how fast you accelerate until you reach sv_maxspeed"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_warsowbunny_backtosideratio

cvar_t sv_warsowbunny_backtosideratio = {CF_SERVER, "sv_warsowbunny_backtosideratio", "0.8", "lower values make it easier to change direction without losing speed; the drawback is \"understeering\" in sharp turns"}

Definition at line 162 of file sv_main.c.

162{CF_SERVER, "sv_warsowbunny_backtosideratio", "0.8", "lower values make it easier to change direction without losing speed; the drawback is \"understeering\" in sharp turns"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_warsowbunny_topspeed

cvar_t sv_warsowbunny_topspeed = {CF_SERVER, "sv_warsowbunny_topspeed", "925", "soft speed limit (can get faster with rjs and on ramps)"}

Definition at line 160 of file sv_main.c.

160{CF_SERVER, "sv_warsowbunny_topspeed", "925", "soft speed limit (can get faster with rjs and on ramps)"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_warsowbunny_turnaccel

cvar_t sv_warsowbunny_turnaccel = {CF_SERVER, "sv_warsowbunny_turnaccel", "0", "max sharpness of turns (also master switch for the sv_warsowbunny_* mode; set this to 9 to enable)"}

Definition at line 161 of file sv_main.c.

161{CF_SERVER, "sv_warsowbunny_turnaccel", "0", "max sharpness of turns (also master switch for the sv_warsowbunny_* mode; set this to 9 to enable)"};

Referenced by SV_Init(), and SV_WriteClientdataToMessage().

◆ sv_wateraccelerate

cvar_t sv_wateraccelerate = {CF_SERVER, "sv_wateraccelerate", "-1", "rate at which a player accelerates to sv_maxspeed while in water, if less than 0 the sv_accelerate variable is used instead"}

Definition at line 156 of file sv_main.c.

156{CF_SERVER, "sv_wateraccelerate", "-1", "rate at which a player accelerates to sv_maxspeed while in water, if less than 0 the sv_accelerate variable is used instead"};

Referenced by SV_Init(), SV_WaterMove(), and SV_WriteClientdataToMessage().

◆ sv_waterfriction

cvar_t sv_waterfriction = {CF_SERVER | CF_NOTIFY, "sv_waterfriction","-1", "how fast you slow down in water, if less than 0 the sv_friction variable is used instead"}

Definition at line 157 of file sv_main.c.

157{CF_SERVER | CF_NOTIFY, "sv_waterfriction","-1", "how fast you slow down in water, if less than 0 the sv_friction variable is used instead"};

Referenced by SV_Init(), SV_WaterMove(), and SV_WriteClientdataToMessage().

◆ sv_worldbasename

cvar_t sv_worldbasename = {CF_SERVER | CF_READONLY, "sv_worldbasename", "", "name of current worldmodel without maps/ prefix or extension"}

Definition at line 40 of file sv_main.c.

40{CF_SERVER | CF_READONLY, "sv_worldbasename", "", "name of current worldmodel without maps/ prefix or extension"};

Referenced by SV_Init(), and SV_SpawnServer().

◆ sv_worldmessage

cvar_t sv_worldmessage = {CF_SERVER | CF_READONLY, "sv_worldmessage", "", "title of current level"}

Definition at line 37 of file sv_main.c.

37{CF_SERVER | CF_READONLY, "sv_worldmessage", "", "title of current level"};

Referenced by SV_Init(), and SV_SpawnServer().

◆ sv_worldname

cvar_t sv_worldname = {CF_SERVER | CF_READONLY, "sv_worldname", "", "name of current worldmodel"}

Definition at line 38 of file sv_main.c.

38{CF_SERVER | CF_READONLY, "sv_worldname", "", "name of current worldmodel"};

Referenced by SV_Init(), and SV_SpawnServer().

◆ sv_worldnamenoextension

cvar_t sv_worldnamenoextension = {CF_SERVER | CF_READONLY, "sv_worldnamenoextension", "", "name of current worldmodel without extension"}

Definition at line 39 of file sv_main.c.

39{CF_SERVER | CF_READONLY, "sv_worldnamenoextension", "", "name of current worldmodel without extension"};

Referenced by SV_Init(), and SV_SpawnServer().

◆ sv_writepicture_quality

cvar_t sv_writepicture_quality = {CF_SERVER | CF_ARCHIVE, "sv_writepicture_quality", "10", "WritePicture quality offset (higher means better quality, but slower)"}

Definition at line 219 of file sv_main.c.

219{CF_SERVER | CF_ARCHIVE, "sv_writepicture_quality", "10", "WritePicture quality offset (higher means better quality, but slower)"};

Referenced by JPEG_SaveImage_to_Buffer(), and SV_Init().

◆ svs

persistant server info

Definition at line 224 of file sv_main.c.

Referenced by Cvar_SetQuick_Internal(), EntityFrameCSQC_WriteFrame(), EntityState5_Priority(), EntityState5_WriteUpdate(), Host_Frame(), Host_Shutdown(), M_Menu_GameOptions_f(), NetConn_BuildStatusResponse(), NetConn_Heartbeat(), NetConn_ServerParsePacket(), SCR_DrawNetGraph(), SV_Begin_f(), SV_BroadcastPrint(), SV_CheckTimeouts(), SV_Color_f(), SV_ConnectClient(), SV_CreateBaseline(), SV_DisableCheats_c(), SV_Download_f(), SV_DropClient(), SV_Ent_Remove_f(), SV_FlushBroadcastMessages(), SV_Frame(), SV_IsLocalServer(), SV_Kick_f(), SV_Loadgame_f(), SV_Map_f(), SV_MarkWriteEntityStateToClient(), SV_MaxPlayers_f(), SV_ModelIndex(), SV_Name_f(), SV_Physics(), SV_Ping_f(), SV_Pings_f(), SV_Prepare_CSQC(), SV_PrepareEntityForSending(), SV_Savegame_f(), SV_Savegame_to(), SV_SaveSpawnparms(), SV_Say(), SV_SendClientMessages(), SV_SendCvar_f(), SV_SendServerinfo(), SV_ServerOptions(), SV_Shutdown(), SV_Spawn_f(), SV_SpawnServer(), SV_StartThread(), SV_Status_f(), SV_StopThread(), SV_Tell_f(), SV_ThreadFunc(), SV_UnstickEntity(), SV_UpdateToReliableMessages(), SV_VM_Setup(), SV_WriteEntitiesToClient(), SVVM_free_edict(), SVVM_init_edict(), Sys_Error(), VM_changelevel(), VM_clientcount(), VM_M_WriteDest(), VM_sprint(), VM_SV_centerprint(), VM_SV_clientcommand(), VM_SV_clienttype(), VM_SV_dropclient(), VM_SV_lightstyle(), VM_SV_newcheckclient(), VM_SV_serverkey(), VM_SV_setcolor(), VM_SV_setspawnparms(), VM_SV_spawnclient(), VM_SV_sprint(), VM_SV_stuffcmd(), and WriteDest().

◆ sys_ticrate

cvar_t sys_ticrate = {CF_SERVER | CF_ARCHIVE, "sys_ticrate","0.01388889", "how long a server frame is in seconds, 0.05 is 20fps server rate, 0.1 is 10fps (can not be set higher than 0.1), 0 runs as many server frames as possible (makes games against bots a little smoother, overwhelms network players), 1/72 matches QuakeWorld physics"}

Definition at line 166 of file sv_main.c.

166{CF_SERVER | CF_ARCHIVE, "sys_ticrate","0.01388889", "how long a server frame is in seconds, 0.05 is 20fps server rate, 0.1 is 10fps (can not be set higher than 0.1), 0 runs as many server frames as possible (makes games against bots a little smoother, overwhelms network players), 1/72 matches QuakeWorld physics"};

Referenced by SV_ExecuteClientMoves(), SV_Frame(), SV_Init(), SV_SendClientDatagram(), SV_ThreadFunc(), and SV_WriteClientdataToMessage().

◆ teamplay

cvar_t teamplay = {CF_SERVER | CF_NOTIFY, "teamplay","0", "teamplay mode, values depend on mod but typically 0 = no teams, 1 = no team damage no self damage, 2 = team damage and self damage, some mods support 3 = no team damage but can damage self"}

Definition at line 172 of file sv_main.c.

172{CF_SERVER | CF_NOTIFY, "teamplay","0", "teamplay mode, values depend on mod but typically 0 = no teams, 1 = no team damage no self damage, 2 = team damage and self damage, some mods support 3 = no team damage but can damage self"};

Referenced by SV_Init(), and SV_VM_Setup().

◆ temp1

cvar_t temp1 = {CF_SERVER, "temp1","0", "general cvar for mods to use, in stock id1 this selects which death animation to use on players (0 = random death, other values select specific death scenes)"}

Definition at line 187 of file sv_main.c.

187{CF_SERVER, "temp1","0", "general cvar for mods to use, in stock id1 this selects which death animation to use on players (0 = random death, other values select specific death scenes)"};

Referenced by SV_Init().

◆ timelimit

cvar_t timelimit = {CF_SERVER | CF_NOTIFY, "timelimit","0", "ends level at this time (in minutes)"}

Definition at line 173 of file sv_main.c.

173{CF_SERVER | CF_NOTIFY, "timelimit","0", "ends level at this time (in minutes)"};

Referenced by M_GameOptions_Draw(), M_NetStart_Change(), SV_Init(), and SV_WriteClientdataToMessage().