Quake II RTX doxygen
1.0 dev
|
|
Go to the documentation of this file.
46 framediv = sv_fps->integer / BASE_FRAMERATE;
50 clamp(framediv, 1, MAX_FRAMEDIV);
52 sv.framerate = framediv * BASE_FRAMERATE;
53 sv.frametime = BASE_FRAMETIME / framediv;
54 sv.framediv = framediv;
70 delta =
m->adr.port ? 24 * 60 * 60 : 3 * 60 * 60;
71 if (now < m->last_resolved) {
72 m->last_resolved = now;
75 if (now -
m->last_resolved < delta) {
81 Com_WPrintf(
"Couldn't resolve master: %s\n",
m->name);
84 m->last_resolved = now = time(NULL);
93 char buffer[MAX_QPATH], *str;
100 len =
Q_concat(buffer,
sizeof(buffer), path, server,
".ent", NULL);
101 if (len >=
sizeof(buffer)) {
102 len = Q_ERR_NAMETOOLONG;
108 if (len == Q_ERR_NOENT) {
114 if (len > MAX_MAP_ENTSTRING) {
119 Com_Printf(
"Loaded entity string from %s\n", buffer);
126 Com_EPrintf(
"Couldn't load entity string from %s: %s\n",
147 Com_Printf(
"------- Server Initialization -------\n");
148 Com_Printf(
"SpawnServer: %s\n", cmd->
server);
150 static qboolean warning_printed = qfalse;
153 Com_Printf(
"\nWARNING: Dedicated coop servers save game state into the same place as single player game by default (currently '%s/%s'). "
154 "To override that, set the 'sv_savedir' console variable. To host multiple dedicated coop servers on one machine, set that cvar "
155 "to different values on different instances of the server.\n\n",
fs_gamedir,
Cvar_WeakGet(
"sv_savedir")->
string);
157 warning_printed = qtrue;
174 memset(&
sv, 0,
sizeof(
sv));
202 if (cmd->
state == ss_game) {
210 for (i = 1; i <
sv.
cm.cache->nummodels; i++) {
269 SV_SetConsoleTitle();
274 Com_Printf(
"-------------------------------------\n");
287 char expanded[MAX_QPATH];
305 Cvar_Set(
"nextserver",
va(
"gamemap \"%s\"", ch + 1));
322 if (!COM_CompareExtension(s,
".pcx")) {
323 len =
Q_concat(expanded,
sizeof(expanded),
"pics/", s, NULL);
324 if (len >=
sizeof(expanded)) {
325 ret = Q_ERR_NAMETOOLONG;
327 ret = FS_LoadFile(expanded, NULL);
331 else if (!COM_CompareExtension(s,
".cin")) {
333 cmd->
state = ss_cinematic;
336 len =
Q_concat(expanded,
sizeof(expanded),
"maps/", s,
".bsp", NULL);
337 if (len >=
sizeof(expanded)) {
338 ret = Q_ERR_NAMETOOLONG;
342 cmd->
state = ss_game;
346 Com_Printf(
"Couldn't load %s: %s\n", expanded,
Q_ErrorString(ret));
369 SV_Shutdown(
"Server restarted\n", ERR_RECONNECT | mvd_spawn);
377 memset(&
sv, 0,
sizeof(
sv));
381 sv.frametime = BASE_FRAMETIME;
398 Com_Printf(
"Deathmatch and Coop both set, disabling Coop\n");
421 Cvar_FullSet(
"maxclients",
"1", CVAR_SERVERINFO | CVAR_LATCH, FROM_CODE);
442 svs.z.zalloc = SV_zalloc;
443 svs.z.zfree = SV_zfree;
444 if (deflateInit2(&
svs.z, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
445 -MAX_WBITS, 9, Z_DEFAULT_STRATEGY) != Z_OK) {
446 Com_Error(ERR_FATAL,
"%s: deflateInit2() failed", __func__);
469 ent->s.number = entnum;
void SV_Shutdown(const char *finalmsg, error_type_t type)
cvar_t * Cvar_Set(const char *var_name, const char *value)
void CM_FreeMap(cm_t *cm)
static void set_frame_time(void)
void SV_BroadcastCommand(const char *fmt,...)
char * NET_AdrToString(const netadr_t *a)
qerror_t CM_LoadMap(cm_t *cm, const char *name)
entity_packed_t * entities
void SV_CheckForSavegame(mapcmd_t *cmd)
const char * Q_ErrorString(qerror_t error)
void SV_SendClientMessages(void)
static void override_entity_string(const char *server)
#define SV_InfoSet(var, val)
cvar_t * sv_airaccelerate
unsigned Sys_Milliseconds(void)
void CL_Disconnect(error_type_t type)
#define FOR_EACH_MASTER(m)
void SV_MvdMapChanged(void)
#define FOR_EACH_CLIENT(client)
cvar_t * sv_reserved_slots
static void resolve_masters(void)
void Com_Error(error_type_t type, const char *fmt,...)
#define HEARTBEAT_SECONDS
void SV_SendAsyncPackets(void)
qboolean SV_ParseMapCmd(mapcmd_t *cmd)
void AC_Connect(unsigned mvd_spawn)
void SV_SpawnServer(mapcmd_t *cmd)
#define SV_LoadFile(path, buf)
char * va(const char *format,...)
int Cvar_VariableInteger(const char *var_name)
qboolean NET_StringToAdr(const char *s, netadr_t *a, int default_port)
void NET_Config(netflag_t flag)
size_t Q_strlcpy(char *dst, const char *src, size_t size)
void SV_InitGameProgs(void)
void Cvar_SetInteger(cvar_t *var, int value, from_t from)
cvar_t * Cvar_FullSet(const char *var_name, const char *value, int flags, from_t from)
cvar_t * Cvar_WeakGet(const char *var_name)
int Cvar_ClampInteger(cvar_t *var, int min, int max)
void SV_InitGame(unsigned mvd_spawn)
void Cvar_GetLatchedVars(void)
void SV_ShutdownGameProgs(void)
void SCR_BeginLoadingPlaque(void)
size_t Q_concat(char *dest, size_t size,...)
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
cvar_t * map_override_path
char fs_gamedir[MAX_OSPATH]
void SV_ClientReset(client_t *client)