|
UFO: Alien Invasion
|
Interface to the game library. More...
#include "server.h"#include "sv_log.h"#include "../common/grid.h"#include "../common/routing.h"#include "../ports/system.h"#include "../shared/thread.h"#include "../shared/scopedmutex.h"
Go to the source code of this file.
Data Structures | |
| struct | eventNames_t |
Macros | |
| #define | M(x) |
Functions | |
| static void | SV_dprintf (const char *fmt,...) |
| Debug print to server console. | |
| static void | SV_PlayerPrintf (const SrvPlayer *player, int level, const char *fmt, va_list ap) |
| Print to a single client. | |
| static float | SV_GetVisibility (const pos3_t position) |
| Glue function to get the visibility from a given position. | |
| static void | SV_error (const char *fmt,...) |
| Abort the server with a game error. | |
| static unsigned int | SV_FindIndex (const char *name, int start, int max, bool create) |
| Search the index in the config strings relative to a given start. | |
| static unsigned int | SV_ModelIndex (const char *name) |
| static void | SV_SetModel (edict_t *ent, const char *name) |
| static void | SV_Configstring (int index, const char *fmt,...) |
| static void | SV_WriteChar (char c) |
| static void | SV_WriteByte (byte c) |
| static void | SV_WriteShort (int c) |
| static void | SV_WriteLong (int c) |
| static void | SV_WriteString (const char *s) |
| static void | SV_WritePos (const vec3_t pos) |
| static void | SV_WriteGPos (const pos3_t pos) |
| static void | SV_WriteDir (const vec3_t dir) |
| static void | SV_WriteAngle (float f) |
| static void | SV_WriteFormat (const char *format,...) |
| static int | SV_ReadChar (void) |
| static int | SV_ReadByte (void) |
| static int | SV_ReadShort (void) |
| static int | SV_ReadLong (void) |
| static int | SV_ReadString (char *str, size_t length) |
| static void | SV_ReadPos (vec3_t pos) |
| static void | SV_ReadGPos (pos3_t pos) |
| static void | SV_ReadDir (vec3_t vector) |
| static float | SV_ReadAngle (void) |
| static void | SV_ReadData (void *buffer, int size) |
| static void | SV_ReadFormat (const char *format,...) |
| static void | SV_AbortEvents (void) |
| static void | SV_SendQueuedEvents (void) |
| static void | SV_EndEvents (void) |
| CASSERT (lengthof(eventNames)==EV_NUM_EVENTS) | |
| static void | SV_AddEvent (unsigned int mask, int eType, int entnum) |
| static void | SV_QueueEvent (unsigned int mask, int eType, int entnum) |
| static void | SV_QueueWriteByte (byte c) |
| static void | SV_QueueWriteString (const char *s) |
| static void | SV_QueueWritePos (const vec3_t pos) |
| static void | SV_QueueWriteShort (int c) |
| static int | SV_GetEvent (void) |
| static edict_t * | SV_GetEventEdict (void) |
| static void * | SV_TagAlloc (int size, int tagNum, const char *file, int line) |
| Makes sure the game DLL does not use client, or signed tags. | |
| static void | SV_MemFree (void *ptr, const char *file, int line) |
| static void | SV_FreeTags (int tagNum, const char *file, int line) |
| Makes sure the game DLL does not use client, or signed tags. | |
| static bool | SV_TestLine (const vec3_t start, const vec3_t stop, const int levelmask) |
| static bool | SV_TestLineWithEnt (const vec3_t start, const vec3_t stop, const int levelmask, const char **entlist) |
| static pos_t | SV_GridFall (const int actorSize, const pos3_t pos) |
| static void | SV_RecalcRouting (const char *name, const GridBox &box, const char **list) |
| static void | SV_GridPosToVec (const int actorSize, const pos3_t pos, vec3_t vec) |
| static bool | SV_GridIsOnMap (const vec3_t vec) |
| static void | SV_GridCalcPathing (actorSizeEnum_t actorSize, pathing_t *path, const pos3_t from, int distance, forbiddenList_t *forbiddenList) |
| static bool | SV_GridFindPath (actorSizeEnum_t actorSize, pathing_t *path, const pos3_t from, const pos3_t targetPos, byte crouchingState, int maxTUs, forbiddenList_t *forbiddenList) |
| static bool | SV_CanActorStandHere (const int actorSize, const pos3_t pos) |
| static void | SV_SetInlineModelOrientation (const char *name, const vec3_t origin, const vec3_t angles) |
| static void | SV_GetInlineModelAABB (const char *name, AABB &aabb) |
| static void | SV_UnloadGame (void) |
| static game_export_t * | SV_GetGameAPI (game_import_t *parms) |
| Loads the game shared library and calls the api init function. | |
| void | SV_ShutdownGameProgs (void) |
| Called when either the entire server is being killed, or it is changing to a different game directory. | |
| 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. | |
Variables | |
| static const eventNames_t | eventNames [] |
| static char const *const | gameSysPoolName = "Server: Game system" |
Interface to the game library.
Definition in file sv_game.cpp.
| #define M | ( | x | ) |
Definition at line 356 of file sv_game.cpp.
| CASSERT | ( | lengthof(eventNames) | = =EV_NUM_EVENTS | ) |
References EV_NUM_EVENTS, and eventNames.
Definition at line 308 of file sv_game.cpp.
References pending_event_t::buf, pending_event_t::pending, and sv.
Referenced by SV_InitGameProgs().
| [in] | mask | The player bitmask to send the events to. Use PM_ALL to send to every connected player. |
| [in] | eType | The event type |
| [in] | entnum | The entity number |
Definition at line 427 of file sv_game.cpp.
References pending_event_t::buf, Com_DPrintf(), Com_Error(), Com_UnsignedIntToBinary(), DEBUG_EVENTSYS, pending_event_t::entnum, ERR_DROP, EV_NUM_EVENTS, eventNames, NET_WriteByte(), NET_WriteShort(), pending_event_t::pending, pending_event_t::playerMask, sv, SV_EndEvents(), SV_SendQueuedEvents(), svc_event, and pending_event_t::type.
Referenced by SV_InitGameProgs().
Definition at line 608 of file sv_game.cpp.
References RT_CanActorStandHere(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 161 of file sv_game.cpp.
References Com_CheckConfigStringIndex(), Com_ServerState(), index, MAX_TILESTRINGS, MAX_TOKEN_CHARS, NET_WriteByte(), NET_WriteShort(), NET_WriteString(), Q_vsnprintf(), ss_loading, SV_error(), SV_Multicast(), SV_SetConfigString, and svc_configstring.
Referenced by SV_InitGameProgs().
|
static |
Debug print to server console.
Definition at line 39 of file sv_game.cpp.
References SV_LogAdd().
Referenced by SV_InitGameProgs().
Definition at line 334 of file sv_game.cpp.
References pending_event_t::buf, EV_NULL, NET_WriteByte(), pending_event_t::pending, pending_event_t::playerMask, sv, SV_Multicast(), and SV_SendQueuedEvents().
Referenced by SV_AddEvent(), and SV_InitGameProgs().
|
static |
Abort the server with a game error.
Definition at line 79 of file sv_game.cpp.
References Com_Error(), ERR_DROP, Q_vsnprintf(), and SV_error().
Referenced by SV_Configstring(), SV_error(), SV_FindIndex(), SV_InitGameProgs(), and SV_SetModel().
Search the index in the config strings relative to a given start.
| name | The value of the config string to search the index for |
| start | The relative start point for the search |
| max | The max. searched entries in the config string before giving up |
| create | if true the value will get written into the config strings (appended) |
0 if not found Definition at line 99 of file sv_game.cpp.
References Com_ServerState(), i, name, NET_WriteByte(), NET_WriteShort(), NET_WriteString(), Q_streq, ss_loading, SV_error(), SV_GetConfigString(), SV_Multicast(), SV_SetConfigString, and svc_configstring.
Referenced by SV_ModelIndex().
Makes sure the game DLL does not use client, or signed tags.
Definition at line 558 of file sv_game.cpp.
References _Mem_FreeTag(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 517 of file sv_game.cpp.
References pending_event_t::pending, sv, and pending_event_t::type.
Referenced by SV_InitGameProgs().
Definition at line 526 of file sv_game.cpp.
References sv_edict_t::ent, pending_event_t::entnum, pending_event_t::pending, and sv.
Referenced by SV_InitGameProgs().
|
static |
Loads the game shared library and calls the api init function.
Definition at line 636 of file sv_game.cpp.
References Com_Error(), Com_LoadLibrary(), Com_Printf(), ERR_FATAL, FS_NextPath(), GetGameAPI(), PKGLIBDIR, SV_UnloadGame(), and svs.
Referenced by SV_InitGameProgs().
Definition at line 618 of file sv_game.cpp.
References CM_GetInlineModelAABB(), name, and sv.
Referenced by SV_InitGameProgs().
|
static |
Glue function to get the visibility from a given position.
Definition at line 69 of file sv_game.cpp.
References CM_GetVisibility(), and sv.
Referenced by SV_InitGameProgs().
|
static |
Definition at line 598 of file sv_game.cpp.
References forbiddenList, Grid_CalcPathing(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 578 of file sv_game.cpp.
References Grid_Fall(), and sv.
Referenced by SV_InitGameProgs().
|
static |
Definition at line 603 of file sv_game.cpp.
References forbiddenList, Grid_FindPath(), and sv.
Referenced by SV_InitGameProgs().
|
static |
Definition at line 588 of file sv_game.cpp.
References Grid_PosToVec(), and sv.
Referenced by SV_InitGameProgs().
Init the game subsystem for a new map.
Definition at line 747 of file sv_game.cpp.
References Cbuf_AddText(), Cmd_Argc(), Cmd_Args(), Cmd_Argv(), Com_CreateThread(), Com_Error(), Com_GetCharacterValues(), Com_GetConstInt(), Com_GetConstIntFromNamespace(), Com_GetConstVariable(), Com_GrenadeTarget(), Com_Printf(), Com_RegisterConstInt(), Com_UnregisterConstVariable(), csi, Cvar_Get(), Cvar_GetString(), Cvar_Set(), ERR_DROP, FS_FreeFile(), FS_Gamedir(), FS_LoadFile(), GAME_API_VERSION, gameSysPoolName, Grid_GetTUsForDirection(), Grid_MoveLength(), Grid_MoveNext(), Grid_MoveStore(), Grid_ShouldUseAutostand(), Mem_CreatePool, sv, SV_AbortEvents(), SV_AddEvent(), SV_BroadcastPrintf(), SV_CanActorStandHere(), SV_Configstring(), SV_dprintf(), SV_EndEvents(), SV_error(), SV_FreeTags(), SV_GetBounceFraction(), SV_GetEvent(), SV_GetEventEdict(), SV_GetFootstepSound(), SV_GetGameAPI(), SV_GetInlineModelAABB(), SV_GetVisibility(), SV_GridCalcPathing(), SV_GridFall(), SV_GridFindPath(), SV_GridIsOnMap(), SV_GridPosToVec(), SV_LinkEdict(), SV_LoadModelAABB(), SV_MemFree(), SV_ModelIndex(), SV_PlayerPrintf(), SV_PointContents(), SV_QueueEvent(), SV_QueueWriteByte(), SV_QueueWritePos(), SV_QueueWriteShort(), SV_QueueWriteString(), 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_TagAlloc(), SV_TestLine(), SV_TestLineWithEnt(), sv_threads, SV_Trace(), SV_UnlinkEdict(), SV_WriteAngle(), SV_WriteByte(), SV_WriteChar(), SV_WriteDir(), SV_WriteFormat(), SV_WriteGPos(), SV_WriteLong(), SV_WritePos(), SV_WriteShort(), SV_WriteString(), svs, Sys_Fopen(), and Sys_Milliseconds().
Referenced by SV_BroadcastPrintf(), SV_InitGame(), and TEST_F().
Definition at line 550 of file sv_game.cpp.
References _Mem_Free().
Referenced by SV_InitGameProgs().
|
static |
Definition at line 131 of file sv_game.cpp.
References CS_MODELS, MAX_MODELS, name, and SV_FindIndex().
Referenced by SV_InitGameProgs(), and SV_SetModel().
Print to a single client.
Definition at line 52 of file sv_game.cpp.
References cl, SrvPlayer::getNum(), level, PRINT_NONE, Q_vsnprintf(), SV_ClientPrintf(), SV_GetClient(), and SV_LogAdd().
Referenced by SV_InitGameProgs().
| [in] | mask | The player bitmask to send the events to. Use PM_ALL to send to every connected player. |
| [in] | eType | The event type |
| [in] | entnum | The entity number |
Definition at line 465 of file sv_game.cpp.
References pending_event_t::buf, Com_DPrintf(), Com_Error(), Com_UnsignedIntToBinary(), DEBUG_EVENTSYS, pending_event_t::entnum, ERR_DROP, EV_NUM_EVENTS, eventNames, lengthof, NET_WriteByte(), NET_WriteShort(), pending_event_t::pending, pending_event_t::playerMask, sv, svc_event, and pending_event_t::type.
Referenced by SV_InitGameProgs().
Definition at line 494 of file sv_game.cpp.
References NET_WriteByte(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 504 of file sv_game.cpp.
References NET_WritePos(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 509 of file sv_game.cpp.
References NET_WriteShort(), and sv.
Referenced by SV_InitGameProgs().
|
static |
Definition at line 499 of file sv_game.cpp.
References NET_WriteString(), and sv.
Referenced by SV_InitGameProgs().
|
static |
Definition at line 279 of file sv_game.cpp.
References NET_ReadAngle(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 244 of file sv_game.cpp.
References NET_ReadByte(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 239 of file sv_game.cpp.
References NET_ReadChar(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 284 of file sv_game.cpp.
References NET_ReadData(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 274 of file sv_game.cpp.
References NET_ReadDir(), and sv.
Referenced by SV_InitGameProgs().
|
static |
Definition at line 292 of file sv_game.cpp.
References format(), NET_vReadFormat(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 269 of file sv_game.cpp.
References NET_ReadGPos(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 254 of file sv_game.cpp.
References NET_ReadLong(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 264 of file sv_game.cpp.
References NET_ReadPos(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 249 of file sv_game.cpp.
References NET_ReadShort(), and sv.
Referenced by SV_InitGameProgs().
|
static |
Definition at line 259 of file sv_game.cpp.
References length, NET_ReadString(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 583 of file sv_game.cpp.
References Grid_RecalcRouting(), name, and sv.
Referenced by SV_InitGameProgs().
Calls the G_RunFrame function from game api let everything in the world think and move.
Definition at line 736 of file sv_game.cpp.
References ss_game_shutdown, sv, and svs.
Referenced by SV_BroadcastPrintf(), SV_Frame(), and SV_RunGameFrameThread().
Thread for the game frame function.
Definition at line 719 of file sv_game.cpp.
References data, sv, SV_RunGameFrame(), and svs.
Referenced by SV_BroadcastPrintf(), and SV_InitGameProgs().
Definition at line 320 of file sv_game.cpp.
References pending_event_t::buf, EV_NULL, i, NET_WriteByte(), pending_event_t::playerMask, sv, and SV_Multicast().
Referenced by SV_AddEvent(), and SV_EndEvents().
|
static |
Definition at line 613 of file sv_game.cpp.
References CM_SetInlineModelOrientation(), name, and sv.
Referenced by SV_InitGameProgs().
Definition at line 140 of file sv_game.cpp.
References SrvEdict::angles, cBspModel_t::cbmBox, CM_InlineModel(), CM_SetInlineModelOrientation(), SrvEdict::entBox, SrvEdict::modelindex, name, SrvEdict::origin, AABB::set(), sv, SV_error(), and SV_ModelIndex().
Referenced by SV_InitGameProgs().
Called when either the entire server is being killed, or it is changing to a different game directory.
Definition at line 681 of file sv_game.cpp.
References Cmd_ExecuteString(), Com_Printf(), Com_SetServerState(), gameSysPoolName, Mem_DeletePool, Mem_PoolSize, ss_game_shutdown, sv, SV_UnloadGame(), and svs.
Referenced by SV_BroadcastPrintf(), SV_Shutdown(), GameTest::TearDown(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), GameTest::testCountSpawnpointsForMapInMultiplayerMode(), and GameTest::testCountSpawnpointsForMapInSingleplayerMode().
Makes sure the game DLL does not use client, or signed tags.
Definition at line 542 of file sv_game.cpp.
References _Mem_Alloc(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 566 of file sv_game.cpp.
References sv, and TR_TestLine().
Referenced by SV_InitGameProgs().
|
static |
Definition at line 571 of file sv_game.cpp.
References CM_EntTestLine(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 623 of file sv_game.cpp.
References Com_Printf(), and svs.
Referenced by SV_GetGameAPI(), and SV_ShutdownGameProgs().
|
static |
Definition at line 226 of file sv_game.cpp.
References f, NET_WriteAngle(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 191 of file sv_game.cpp.
References NET_WriteByte(), and sv.
Referenced by SV_InitGameProgs().
|
static |
Definition at line 186 of file sv_game.cpp.
References NET_WriteChar(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 221 of file sv_game.cpp.
References NET_WriteDir(), and sv.
Referenced by SV_InitGameProgs().
|
static |
Definition at line 231 of file sv_game.cpp.
References format(), NET_vWriteFormat(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 216 of file sv_game.cpp.
References NET_WriteGPos(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 201 of file sv_game.cpp.
References NET_WriteLong(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 211 of file sv_game.cpp.
References NET_WritePos(), and sv.
Referenced by SV_InitGameProgs().
Definition at line 196 of file sv_game.cpp.
References NET_WriteShort(), and sv.
Referenced by SV_InitGameProgs().
|
static |
Definition at line 206 of file sv_game.cpp.
References NET_WriteString(), and sv.
Referenced by SV_InitGameProgs().
|
static |
Definition at line 357 of file sv_game.cpp.
Referenced by CASSERT(), SV_AddEvent(), and SV_QueueEvent().
|
static |
Definition at line 674 of file sv_game.cpp.
Referenced by SV_InitGameProgs(), and SV_ShutdownGameProgs().