Main server include file. More...
#include "../common/common.h"
#include "../shared/infostring.h"
#include "../game/game.h"
#include <SDL_thread.h>
#include "../game/game.h"
Go to the source code of this file.
Data Structures | |
struct | sv_edict_s |
struct | sv_model_s |
static mesh models (none-animated) can have a server side flag set to be clipped for pathfinding More... | |
struct | worldSector_s |
To avoid linearly searching through lists of entities during environment testing, the world is carved up with an evenly spaced, axially aligned bsp tree. More... | |
struct | pending_event_s |
struct | serverInstanceStatic_t |
struct | serverInstanceGame_t |
Struct that is only valid for one map. It's deleted on every map load. More... | |
struct | client_s |
Defines | |
#define | AREA_NODES 32 |
#define | EDICT_NUM(n) ((edict_t *)((byte *)svs.ge->edicts + svs.ge->edict_size * (n))) |
#define | NUM_FOR_EDICT(e) (((byte *)(e) - (byte *)svs.ge->edicts) / svs.ge->edict_size) |
#define | PLAYER_NUM(n) ((player_t *)((byte *)svs.ge->players + svs.ge->player_size * (n))) |
#define | NUM_FOR_PLAYER(e) (((byte *)(e) - (byte *)svs.ge->players) / svs.ge->player_size) |
#define | SV_SetConfigString(index, value) SV_SetConfigString(index, value) |
Typedefs | |
typedef struct sv_edict_s | sv_edict_t |
typedef struct sv_model_s | sv_model_t |
static mesh models (none-animated) can have a server side flag set to be clipped for pathfinding | |
typedef struct worldSector_s | worldSector_t |
To avoid linearly searching through lists of entities during environment testing, the world is carved up with an evenly spaced, axially aligned bsp tree. | |
typedef struct pending_event_s | pending_event_t |
typedef struct client_s | client_t |
Enumerations | |
enum | server_state_t { ss_dead, ss_restart, ss_loading, ss_game } |
enum | client_state_t { cs_free, cs_connected, cs_spawning, cs_began, cs_spawned } |
Functions | |
void | SV_DropClient (client_t *drop, const char *message) |
Called when the player is totally leaving the server, either willingly or unwillingly. This is NOT called if the entire server is quitting or crashing. | |
int | SV_CountPlayers (void) |
Returns the number of spawned players. | |
void | SV_InitOperatorCommands (void) |
void | SV_UserinfoChanged (client_t *cl) |
Pull specific info from a newly changed userinfo string into a more C friendly form. | |
void | SV_ReadPacket (struct net_stream *s) |
char * | SV_GetConfigString (int index) |
int | SV_GetConfigStringInteger (int index) |
char * | SV_SetConfigString (int index,...) |
client_t * | SV_GetNextClient (client_t *lastClient) |
Iterates through clients. | |
client_t * | SV_GetClient (int index) |
void | SV_MapcycleInit (void) |
void | SV_NextMapcycle (void) |
Start the next map in the cycle. | |
void | SV_MapcycleClear (void) |
Empty the mapcycle list. | |
void | SV_Map (qboolean day, const char *levelstring, const char *assembly) |
Change the server to a new map, taking all connected clients along with it. | |
void | SV_Multicast (int mask, struct dbuffer *msg) |
Sends the contents of msg to a subset of the clients, then frees msg. | |
void | SV_StartSound (int mask, const vec3_t origin, const edict_t *entity, const char *sound) |
If origin is NULL, the origin is determined from the entity origin or the midpoint of the entity box for bmodels. | |
void | SV_ClientCommand (client_t *client, const char *fmt,...) __attribute__((format(printf |
void void | SV_ClientPrintf (client_t *cl, int level, const char *fmt,...) __attribute__((format(printf |
void void void | SV_BroadcastPrintf (int level, const char *fmt,...) __attribute__((format(printf |
void void void void | SV_ExecuteClientMessage (client_t *cl, int cmd, struct dbuffer *msg) |
The current net_message is parsed for the given client. | |
void | SV_SetClientState (client_t *client, int state) |
Set the client state. | |
void | SV_SetMaster_f (void) |
Specify a list of master servers. | |
void | SV_Heartbeat_f (void) |
qboolean | SV_CheckMap (const char *map, const char *assembly) |
Checks whether a map exists. | |
int | SV_RunGameFrameThread (void *data) |
Thread for the game frame function. | |
void | SV_RunGameFrame (void) |
Calls the G_RunFrame function from game api let everything in the world think and move. | |
void | SV_InitGameProgs (void) |
Init the game subsystem for a new map. | |
void | SV_ShutdownGameProgs (void) |
Called when either the entire server is being killed, or it is changing to a different game directory. | |
void | SV_ClearWorld (void) |
Clear physics interaction links. | |
void | SV_UnlinkEdict (edict_t *ent) |
call before removing an entity, and before trying to move one, so it doesn't clip against itself | |
void | SV_LinkEdict (edict_t *ent) |
Needs to be called any time an entity changes origin, mins, maxs, or solid. Automatically unlinks if needed. Sets ent->absmin and ent->absmax. | |
int | SV_AreaEdicts (const vec3_t mins, const vec3_t maxs, edict_t **list, int maxcount) |
int | SV_TouchEdicts (const vec3_t mins, const vec3_t maxs, edict_t **list, int maxCount, edict_t *skip) |
Fills a list with edicts that are in use and are touching the given bounding box. | |
int | SV_PointContents (vec3_t p) |
Returns the content flags for a given point. | |
const char * | SV_GetFootstepSound (const char *texture) |
float | SV_GetBounceFraction (const char *texture) |
Different terrain types might have different bounce fraction. | |
qboolean | SV_LoadModelMinsMaxs (const char *model, int frame, vec3_t mins, vec3_t maxs) |
Load the mins, maxs for the model on the serverside for pathfinding and clipping. | |
trace_t | SV_Trace (const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, const edict_t *passedict, int contentmask) |
Moves the given mins/maxs volume through the world from start to end. | |
Variables | |
memPool_t * | sv_genericPool |
serverInstanceStatic_t | svs |
serverInstanceGame_t | sv |
cvar_t * | sv_mapname |
cvar_t * | sv_public |
cvar_t * | sv_dumpmapassembly |
cvar_t * | sv_threads |
Main server include file.
Definition in file server.h.
Definition at line 128 of file server.h.
Referenced by SV_TouchEdicts().
Definition at line 131 of file server.h.
Referenced by SVC_DirectConnect().
#define SV_SetConfigString | ( | index, | |||
value | ) | SV_SetConfigString(index, value) |
Definition at line 179 of file server.h.
Referenced by SV_Configstring(), SV_FindIndex(), and SV_Map().
a client can leave the server in one of four ways:
typedef struct pending_event_s pending_event_t |
typedef struct sv_edict_s sv_edict_t |
typedef struct sv_model_s sv_model_t |
static mesh models (none-animated) can have a server side flag set to be clipped for pathfinding
typedef struct worldSector_s worldSector_t |
To avoid linearly searching through lists of entities during environment testing, the world is carved up with an evenly spaced, axially aligned bsp tree.
enum client_state_t |
enum server_state_t |
[in] | mins | The mins of the bounding box |
[in] | maxs | The maxs of the bounding box |
[out] | list | The edict list that this trace is hitting |
[in] | maxCount | The size of the given list |
Definition at line 313 of file sv_world.c.
References areaParms_t::areaEdictList, areaParms_t::areaEdictListCount, areaParms_t::areaEdictListMaxCount, areaParms_t::areaMaxs, areaParms_t::areaMins, sv, SV_AreaEdicts_r(), and serverInstanceGame_t::worldSectors.
Referenced by SV_ClipMoveToEntities(), and SV_InitGameProgs().
void void void SV_BroadcastPrintf | ( | int | level, | |
const char * | fmt, | |||
... | ||||
) |
Referenced by SV_DropClient(), SV_InitGameProgs(), and SV_Kick_f().
qboolean SV_CheckMap | ( | const char * | map, | |
const char * | assembly | |||
) |
Checks whether a map exists.
Definition at line 105 of file sv_ccmds.c.
References Com_Printf(), Com_sprintf(), FS_CheckFile(), MAX_QPATH, qfalse, and qtrue.
Referenced by SV_Map_f(), and SV_MapcycleAdd_f().
void SV_ClearWorld | ( | void | ) |
Clear physics interaction links.
Definition at line 87 of file sv_world.c.
References serverInstanceGame_t::mapData, mapData_s::mapMax, mapData_s::mapMin, sv, and SV_CreateWorldSector().
Referenced by SV_Map().
void SV_ClientCommand | ( | client_t * | client, | |
const char * | fmt, | |||
... | ||||
) |
Referenced by SV_CheckGameStart(), and SV_New_f().
void void SV_ClientPrintf | ( | client_t * | cl, | |
int | level, | |||
const char * | fmt, | |||
... | ||||
) |
Referenced by SV_PlayerPrintf().
int SV_CountPlayers | ( | void | ) |
Returns the number of spawned players.
Definition at line 851 of file sv_main.c.
References cl, count, cs_spawned, serverInstanceStatic_t::initialized, client_s::state, SV_GetNextClient(), and svs.
void SV_DropClient | ( | client_t * | drop, | |
const char * | message | |||
) |
Called when the player is totally leaving the server, either willingly or unwillingly. This is NOT called if the entire server is quitting or crashing.
Definition at line 136 of file sv_main.c.
References serverInstanceStatic_t::abandon, cl, count, cs_connected, cs_free, cs_spawned, cs_spawning, serverInstanceStatic_t::ge, player_s::inuse, serverInstanceStatic_t::killserver, client_s::name, NET_StreamFinished(), NET_WriteByte(), NET_WriteMsg(), NET_WriteString(), new_dbuffer(), client_s::player, PRINT_CHAT, qfalse, qtrue, serverInstanceStatic_t::serverMutex, client_s::state, client_s::stream, SV_BroadcastPrintf(), SV_GetNextClient(), SV_SetClientState(), svc_disconnect, and svs.
Referenced by SV_Begin_f(), SV_Disconnect_f(), SV_ExecuteClientMessage(), SV_Kick_f(), SV_New_f(), and SV_Spawn_f().
The current net_message is parsed for the given client.
Definition at line 227 of file sv_user.c.
References clc_action, clc_endround, clc_initactorstates, clc_nop, clc_stringcmd, clc_teaminfo, clc_userinfo, Com_DPrintf(), Com_Printf(), cs_free, DEBUG_SERVER, serverInstanceStatic_t::ge, serverInstanceGame_t::messageBuffer, NET_ReadString(), client_s::player, serverInstanceStatic_t::serverMutex, client_s::state, sv, SV_DropClient(), SV_ExecuteUserCommand(), SV_UserinfoChanged(), svs, and client_s::userinfo.
Referenced by SV_ReadPacket().
float SV_GetBounceFraction | ( | const char * | texture | ) |
Different terrain types might have different bounce fraction.
Definition at line 604 of file sv_world.c.
References terrainType_s::bounceFraction, and Com_GetTerrainType().
Referenced by SV_InitGameProgs().
client_t* SV_GetClient | ( | int | index | ) |
Definition at line 126 of file sv_main.c.
References serverInstanceStatic_t::clients, and svs.
Referenced by SV_CheckGameStart(), SV_New_f(), SV_PlayerPrintf(), and SVC_DirectConnect().
char* SV_GetConfigString | ( | int | index | ) |
Definition at line 51 of file sv_main.c.
References Com_Error(), serverInstanceGame_t::configstrings, ERR_FATAL, MAX_CONFIGSTRINGS, and sv.
Referenced by SV_FindIndex(), SV_Map(), SV_New_f(), and SV_PrintConfigStrings_f().
int SV_GetConfigStringInteger | ( | int | index | ) |
Definition at line 58 of file sv_main.c.
References Com_Error(), serverInstanceGame_t::configstrings, ERR_FATAL, MAX_CONFIGSTRINGS, and sv.
Referenced by SV_Map(), and SV_Status_f().
const char* SV_GetFootstepSound | ( | const char * | texture | ) |
Definition at line 593 of file sv_world.c.
References Com_GetTerrainType(), and terrainType_s::footStepSound.
Referenced by SV_InitGameProgs().
Iterates through clients.
[in] | lastClient | Pointer of the client to iterate from. call with NULL to get the first one. |
Definition at line 104 of file sv_main.c.
References serverInstanceStatic_t::clients, cvar_s::integer, and svs.
Referenced by SV_BroadcastPrintf(), SV_CheckGameStart(), SV_CountPlayers(), SV_DropClient(), SV_FinalMessage(), SV_GetPlayerClientStructure(), SV_Map(), SV_Multicast(), SV_StartGame_f(), SV_Status_f(), SVC_DirectConnect(), SVC_Info(), SVC_Status(), and SVC_TeamInfo().
void SV_Heartbeat_f | ( | void | ) |
Definition at line 33 of file sv_ccmds.c.
References serverInstanceStatic_t::lastHeartbeat, and svs.
Referenced by SV_InitGame(), SV_InitOperatorCommands(), and SV_SetMaster_f().
void SV_InitGameProgs | ( | void | ) |
Init the game subsystem for a new map.
Definition at line 563 of file sv_game.c.
References game_export_t::apiversion, Cbuf_AddText(), Cmd_Argc(), Cmd_Args(), Cmd_Argv(), Com_Error(), Com_GetCharacterValues(), Com_GetConstInt(), Com_GetConstIntFromNamespace(), Com_GetConstVariable(), Com_GrenadeTarget(), Com_RegisterConstInt(), Com_UnregisterConstVariable(), csi, Cvar_Get(), Cvar_GetString(), Cvar_Set(), ERR_DROP, FS_FreeFile(), FS_Gamedir(), FS_LoadFile(), GAME_API_VERSION, serverInstanceGame_t::gameSysPool, serverInstanceStatic_t::gameThread, serverInstanceStatic_t::ge, Grid_Fall(), Grid_Floor(), Grid_GetTUsForDirection(), Grid_MoveCalc(), Grid_MoveLength(), Grid_MoveNext(), Grid_MoveStore(), Grid_PosToVec(), cvar_s::integer, mapData_s::map, serverInstanceGame_t::mapData, Mem_CreatePool, sv, SV_AbortEvents(), SV_AddEvent(), SV_AreaEdicts(), SV_BroadcastPrintf(), SV_Configstring(), SV_dprintf(), SV_EndEvents(), SV_error(), SV_FreeTags(), SV_GetBounceFraction(), SV_GetEvent(), SV_GetFootstepSound(), SV_GetGameAPI(), SV_LinkEdict(), SV_LoadModelMinsMaxs(), SV_MemFree(), SV_ModelIndex(), SV_PlayerPrintf(), SV_PointContents(), SV_ReadAngle(), SV_ReadByte(), SV_ReadChar(), SV_ReadData(), SV_ReadDir(), SV_ReadFormat(), SV_ReadGPos(), SV_ReadLong(), SV_ReadPos(), SV_ReadShort(), SV_ReadString(), SV_RecalcRouting(), SV_RunGameFrameThread(), SV_SetInlineModelOrientation(), SV_SetModel(), SV_StartSound(), SV_TagAlloc(), SV_TestLine(), SV_TestLineWithEnt(), sv_threads, SV_TouchEdicts(), SV_Trace(), SV_UnlinkEdict(), SV_WriteAngle(), SV_WriteByte(), SV_WriteChar(), SV_WriteDir(), SV_WriteDummyByte(), SV_WriteFormat(), SV_WriteGPos(), SV_WriteLong(), SV_WritePos(), SV_WriteShort(), SV_WriteString(), svs, and Sys_Milliseconds().
Referenced by SV_InitGame().
void SV_InitOperatorCommands | ( | void | ) |
Definition at line 574 of file sv_ccmds.c.
References Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), SV_CompleteMapCommand(), SV_CompleteServerCommand(), SV_Heartbeat_f(), SV_Kick_f(), SV_KillServer_f(), SV_ListMaps_f(), SV_Map_f(), SV_PrintConfigStrings_f(), SV_ServerCommand_f(), SV_Serverinfo_f(), SV_SetMaster_f(), SV_StartGame_f(), SV_Status_f(), and SV_UserInfo_f().
Referenced by SV_Init().
void SV_LinkEdict | ( | edict_t * | ent | ) |
Needs to be called any time an entity changes origin, mins, maxs, or solid. Automatically unlinks if needed. Sets ent->absmin and ent->absmax.
Definition at line 140 of file sv_world.c.
References edict_s::absmax, edict_s::absmin, edict_s::angles, worldSector_s::axis, edict_s::child, worldSector_s::children, worldSector_s::dist, game_export_t::edicts, sv_edict_s::ent, worldSector_s::entities, serverInstanceStatic_t::ge, edict_s::inuse, LEAFNODE, edict_s::linkcount, sv_edict_s::linked, m, edict_s::maxs, edict_s::mins, sv_edict_s::nextEntityInWorldSector, edict_s::origin, qtrue, edict_s::size, edict_s::solid, SOLID_BSP, SOLID_NOT, sv, SV_GetServerDataForEdict(), SV_LinkEdict(), SV_UnlinkEdict(), svs, UNIT_SIZE, VectorAdd, VectorCenterFromMinsMaxs(), VectorCopy, VectorCreateRotationMatrix(), VectorNotEmpty, VectorRotate(), VectorSubtract, sv_edict_s::worldSector, and serverInstanceGame_t::worldSectors.
Referenced by SV_InitGameProgs(), and SV_LinkEdict().
Load the mins, maxs for the model on the serverside for pathfinding and clipping.
[in] | model | The relative model path to load the mins, maxs for |
[in] | frame | The frame to load the mins and maxs vectors for |
[out] | mins | The mins vector of the model - this is absolute to the worldorigin (0,0,0) |
[out] | maxs | The maxs vector of the model - this is absolute to the worldorigin (0,0,0) |
Definition at line 708 of file sv_world.c.
References byte, ClearBounds(), Com_Error(), com_genericPool, DPMHEADER, ERR_DROP, sv_model_s::frame, FS_FreeFile(), FS_LoadFile(), i, IDALIASHEADER, IDMD3HEADER, LittleLong(), MAX_MOD_KNOWN, sv_model_s::maxs, Mem_PoolStrDup, sv_model_s::mins, sv_model_s::name, serverInstanceGame_t::numSVModels, Q_strcasecmp, qfalse, qtrue, sv, SV_ModLoadAliasDPMModel(), SV_ModLoadAliasMD2Model(), SV_ModLoadAliasMD3Model(), SV_ModLoadObjModel(), serverInstanceGame_t::svModels, vec3_origin, and VectorCopy.
Referenced by SV_InitGameProgs().
void SV_Map | ( | qboolean | day, | |
const char * | levelstring, | |||
const char * | assembly | |||
) |
Change the server to a new map, taking all connected clients along with it.
Definition at line 110 of file sv_init.c.
References serverInstanceGame_t::assembly, Cbuf_CopyToDefer(), cl, CM_InlineModel(), CM_LoadMap(), Com_DPrintf(), Com_GetScriptChecksum(), Com_Printf(), Com_SetServerState(), cs_connected, CS_LIGHTMAP, CS_MAPCHECKSUM, CS_MAPTITLE, CS_NAME, CS_OBJECTAMOUNT, CS_POSITIONS, cs_spawning, CS_TILES, CS_UFOCHECKSUM, CS_VERSION, csi, Cvar_FullSet(), CVAR_NOSET, CVAR_SERVERINFO, DEBUG_SERVER, serverInstanceStatic_t::ge, i, serverInstanceStatic_t::initialized, map, mapData_s::mapChecksum, serverInstanceGame_t::mapData, mapData_s::mapEntityString, serverInstanceGame_t::mapTiles, Mem_Free, serverInstanceGame_t::models, serverInstanceGame_t::name, mapData_s::numInline, csi_s::numODs, pos, Q_strncpyz(), SCR_BeginLoadingPlaque(), serverInstanceStatic_t::serverMutex, ss_game, ss_loading, ss_restart, client_s::state, SV_AssembleMap(), SV_ClearWorld(), SV_GetConfigString(), SV_GetConfigStringInteger(), SV_GetMapTitle(), SV_GetNextClient(), SV_InitGame(), sv_mapname, SV_SetClientState(), SV_SetConfigString, UFO_VERSION, and va().
Referenced by SV_Map_f().
void SV_MapcycleClear | ( | void | ) |
Empty the mapcycle list.
Definition at line 142 of file sv_mapcycle.c.
References i, mapcycle_s::map, mapcycleCount, Mem_Free, mapcycle_s::next, and mapcycle_s::type.
Referenced by SV_Clear(), and SV_MapcycleInit().
void SV_MapcycleInit | ( | void | ) |
Definition at line 284 of file sv_mapcycle.c.
References Cmd_AddCommand(), SV_MapcycleAdd_f(), SV_MapcycleClear(), SV_MapcycleList_f(), SV_MapcycleNext_f(), and SV_ParseMapcycle().
Referenced by SV_Init().
void SV_Multicast | ( | int | mask, | |
struct dbuffer * | msg | |||
) |
Sends the contents of msg to a subset of the clients, then frees msg.
[in] | mask | Bitmask of the players to send the multicast to |
[in,out] | msg | The message to send to the clients |
Definition at line 130 of file sv_send.c.
References cl, cs_connected, free_dbuffer(), NET_WriteConstMsg(), client_s::state, client_s::stream, and SV_GetNextClient().
Referenced by SV_Configstring(), SV_EndEvents(), SV_FindIndex(), and SV_StartSound().
void SV_NextMapcycle | ( | void | ) |
Start the next map in the cycle.
Definition at line 20 of file sv_mapcycle.c.
References serverInstanceGame_t::assembly, Cbuf_AddText(), Com_DPrintf(), Com_Printf(), Com_SetGameType(), Com_sprintf(), Cvar_Set(), mapcycle_s::day, DEBUG_SERVER, FS_CheckFile(), i, mapcycle_s::map, map, mapcycleCount, MAX_QPATH, cvar_s::modified, serverInstanceGame_t::name, mapcycle_s::next, Q_strncpyz(), qfalse, qtrue, sv, sv_gametype, and mapcycle_s::type.
Referenced by SV_Frame(), and SV_MapcycleNext_f().
int SV_PointContents | ( | vec3_t | p | ) |
Returns the content flags for a given point.
Definition at line 491 of file sv_world.c.
References CM_CompleteBoxTrace(), trace_s::contentFlags, trace_s::fraction, serverInstanceGame_t::mapTiles, MASK_ALL, sv, TRACING_ALL_VISIBLE_LEVELS, and vec3_origin.
Referenced by SV_InitGameProgs().
void SV_ReadPacket | ( | struct net_stream * | s | ) |
Definition at line 494 of file sv_main.c.
References cl, clc_oob, free_dbuffer(), NET_ReadByte(), NET_ReadMsg(), NET_StreamFree(), NET_StreamGetData(), SV_ConnectionlessPacket(), and SV_ExecuteClientMessage().
Referenced by SV_InitGame().
void SV_RunGameFrame | ( | void | ) |
Calls the G_RunFrame function from game api let everything in the world think and move.
Definition at line 550 of file sv_game.c.
References serverInstanceGame_t::endgame, serverInstanceStatic_t::ge, serverInstanceStatic_t::serverMutex, sv, and svs.
Referenced by SV_Frame(), and SV_RunGameFrameThread().
int SV_RunGameFrameThread | ( | void * | data | ) |
Thread for the game frame function.
Definition at line 535 of file sv_game.c.
References serverInstanceGame_t::endgame, sv, and SV_RunGameFrame().
Referenced by SV_InitGameProgs().
void SV_SetClientState | ( | client_t * | client, | |
int | state | |||
) |
Set the client state.
Definition at line 35 of file sv_user.c.
References Com_DPrintf(), DEBUG_SERVER, client_s::name, and client_s::state.
Referenced by SV_Begin_f(), SV_DropClient(), SV_Map(), SV_New_f(), SV_Spawn_f(), and SVC_DirectConnect().
char* SV_SetConfigString | ( | int | index, | |
... | ||||
) |
Definition at line 65 of file sv_main.c.
References Com_Error(), serverInstanceGame_t::configstrings, CS_LIGHTMAP, CS_MAPCHECKSUM, CS_OBJECTAMOUNT, CS_POSITIONS, CS_TILES, CS_UFOCHECKSUM, ERR_FATAL, MAX_CONFIGSTRINGS, MAX_TILESTRINGS, MAX_TOKEN_CHARS, Q_strncpyz(), sv, and va().
void SV_SetMaster_f | ( | void | ) |
Specify a list of master servers.
Definition at line 43 of file sv_ccmds.c.
References Com_DPrintf(), Com_Printf(), Cvar_Set(), DEBUG_SERVER, HTTP_GetURL(), cvar_s::integer, masterserver_url, Mem_Free, port, cvar_s::string, sv_dedicated, SV_Heartbeat_f(), sv_maxclients, and va().
Referenced by SV_InitGame(), and SV_InitOperatorCommands().
void SV_ShutdownGameProgs | ( | void | ) |
Called when either the entire server is being killed, or it is changing to a different game directory.
Definition at line 501 of file sv_game.c.
References Cmd_ExecuteString(), Com_Printf(), serverInstanceGame_t::gameSysPool, serverInstanceStatic_t::gameThread, serverInstanceStatic_t::ge, Mem_DeletePool, Mem_PoolSize, memPool_s::name, sv, SV_UnloadGame(), svs, and va().
Referenced by SV_Shutdown().
If origin is NULL, the origin is determined from the entity origin or the midpoint of the entity box for bmodels.
Definition at line 155 of file sv_send.c.
References edict_s::maxs, edict_s::mins, NET_WriteByte(), NET_WritePos(), NET_WriteString(), new_dbuffer(), edict_s::origin, edict_s::solid, SOLID_BSP, SV_Multicast(), svc_sound, VectorAdd, VectorCenterFromMinsMaxs(), and VectorCopy.
Referenced by SV_InitGameProgs().
int SV_TouchEdicts | ( | const vec3_t | mins, | |
const vec3_t | maxs, | |||
edict_t ** | list, | |||
int | maxCount, | |||
edict_t * | skip | |||
) |
Fills a list with edicts that are in use and are touching the given bounding box.
[in] | mins | The mins of the bounding box |
[in] | maxs | The maxs of the bounding box |
[out] | list | The edict list that this trace is hitting |
[in] | maxCount | The size of the given list |
[in] | skip | An edict to skip (e.g. pointer to the calling edict) |
Definition at line 338 of file sv_world.c.
References EDICT_NUM, serverInstanceStatic_t::ge, i, game_export_t::num_edicts, edict_s::solid, SOLID_NOT, SV_BoundingBoxesIntersect(), and svs.
Referenced by SV_InitGameProgs().
trace_t SV_Trace | ( | const vec3_t | start, | |
const vec3_t | mins, | |||
const vec3_t | maxs, | |||
const vec3_t | end, | |||
const edict_t * | passedict, | |||
int | contentmask | |||
) |
Moves the given mins/maxs volume through the world from start to end.
[in] | start | The starting position in the world for this trace |
[in] | end | The position in the world where this trace should stop |
[in] | passedict | is explicitly excluded from clipping checks (normally NULL) if the entire move stays in a solid volume, trace.allsolid will be set, trace.startsolid will be set, and trace.fraction will be 0 if the starting point is in a solid, it will be allowed to move out to an open area |
[in] | contentmask | brushes the trace should stop at (see MASK_*) |
[in] | mins | The mins of the bounding box that is moved through the world |
[in] | maxs | The maxs of the bounding box that is moved through the world |
clip.trace.mapTile
to get the correct one Definition at line 546 of file sv_world.c.
References moveclip_t::boxmaxs, moveclip_t::boxmins, CM_CompleteBoxTrace(), Com_Printf(), moveclip_t::contentmask, game_export_t::edicts, moveclip_t::end, trace_s::ent, trace_s::fraction, serverInstanceStatic_t::ge, serverInstanceGame_t::mapTiles, moveclip_t::maxs, moveclip_t::mins, moveclip_t::passedict, moveclip_t::start, sv, SV_ClipMoveToEntities(), SV_TraceBounds(), svs, moveclip_t::trace, TRACING_ALL_VISIBLE_LEVELS, and vec3_origin.
Referenced by SV_InitGameProgs().
void SV_UnlinkEdict | ( | edict_t * | ent | ) |
call before removing an entity, and before trying to move one, so it doesn't clip against itself
Definition at line 103 of file sv_world.c.
References edict_s::child, Com_Printf(), worldSector_s::entities, sv_edict_s::linked, sv_edict_s::nextEntityInWorldSector, qfalse, SV_GetServerDataForEdict(), SV_UnlinkEdict(), and sv_edict_s::worldSector.
Referenced by SV_InitGameProgs(), SV_LinkEdict(), and SV_UnlinkEdict().
void SV_UserinfoChanged | ( | client_t * | cl | ) |
Pull specific info from a newly changed userinfo string into a more C friendly form.
Definition at line 667 of file sv_main.c.
References Com_DPrintf(), DEBUG_SERVER, serverInstanceStatic_t::ge, i, Info_ValueForKey(), client_s::messagelevel, client_s::name, client_s::player, serverInstanceStatic_t::serverMutex, svs, and client_s::userinfo.
Referenced by SV_ExecuteClientMessage(), and SVC_DirectConnect().
server data per game/map
Definition at line 35 of file sv_init.c.
Referenced by Com_ServerState(), Com_SetServerState(), SV_AbortEvents(), SV_AddEvent(), SV_AreaEdicts(), SV_CheckGameStart(), SV_ClearWorld(), SV_ClipMoveToEntities(), SV_CreateWorldSector(), SV_EndEvents(), SV_ExecuteClientMessage(), SV_Frame(), SV_FreeTags(), SV_GetConfigString(), SV_GetConfigStringInteger(), SV_GetEvent(), SV_GetMapData(), SV_GetMapTiles(), SV_GetServerDataForEdict(), SV_HullForEntity(), SV_InitGameProgs(), SV_LinkEdict(), SV_LoadModelMinsMaxs(), SV_NextMapcycle(), SV_PointContents(), SV_ReadAngle(), SV_ReadByte(), SV_ReadChar(), SV_ReadData(), SV_ReadDir(), SV_ReadFormat(), SV_ReadGPos(), SV_ReadLong(), SV_ReadPos(), SV_ReadShort(), SV_ReadString(), SV_RecalcRouting(), SV_RunGameFrame(), SV_RunGameFrameThread(), SV_SetConfigString(), SV_SetInlineModelOrientation(), SV_SetModel(), SV_Shutdown(), SV_ShutdownGameProgs(), SV_Status_f(), SV_TagAlloc(), SV_TestLine(), SV_TestLineWithEnt(), SV_Trace(), SV_WriteAngle(), SV_WriteByte(), SV_WriteChar(), SV_WriteDir(), SV_WriteDummyByte(), SV_WriteFormat(), SV_WriteGPos(), SV_WriteLong(), SV_WritePos(), SV_WriteShort(), SV_WriteString(), SVC_DirectConnect(), SVC_Info(), and TexinfoForBrushTexture().
Definition at line 43 of file sv_main.c.
Referenced by SV_AssembleMap(), and SV_CalcRating().
Definition at line 49 of file sv_main.c.
Referenced by SV_InitGame(), and SV_MapcycleAdd().
should heartbeats be sent? (only for public servers)
should heartbeats be sent
Definition at line 46 of file sv_main.c.
Referenced by SV_InitGame().
run the game lib threaded
Definition at line 44 of file sv_main.c.
Referenced by SV_AddMapTiles(), SV_AssembleMap(), SV_InitGameProgs(), and SV_ParallelSearch().
persistant server instance info
Definition at line 34 of file sv_init.c.
Referenced by Master_Heartbeat(), SV_Begin_f(), SV_CountPlayers(), SV_DropClient(), SV_ExecuteClientMessage(), SV_ExecuteUserCommand(), SV_Frame(), SV_GetClient(), SV_GetGameAPI(), SV_GetNextClient(), SV_Heartbeat_f(), SV_Init(), SV_InitGameProgs(), SV_Kick_f(), SV_KillServer_f(), SV_LinkEdict(), SV_LoadGame(), SV_RunGameFrame(), SV_ServerCommand_f(), SV_Shutdown(), SV_ShutdownGameProgs(), SV_ShutdownWhenEmpty(), SV_Spawn_f(), SV_Status_f(), SV_TouchEdicts(), SV_Trace(), SV_UnloadGame(), SV_UserInfo_f(), SV_UserinfoChanged(), SVC_DirectConnect(), SVC_Status(), and SVC_TeamInfo().