definitions common between client and server, but not game lib More...
#include "../shared/ufotypes.h"
#include "../shared/byte.h"
#include "../shared/shared.h"
#include "../shared/mathlib.h"
#include "../shared/defines.h"
#include "../shared/typedefs.h"
#include "tracing.h"
#include "cvar.h"
#include "mem.h"
#include "http.h"
#include "../ports/system.h"
#include "cmd.h"
#include "cmodel.h"
#include "filesys.h"
#include "scripts.h"
#include "net.h"
#include "dbuffer.h"
#include "netpack.h"
#include "md4.h"
#include "../shared/ufotypes.h"
#include "../shared/byte.h"
#include "../shared/shared.h"
#include "../shared/mathlib.h"
#include "../shared/defines.h"
#include "../shared/typedefs.h"
#include "../ports/system.h"
Go to the source code of this file.
Data Structures | |
struct | date_s |
Engine-side time information in the game. More... | |
struct | cvarlist_s |
struct | gametype_s |
Defines | |
#define | UFO_VERSION "2.4-dev" |
#define | GAME_TITLE "UFO:AI" |
#define | GAME_TITLE_LONG "UFO:Alien Invasion" |
#define | BUILDSTRING_OS "Unknown" |
#define | CPUSTRING "Unknown" |
#define | BUILDSTRING_VARIANT "RELEASE" |
#define | BUILDSTRING BUILDSTRING_OS " " BUILDSTRING_VARIANT |
#define | MASTER_SERVER "http://ufoai.ninex.info/" |
#define | PROTOCOL_VERSION 6 |
#define | PORT_CLIENT 27901 |
#define | PORT_SERVER 27910 |
#define | SOUND_ATTN_NONE 0.0f |
#define | SOUND_ATTN_NORM 1.0f |
#define | SOUND_ATTN_IDLE 1.2f |
#define | SOUND_ATTN_STATIC 3.0f |
#define | SOUND_ATTN_MAX SOUND_ATTN_STATIC |
#define | ANGLE2SHORT(x) ((int)((x)*65536/360) & 65535) |
#define | SHORT2ANGLE(x) ((x)*(360.0/65536)) |
#define | ERR_FATAL 0 |
#define | ERR_DROP 1 |
#define | ERR_QUIT 2 |
#define | COLORED_GREEN "\1" |
#define | DAYS_PER_YEAR 365 |
#define | DAYS_PER_YEAR_AVG 365.25 |
#define | MONTHS_PER_YEAR 12 |
#define | SEASONS_PER_YEAR 4 |
#define | SECONDS_PER_DAY 86400 |
#define | SECONDS_PER_HOUR 3600 |
#define | SECONDS_PER_MINUTE 60 |
#define | MINUTES_PER_HOUR 60 |
#define | MAXCMDLINE 256 |
#define | MAX_CVARLISTINGAMETYPE 16 |
#define | MAX_GAMETYPES 16 |
#define | REMOVE_ELEM_MEMSET(array, index, n, val) |
#define | REMOVE_ELEM(array, index, n) |
#define | REMOVE_ELEM_ADJUST_IDX(array, index, n) |
#define | HASH_Add(hash, elem, index) |
Typedefs | |
typedef int32_t | svc_ops_t |
typedef struct date_s | date_t |
Engine-side time information in the game. | |
typedef struct cvarlist_s | cvarlist_t |
typedef struct gametype_s | gametype_t |
typedef void | event_func (int now, void *data) |
typedef qboolean | event_check_func (int now, void *data) |
typedef qboolean | event_filter (int when, event_func *func, event_check_func *check, void *data) |
typedef void | event_clean_func (void *data) |
Enumerations | |
enum | svc_ops_e { svc_bad, svc_nop, svc_disconnect, svc_reconnect, svc_sound, svc_print, svc_stufftext, svc_serverdata, svc_configstring, svc_event, svc_oob = 0xff } |
server to client the svc_strings[] array in cl_parse.c should mirror this More... | |
enum | clc_ops_e { clc_bad, clc_nop, clc_endround, clc_teaminfo, clc_initactorstates, clc_action, clc_userinfo, clc_stringcmd, clc_oob = 0xff } |
client to server More... | |
Functions | |
void | Com_BeginRedirect (struct net_stream *stream, char *buffer, int buffersize) |
Redirect packets/output from server to client. | |
void | Com_EndRedirect (void) |
End the redirection of packets/output. | |
void | Com_MakeTimestamp (char *ts, const size_t tslen) |
Creates a timestamp with date and time at the specified location. | |
void | Com_vPrintf (const char *fmt, va_list) |
void | Com_Drop (void) __attribute__((noreturn)) |
void | Com_Quit (void) |
void | Com_WriteConfigToFile (const char *filename) |
void | Cvar_WriteVariables (qFILE *f) |
appends lines containing "set variable value" for all variables with the archive flag set to true. | |
int | Com_ServerState (void) |
Check whether we are the server or have a singleplayer tactical mission. | |
void | Com_SetServerState (int state) |
char * | Com_MD5File (const char *fn, int length) |
Compute the md5sum of a given file. | |
void | Qcommon_Init (int argc, const char **argv) |
Init function. | |
void | Qcommon_Frame (void) |
This is the function that is called directly from main(). | |
void | Qcommon_Shutdown (void) |
void | Com_SetGameType (void) |
float | Com_GrenadeTarget (const vec3_t from, const vec3_t at, float speed, qboolean launched, qboolean rolled, vec3_t v0) |
Calculates parabola-type shot. | |
void | Con_Print (const char *txt) |
Handles cursor positioning, line wrapping, etc All console printing must go through this in order to be logged to disk If no console is visible, the text will appear at the top of the game window. | |
void | Schedule_Event (int when, event_func *func, event_check_func *check, event_clean_func *clean, void *data) |
Schedules an event to run on or after the given time, and when its check function returns true. | |
void | Schedule_Timer (cvar_t *interval, event_func *func, void *data) |
void | CL_FilterEventQueue (event_filter *filter) |
Filters every event in the queue using the given function. Keeps all events for which the function returns true. | |
void | CL_Init (void) |
void | CL_Drop (void) |
Ensures the right menu cvars are set after error drop or map change. | |
void | CL_Shutdown (void) |
Saves configuration file and shuts the client systems down. | |
int | CL_Milliseconds (void) |
void | CL_Frame (int now, void *data) |
void | CL_SlowFrame (int now, void *data) |
void | CL_ParseClientData (const char *type, const char *name, const char **text) |
Called at client startup. | |
void | SCR_BeginLoadingPlaque (void) |
void | SCR_EndLoadingPlaque (void) |
void | CL_InitAfter (void) |
Init function for clients - called after menu was initialized and ufo-scripts were parsed. | |
void | SV_Init (void) |
Only called once at startup, not for each game. | |
void | SV_Clear (void) |
Cleanup when the whole game process is shutting down. | |
void | SV_Shutdown (const char *finalmsg, qboolean reconnect) |
Called when each game quits, before Sys_Quit or Sys_Error. | |
void | SV_ShutdownWhenEmpty (void) |
Will eventually shutdown the server once all clients have disconnected. | |
void | SV_Frame (int now, void *) |
mapData_t * | SV_GetMapData (void) |
mapTiles_t * | SV_GetMapTiles (void) |
int | Com_Argc (void) |
Returns the script commandline argument count. | |
const char * | Com_Argv (int arg) |
Returns an argument of script commandline. | |
void | Com_ClearArgv (int arg) |
Reset com_argv entry to empty string. | |
unsigned int | Com_HashKey (const char *name, int hashsize) |
returns hash key for a string | |
const char * | Com_MacroExpandString (const char *text) |
Expands strings with cvar values that are dereferenced by a '*cvar'. | |
void | Com_Init (void) |
void | Com_InitArgv (int argc, const char **argv) |
qboolean | Com_ConsoleCompleteCommand (const char *s, char *target, size_t bufSize, int *pos, int offset) |
Console completion for command and variables. | |
void | Key_Init (void) |
Variables | |
cvar_t * | http_proxy |
cvar_t * | http_timeout |
cvar_t * | developer |
cvar_t * | sv_dedicated |
cvar_t * | sv_maxclients |
cvar_t * | sv_gametype |
cvar_t * | masterserver_url |
cvar_t * | port |
cvar_t * | sys_priority |
cvar_t * | sys_affinity |
cvar_t * | sys_os |
gametype_t | gts [MAX_GAMETYPES] |
int | numGTs |
memPool_t * | com_aliasSysPool |
memPool_t * | com_cmdSysPool |
memPool_t * | com_cmodelSysPool |
memPool_t * | com_cvarSysPool |
memPool_t * | com_fileSysPool |
memPool_t * | com_genericPool |
definitions common between client and server, but not game lib
Definition in file common.h.
#define ANGLE2SHORT | ( | x | ) | ((int)((x)*65536/360) & 65535) |
Definition at line 186 of file common.h.
Referenced by NET_WriteAngle16().
#define BUILDSTRING BUILDSTRING_OS " " BUILDSTRING_VARIANT |
Definition at line 107 of file common.h.
Referenced by Qcommon_Init().
#define COLORED_GREEN "\1" |
Definition at line 194 of file common.h.
Referenced by CL_ParseServerInfoMessage(), Cmd_CompleteCommand(), Cmd_List_f(), CMod_LoadBrushes(), CMod_LoadBrushSides(), CMod_LoadLeafBrushes(), CMod_LoadLeafs(), CMod_LoadNodes(), CMod_LoadPlanes(), CMod_LoadSubmodels(), CMod_LoadSurfaces(), Com_vPrintf(), Cvar_CompleteVariable(), Cvar_List_f(), Irc_Client_CmdPrivmsg(), SV_CompleteServerCommand(), and Sys_ConsoleOutput().
#define CPUSTRING "Unknown" |
Definition at line 95 of file common.h.
Referenced by Qcommon_Init(), and SV_LoadGame().
#define DAYS_PER_YEAR 365 |
Definition at line 238 of file common.h.
Referenced by CL_DateConvert(), CL_DateCreateDay(), Com_ParseValue(), Com_ValueToStr(), MAP_DrawMap(), and R_Draw3DGlobe().
#define DAYS_PER_YEAR_AVG 365.25 |
Definition at line 239 of file common.h.
Referenced by MAP_IsNight().
#define ERR_DROP 1 |
Definition at line 190 of file common.h.
Referenced by _LE_NotFoundError(), AC_ResearchAlien_f(), AII_ReloadWeapon(), AIM_AddEmployeeFromMenu(), AIM_AutoEquipAircraft(), AIR_AircraftSelect(), AIR_AircraftStatusToName(), AIR_DestroyAircraft(), AIR_GetAircraft(), AIR_GetCapacityByAircraftWeight(), AIR_GetDestinationFindRoot(), AIR_ParseAircraft(), AIR_RemoveEmployees(), AL_AddAliens(), AL_ChangeAliveAlienNumber(), AL_FillInContainment(), B_AntimatterInBase(), B_AssembleMap(), B_BuildFromTemplate(), B_BuildingDestroy(), B_ManageAntimatter(), B_ParseBaseTemplate(), B_ParseBuildings(), B_RemoveAircraftExceedingCapacity(), B_SetBuildingByClick(), B_SetCurrentSelectedBase(), B_SetUpFirstBase(), B_UpdateBaseCapacities(), BaseSummary_Init(), BDEF_AutoTarget(), BDEF_ReloadBaseWeapons(), BS_BuyItem_f(), BS_BuyType(), BS_GetObjectDefition(), BS_SellItem_f(), CIN_ROQ_DecodeInfo(), CIN_ROQ_PlayCinematic(), CL_ActorAppear(), CL_ActorDie(), CL_ActorDoMove(), CL_ActorDoShoot(), CL_ActorDoTurn(), CL_ActorGetMuzzle(), CL_ActorPilotSelect_f(), CL_ActorRevitalised(), CL_ActorSearchAtGridPos(), CL_ActorSelect(), CL_ActorStartShoot(), CL_ActorTeamSelect_f(), CL_AddActor(), CL_AddBrushModel(), CL_AssignPilot_f(), CL_BuildForbiddenList(), CL_CleanupAircraftCrew(), CL_DoSwapSkills(), CL_ExecuteBattlescapeEvent(), CL_FinishHTTPDownload(), CL_GetComponentsByID(), CL_GetComponentsByItem(), CL_GetConfigString(), CL_GetConfigStringInteger(), CL_GetEvent(), CL_GetHitProbability(), CL_GetTeamSkinName(), CL_HullForEntity(), CL_InvAdd(), CL_InvDel(), CL_NetReceiveItem(), CL_ParseAlienTeam(), CL_ParseEvent(), CL_ParseMapParticle(), CL_ParsePtlCmds(), CL_ParseRanks(), CL_ParseResults(), CL_ParseServerData(), CL_ParseServerMessage(), CL_ParticleFunction(), CL_ParticleGetArt(), CL_ParticleLoadArt(), CL_ParticleSpawnTimed(), CL_ReadSinglePlayerData(), CL_SendCommand(), CL_SetConfigString(), CL_SetHTTPServer(), CL_SpawnParseEntitystring(), CL_UpdateActorAircraftVar(), CL_ViewLoadMedia(), CM_AddMapTile(), CM_EntCompleteBoxTrace(), CM_EntTestLine(), CM_EntTestLineDM(), CM_InitBoxHull(), CM_InlineModel(), CM_LoadMap(), CMod_LoadBrushes(), CMod_LoadBrushSides(), CMod_LoadEntityString(), CMod_LoadLeafBrushes(), CMod_LoadLeafs(), CMod_LoadNodes(), CMod_LoadPlanes(), CMod_LoadRouting(), CMod_LoadSubmodels(), CMod_LoadSurfaces(), Com_BeginRedirect(), Com_Error(), Com_GetCharacterValues(), CP_BaseAttackGoToBase(), CP_ChooseMap(), CP_MissionChooseUFO(), CP_ParseCharacterData(), CP_SetAlienEquipmentByInterest(), CP_SetAlienTeamByInterest(), CP_SpawnCrashSiteMission(), CP_SpawnRescueMission(), CP_StartMissionMap(), CP_ToDifficultyName(), CP_XVIInit(), E_CreateEmployeeAtIndex(), E_EmployeeIsUnassigned(), E_GetEmployeeString(), E_RemoveEmployeeFromBuildingOrAircraft(), GAME_AppendTeamMember(), GAME_CP_TeamIsKnown(), GAME_GenerateTeam(), GAME_GetCharacter(), GAME_MP_MapInfo(), GAME_NetSendCharacter(), Grid_SetMoveData(), HUD_ActorGetCvarData_f(), INS_FinishInstallation(), INS_SetCurrentSelectedInstallation(), INV_GetEquipmentDefinitionByID(), Key_Message(), LE_Add(), LE_DoEndPathMove(), LE_Lock(), LE_PlaceItem(), LE_Unlock(), LM_AddModel(), LM_AddToSceneOrder(), LMT_Init(), MAP_GetCivilianNumberByPosition(), MAP_GetColor(), MAP_GetMissionModel(), MAP_Init(), MAP_InitStartup(), MD2GLCmdsRemove(), MD2HeaderCheck(), ModelWorker(), NET_DatagramBroadcast(), NET_ReadDir(), NET_vReadFormat(), NET_vWriteFormat(), PR_DisassembleItem(), PR_ProductionInfo(), PR_UpdateRequiredItemsInBasestorage(), PrecalcNormalsAndTangents(), R_AddEntity(), R_AliasModelState(), R_CalcTransform(), R_CreateSurfaceLightmap(), R_DrawBspNormals(), R_DrawEntities(), R_DrawSurfaceStage(), R_GetFreeEntity(), R_LoadBspVertexArrays(), R_LoadImageData(), R_LoadObjModel(), R_LoadObjModelFace(), R_LoadObjModelLine(), R_ModAddMapTile(), R_ModBeginLoading(), R_ModLoadAliasDPMModel(), R_ModLoadAliasMD2Mesh(), R_ModLoadAliasMD2MeshIndexed(), R_ModLoadAliasMD2MeshUnindexed(), R_ModLoadAliasMD2Model(), R_ModLoadAliasMD3Model(), R_ModLoadEdges(), R_ModLoadLeafs(), R_ModLoadMDX(), R_ModLoadNodes(), R_ModLoadNormals(), R_ModLoadPlanes(), R_ModLoadSubmodels(), R_ModLoadSurfaces(), R_ModLoadSurfedges(), R_ModLoadTexinfo(), R_ModLoadVertexes(), R_PreprocessShader(), R_SetBlendMode(), R_SetupSubmodels(), RADAR_UpdateInstallationRadarCoverage(), RS_AssignScientist(), RS_AssignTechLinks(), RS_GetTechForItem(), RS_InitTree(), RS_ParseTechnologies(), RS_RemoveScientist(), SP_misc_model(), SV_AddMapTiles(), SV_AddTile(), SV_AssembleMap(), SV_Configstring(), SV_CreateWorldSector(), SV_error(), SV_FindIndex(), SV_GetCvarToken(), SV_GetServerDataForEdict(), SV_GetTileFromTileSet(), SV_InitGameProgs(), SV_LoadModelMinsMaxs(), SV_ParseAssembly(), SV_ParseMapTileSet(), SV_ParseUMP(), SV_SetModel(), tileMask(), TR_BoxTrace(), TR_BuildTracingNode_r(), TR_TransferAlienAfterMissionStart(), TR_TransferStart(), UFO_GetByType(), UFO_IsUFOSeenOnGeoscape(), UFO_TypeToName(), UI_BaseMapNodeClick(), UI_BaseMapNodeDraw(), UI_BaseMapNodeMiddleClick(), UI_BuildRadarImageList(), UI_DrawModelNode(), UI_DrawModelNodeWithUIModel(), UI_NodeAbsoluteToRelativePos(), UI_TextNodeLoaded(), UP_Article(), UP_DisplayTechTree(), UP_GenerateSummary(), UP_SetMailHeader(), UP_TechTreeClick_f(), and US_RemoveUFOsExceedingCapacity().
#define ERR_FATAL 0 |
Definition at line 189 of file common.h.
Referenced by AIR_IsAircraftOnGeoscape(), CL_ParseSequence(), CL_SetClientState(), CL_SetRatioFilter_f(), CM_AddMapTile(), Com_InitArgv(), CP_SpawnAlienBaseMission(), Key_Event(), LoadModel(), ModelWorker(), NET_Init(), R_Draw3DGlobe(), R_DrawFlatGeoscape(), R_DrawInitLocal(), R_EnforceVersion(), R_FindImage(), R_FontAnalyze(), R_FontInit(), R_GetFont(), R_GetFreeFBOTexture(), R_GetSpriteVectors(), R_InitExtensions(), R_InitializeShader(), R_InitImages(), R_LoadImage(), R_ModForName(), R_ModLoadAnims(), R_ModLoadTags(), R_PreprocessShader(), R_SoftenTexture(), R_UploadData(), R_VerifyDriver(), Rimp_Init(), RS_InitTree(), SEQ_Execute2Dobj(), SEQ_ExecuteModel(), SV_GetConfigString(), SV_GetConfigStringInteger(), SV_GetGameAPI(), SV_HullForEntity(), SV_SetConfigString(), SZ_GetSpace(), UI_AllocNodeWithoutNew(), UI_AllocStaticAction(), UI_AllocStaticColor(), UI_AllocStaticFloat(), UI_AllocStaticIcon(), UI_AllocStaticKeyBinding(), UI_AllocStaticString(), UI_AllocTimer(), UI_DrawString(), UI_ExecuteAction(), UI_ExecuteSetAction(), UI_GetBooleanFromExpression(), UI_GetFloatFromExpression(), UI_GetNodeAbsPos(), UI_GetStringFromExpression(), UI_InitializeNodeBehaviour(), UI_InitNodes(), UI_InsertComponent(), UI_InsertWindow(), UI_NodeSetPropertyFromRAW(), UI_ParseComponent(), UI_ParseValueExpression(), UI_ParseWindow(), UI_PoolAllocAction(), UI_PopupButton(), UI_PopupList(), UI_RegisterFont(), UI_ReleaseVariable(), UI_SetKeyBinding(), and UI_SetOneButton().
#define GAME_TITLE "UFO:AI" |
Definition at line 41 of file common.h.
Referenced by R_InitExtensions(), and Rimp_Init().
#define GAME_TITLE_LONG "UFO:Alien Invasion" |
Definition at line 42 of file common.h.
Referenced by Rimp_Init().
#define HASH_Add | ( | hash, | |||
elem, | |||||
index | ) |
Definition at line 373 of file common.h.
Referenced by Cmd_AddCommand(), and Cvar_Get().
#define MASTER_SERVER "http://ufoai.ninex.info/" |
Definition at line 110 of file common.h.
Referenced by CL_InitLocal(), and Qcommon_Init().
#define MAX_CVARLISTINGAMETYPE 16 |
Definition at line 250 of file common.h.
Referenced by Com_ParseGameTypes().
#define MAX_GAMETYPES 16 |
#define MAXCMDLINE 256 |
Definition at line 248 of file common.h.
Referenced by Com_ConsoleCompleteCommand(), Con_DrawInput(), Con_LoadConsoleHistory(), Con_SaveConsoleHistory(), Key_Console(), Sys_ConsoleEditProc(), Sys_ConsoleInit(), and Sys_ConsoleInput().
#define MINUTES_PER_HOUR 60 |
(60)
Definition at line 246 of file common.h.
Referenced by PR_DisassemblingFrame(), and PR_ProductionFrame().
#define MONTHS_PER_YEAR 12 |
DAYS_PER_MONTH ->
Definition at line 241 of file common.h.
Referenced by CL_DateConvert(), CL_NationDrawStats(), CL_NationsMaxFunding(), CP_NationBackupMonthlyData(), NAT_LoadXML(), and NAT_SaveXML().
#define PORT_CLIENT 27901 |
Definition at line 122 of file common.h.
Referenced by CL_PingServers_f().
#define PORT_SERVER 27910 |
Definition at line 123 of file common.h.
Referenced by CL_Connect_f(), CL_PingServers_f(), CL_Rcon_f(), CL_ServerInfo_f(), Qcommon_Init(), and SV_InitGame().
#define PROTOCOL_VERSION 6 |
Definition at line 120 of file common.h.
Referenced by CL_Connect(), CL_ParseServerData(), CL_PingServer(), CL_ProcessPingReply(), CL_SelectTeam_Init_f(), CL_ServerInfo_f(), SV_Init(), SV_New_f(), SVC_DirectConnect(), and SVC_Info().
#define REMOVE_ELEM | ( | array, | |||
index, | |||||
n | ) |
do { \ size_t idx__ = (index); \ size_t n__ = --(n); \ assert(idx__ <= n__); \ memmove((array) + idx__, (array) + idx__ + 1, (n__ - idx__) * sizeof(*(array))); \ memset((array) + n__, 0, sizeof(*(array))); \ } while (0)
Remove element at index from array of size n. n gets adjusted to the new array size, so must be an lvalue
Definition at line 351 of file common.h.
Referenced by B_BuildingDestroy(), B_RemoveItemsExceedingCapacity(), BDEF_RemoveBattery(), NAT_ScriptSanityCheck(), RADAR_RemoveUFO(), and TR_TransferCheck().
#define REMOVE_ELEM_ADJUST_IDX | ( | array, | |||
index, | |||||
n | ) |
do { \ size_t idx__ = (index); \ size_t n__; \ size_t i__; \ REMOVE_ELEM(array, index, n); \ n__ = (n); \ for (i__ = idx__; i__ < n__; ++i__) \ --(array)[i__].idx; \ } while (0)
Same as REMOVE_ELEM() and also updates the idx attribute of every moved element
Definition at line 362 of file common.h.
Referenced by AIRFIGHT_RemoveProjectile(), INS_DestroyInstallation(), PR_QueueDelete(), and UFO_RemoveFromGeoscape().
#define REMOVE_ELEM_MEMSET | ( | array, | |||
index, | |||||
n, | |||||
val | ) |
do { \ size_t idx__ = (index); \ size_t n__ = --(n); \ assert(idx__ <= n__); \ memmove((array) + idx__, (array) + idx__ + 1, (n__ - idx__) * sizeof(*(array))); \ memset((array) + n__, val, sizeof(*(array))); \ } while (0)
Remove element at index from array of size n. n gets adjusted to the new array size, so must be an lvalue - the old array slot is set to the value given via val
Definition at line 340 of file common.h.
Referenced by TR_NotifyAircraftRemoved().
#define SEASONS_PER_YEAR 4 |
Definition at line 242 of file common.h.
Referenced by R_Draw3DGlobe().
#define SECONDS_PER_DAY 86400 |
(24 * 60 * 60)
Definition at line 243 of file common.h.
Referenced by CL_CampaignRun(), CP_CampaignInit(), Date_Add(), Date_Random(), MAP_DrawMap(), MAP_IsNight(), R_Draw3DGlobe(), TR_TransferAlienAfterMissionStart(), and TR_TransferStart().
#define SECONDS_PER_HOUR 3600 |
(60 * 60)
Definition at line 244 of file common.h.
Referenced by AIR_AircraftHasEnoughFuel(), AIR_AircraftHasEnoughFuelOneWay(), AIR_AircraftMakeMove(), AIR_GetOperationRange(), AIR_ParseAircraft(), AIRFIGHT_CampaignRunProjectiles(), AIRFIGHT_ProjectileReachedTarget(), CL_CampaignRun(), CL_DateConvertLong(), CL_DateCreateSeconds(), CL_DisplayPopupInterceptMission(), CL_SecondConvert(), Com_ParseValue(), MAP_DrawMap(), and MAP_GetAircraftText().
#define SECONDS_PER_MINUTE 60 |
#define SHORT2ANGLE | ( | x | ) | ((x)*(360.0/65536)) |
Definition at line 187 of file common.h.
Referenced by NET_ReadAngle16().
#define SOUND_ATTN_IDLE 1.2f |
Definition at line 166 of file common.h.
Referenced by CL_ActorDoThrow(), CL_ActorPlaySound(), CL_InvReload(), CL_SpawnParseEntitystring(), and LE_PlaySoundFileForContents().
#define SOUND_ATTN_MAX SOUND_ATTN_STATIC |
Definition at line 168 of file common.h.
Referenced by Com_ParseFire().
#define SOUND_ATTN_NONE 0.0f |
full volume the entire level
Definition at line 164 of file common.h.
Referenced by Com_ParseFire().
#define SOUND_ATTN_NORM 1.0f |
Definition at line 165 of file common.h.
Referenced by CL_ParseStartSoundPacket(), Com_ParseItem(), and S_StartLocalSample().
#define SOUND_ATTN_STATIC 3.0f |
dimish very rapidly with distance
Definition at line 167 of file common.h.
Referenced by LE_PlaySoundFileAndParticleForSurface().
#define UFO_VERSION "2.4-dev" |
Definition at line 40 of file common.h.
Referenced by CL_CanMultiplayerStart(), CL_ProcessPingReply(), Com_ParseVersion(), Con_DrawConsole(), FS_AddHomeAsGameDirectory(), Qcommon_Init(), SAV_GameSave(), SV_Map(), SVC_DirectConnect(), and SVC_Info().
typedef struct cvarlist_s cvarlist_t |
Engine-side time information in the game.
typedef qboolean event_check_func(int now, void *data) |
typedef void event_clean_func(void *data) |
typedef qboolean event_filter(int when, event_func *func, event_check_func *check, void *data) |
typedef void event_func(int now, void *data) |
typedef struct gametype_s gametype_t |
enum clc_ops_e |
enum svc_ops_e |
server to client the svc_strings[] array in cl_parse.c should mirror this
svc_bad | |
svc_nop |
the rest are private to the client and server |
svc_disconnect | |
svc_reconnect | |
svc_sound | |
svc_print |
[byte] id [string] null terminated string |
svc_stufftext |
[string] stuffed into client's console buffer, should be |
svc_serverdata |
[long] protocol, spawncount, playernum, mapname, ... |
svc_configstring |
[short] [string] |
svc_event |
event like move or inventory usage - see EV_* and
|
svc_oob |
void CL_Drop | ( | void | ) |
Ensures the right menu cvars are set after error drop or map change.
Definition at line 172 of file cl_main.c.
References CL_Disconnect(), GAME_Drop(), and SCR_EndLoadingPlaque().
Referenced by CL_Disconnect_f(), CL_ParseServerMessage(), Com_Error(), GAME_HandleResults(), GAME_MP_Results(), and GAME_SK_Results().
void CL_FilterEventQueue | ( | event_filter * | filter | ) |
Filters every event in the queue using the given function. Keeps all events for which the function returns true.
filter | Pointer to the filter function. When called with event info, it should return true if the event is to be kept. |
Definition at line 1291 of file common.c.
References event::clean, event::data, Mem_Free, and event::next.
Referenced by CL_ClearBattlescapeEvents().
void CL_Frame | ( | int | now, | |
void * | data | |||
) |
Definition at line 1201 of file cl_main.c.
References ca_connected, cl, CL_CameraMove(), CL_ParticleRun(), CL_ReadPackets(), CL_RunHTTPDownloads(), CL_RunMapParticles(), CL_SendCommand(), client_static_s::framerate, client_static_s::frametime, GAME_Frame(), IN_Frame(), LE_Think(), cvar_s::modified, client_static_s::realtime, S_Frame(), SCR_RunConsole(), SCR_UpdateScreen(), client_static_s::state, sys_affinity, Sys_Milliseconds(), sys_priority, and Sys_SetAffinityAndPriority().
Referenced by Qcommon_Init().
void CL_Init | ( | void | ) |
Definition at line 1285 of file cl_main.c.
References BASEDIRNAME, CIN_Init(), CL_ClearState(), CL_InitLocal(), CL_InitMemPools(), CL_InitParticles(), CL_ViewInit(), Com_DPrintf(), Com_sprintf(), Con_Init(), Cvar_Get(), DEBUG_CLIENT, FS_GetCwd(), cvar_s::integer, Irc_Init(), MAX_OSPATH, Mem_TouchGlobal, Q_strncpyz(), S_Init(), SCR_Init(), cvar_s::string, sv_dedicated, TEXT_DOMAIN, and VID_Init().
Referenced by Qcommon_Init().
void CL_InitAfter | ( | void | ) |
Init function for clients - called after menu was initialized and ufo-scripts were parsed.
Definition at line 901 of file cl_main.c.
References CL_LanguageInit(), CL_TeamDefInitMenu(), CL_VideoInitMenu(), CL_ViewPrecacheModels(), Com_MapDefSort(), IN_JoystickInitMenu(), cvar_s::integer, client_static_s::mds, client_static_s::numMDs, S_Frame(), S_LoadSamples(), and sv_dedicated.
Referenced by Qcommon_Init().
int CL_Milliseconds | ( | void | ) |
Definition at line 1335 of file cl_main.c.
References client_static_s::realtime, and Sys_Milliseconds().
Referenced by CIN_OGM_PlayCinematic(), CIN_OGM_RunCinematic(), CIN_ROQ_DecodeChunk(), CIN_ROQ_PlayCinematic(), CL_Connect(), CL_ParseServerMessage(), CL_ParticleRunTimed(), CL_PingServers_f(), CL_Reconnect_f(), CL_RequestNextDownload(), CL_SendCommand(), Con_DrawInput(), Con_DrawNotify(), Con_Print(), IN_KeyDown(), IN_SendKeyEvents(), Irc_Proto_Connect(), Irc_Proto_RefillBucket(), S_LoopSample(), S_PlaySample(), SCR_BeginLoadingPlaque(), SCR_UpdateScreen(), UI_DisplayNotice(), UI_Draw(), UI_EKGNodeDraw(), UI_HandleTimers(), UI_TextEntryNodeDraw(), UI_TimerStart(), UI_WindowNodeDraw(), and UI_WindowNodeInit().
void CL_ParseClientData | ( | const char * | type, | |
const char * | name, | |||
const char ** | text | |||
) |
Called at client startup.
Definition at line 936 of file cl_main.c.
References CL_ParseCustomSkin(), CL_ParseLanguages(), CL_ParseMapDefinition(), CL_ParseParticle(), CL_ParseSequence(), CL_ParseTipsOfTheDay(), M_ParseMusic(), TUT_ParseTutorials(), UI_ParseComponent(), UI_ParseFont(), UI_ParseIcon(), UI_ParseUIModel(), and UI_ParseWindow().
Referenced by Com_ParseScripts().
void CL_Shutdown | ( | void | ) |
Saves configuration file and shuts the client systems down.
Sys_Quit
and Com_Error
. It would be better to run quit through here before the final handoff to the sys code. Definition at line 1347 of file cl_main.c.
References CIN_Shutdown(), CL_HTTP_Cleanup(), Con_SaveConsoleHistory(), GAME_NONE, GAME_SetMode(), Irc_Shutdown(), Key_WriteBindings(), qfalse, qtrue, R_Shutdown(), S_Shutdown(), and UI_Shutdown().
Referenced by Com_Error(), Com_Quit(), and Sys_Quit().
void CL_SlowFrame | ( | int | now, | |
void * | data | |||
) |
Definition at line 1263 of file cl_main.c.
References CL_LanguageTryToSet(), HUD_Update(), Irc_Logic_Frame(), cvar_s::modified, s_language, and cvar_s::string.
Referenced by Qcommon_Init().
int Com_Argc | ( | void | ) |
Returns the script commandline argument count.
Definition at line 547 of file common.c.
References com_argc.
Referenced by Cbuf_AddEarlyCommands(), and Cbuf_AddLateCommands().
const char* Com_Argv | ( | int | arg | ) |
Returns an argument of script commandline.
Definition at line 555 of file common.c.
References com_argc, and com_argv.
Referenced by Cbuf_AddEarlyCommands(), and Cbuf_AddLateCommands().
void Com_BeginRedirect | ( | struct net_stream * | stream, | |
char * | buffer, | |||
int | buffersize | |||
) |
Redirect packets/output from server to client.
This is used to redirect printf outputs for rcon commands
Definition at line 301 of file common.c.
References Com_Error(), ERR_DROP, MAXPRINTMSG, rd_buffer, and rd_buffersize.
Referenced by SVC_RemoteCommand().
void Com_ClearArgv | ( | int | arg | ) |
Reset com_argv entry to empty string.
[in] | arg | Which argument in com_argv |
Definition at line 567 of file common.c.
References com_argc, and com_argv.
Referenced by Cbuf_AddEarlyCommands().
qboolean Com_ConsoleCompleteCommand | ( | const char * | s, | |
char * | target, | |||
size_t | bufSize, | |||
int * | pos, | |||
int | offset | |||
) |
Console completion for command and variables.
[in] | s | The string to complete |
[out] | target | The target buffer of the completed command/cvar |
[in] | bufSize | the target buffer size - might not be bigger than MAXCMDLINE |
[out] | pos | The position in the buffer after command completion |
[in] | offset | The input buffer position to put the completed command to |
Definition at line 689 of file common.c.
References Cmd_CompleteCommand(), Cmd_CompleteCommandParameters(), Com_Printf(), Cvar_CompleteVariable(), MAX_QPATH, MAXCMDLINE, Q_strcat(), Q_strncpyz(), qfalse, and qtrue.
Referenced by Key_Console(), Sys_ConsoleEditProc(), and Sys_ConsoleInput().
void Com_Drop | ( | void | ) |
Definition at line 476 of file common.c.
References abortframe.
Referenced by Com_Error(), and CP_EndCampaign().
void Com_EndRedirect | ( | void | ) |
End the redirection of packets/output.
Definition at line 318 of file common.c.
References NET_OOB_Printf(), rd_buffer, and rd_buffersize.
Referenced by SVC_RemoteCommand().
float Com_GrenadeTarget | ( | const vec3_t | from, | |
const vec3_t | at, | |||
float | speed, | |||
qboolean | launched, | |||
qboolean | rolled, | |||
vec3_t | v0 | |||
) |
Calculates parabola-type shot.
There are two possibilities when aiming: either we can reach the target at maximum speed or we can't. If we can reach it we would like to reach it with as flat a trajectory as possible. To do this we calculate the angle to hit the target with the projectile traveling at the maximum allowed velocity.
However, if we can't reach it then we'd like the aiming curve to use the smallest possible velocity that would have reached the target.
let d = horizontal distance to target h = vertical distance to target g = gravity v = launch velocity vx = horizontal component of launch velocity vy = vertical component of launch velocity alpha = launch angle t = time
Then using the laws of linear motion and some trig
d = vx * t h = vy * t - 1/2 * g * t^2 vx = v * cos(alpha) vy = v * sin(alpha)
and some trig identities
2*cos^2(x) = 1 + cos(2*x) 2*sin(x)*cos(x) = sin(2*x) a*cos(x) + b*sin(x) = sqrt(a^2 + b^2) * cos(x - atan2(b,a))
it is possible to show that:
alpha = 0.5 * (atan2(d, -h) - theta)
where / 2 2 \ | v h + g d | | -------------- | theta = acos | ________ | | 2 / 2 2 | \ v \/ h + d /
Thus we can calculate the desired aiming angle for any given velocity.
With some more rearrangement we can show:
________________________ / 2 / g d v = / ------------------------ / ________ / / 2 2 \/ \/ h + d cos(theta) - h
Which we can also write as: _________________ / a f(theta) = / ---------------- \/ b cos(theta) - c
where a = g*d^2 b = sqrt(h*h+d*d) c = h
We can imagine a graph of launch velocity versus launch angle. When the angle is near 0 degrees (i.e. totally flat) more and more velocity is needed. Similarly as the angle gets closer and closer to 90 degrees.
Somewhere in the middle is the minimum velocity that we could possibly hit the target with and the 'optimum' angle to fire at. Note that when h = 0 the optimum angle is 45 degrees. We want to find the minimum velocity so we need to take the derivative of f (which I suggest doing with an algebra system!).
f'(theta) = a * b * sin(theta) / junk
the `junk` is unimportant because we're just going to set f'(theta) = 0 and multiply it out anyway.
0 = a * b * sin(theta)
Neither a nor b can be 0 as long as d does not equal 0 (which is a degenerate case). Thus if we solve for theta we get 'sin(theta) = 0', thus 'theta = 0'. If we recall that:
alpha = 0.5 * (atan2(d, -h) - theta)
then we get our 'optimum' firing angle alpha as
alpha = 1/2 * atan2(d, -h)
and if we substitute back into our equation for v and we get
_______________ / 2 / g d vmin = / --------------- / ________ / / 2 2 \/ \/ h + d - h
as the minimum launch velocity for that angle.
[in] | from | Starting position for calculations. |
[in] | at | Ending position for calculations. |
[in] | speed | Launch velocity. |
[in] | launched | Set to true for grenade launchers. |
[in] | rolled | Set to true for "roll" type shoot. |
[in,out] | v0 | The velocity vector |
refactor and move me
Com_GrenadeTarget() is called from CL_TargetingGrenade() with speed param as (fireDef_s) fd->range (gi.GrenadeTarget, too), while it is being used here for speed calculations - a bug or just misleading documentation?
Definition at line 222 of file common.c.
References DIST_EPSILON, GRAVITY, len, torad, VectorLength(), VectorNormalize(), VectorScale, and VectorSubtract.
Referenced by CL_TargetingGrenade(), and SV_InitGameProgs().
unsigned int Com_HashKey | ( | const char * | name, | |
int | hashsize | |||
) |
returns hash key for a string
Definition at line 530 of file common.c.
References i.
Referenced by Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), Cmd_AddUserdata(), Cmd_Alias_f(), Cmd_CompleteCommandParameters(), Cmd_ExecuteString(), Cmd_Exists(), Cmd_GetCommandDesc(), Cmd_GetUserdata(), Cmd_RemoveCommand(), Com_GetConstInt(), Com_GetTerrainType(), Com_ParseTerrain(), Com_RegisterConstInt(), Com_UnregisterConstVariable(), Cvar_Delete(), Cvar_FindVar(), Cvar_Get(), R_DeleteImage(), R_GetImage(), R_LoadImageData(), RS_GetTechByID(), RS_GetTechByProvided(), RS_GetTechIdxByName(), RS_ParseTechnologies(), S_FindName(), S_LoadSample(), UI_WindowNodeAddIndexedNode(), and UI_WindowNodeGetIndexedChild().
void Com_Init | ( | void | ) |
void Com_InitArgv | ( | int | argc, | |
const char ** | argv | |||
) |
Definition at line 575 of file common.c.
References com_argc, com_argv, Com_Error(), ERR_FATAL, i, MAX_NUM_ARGVS, and MAX_TOKEN_CHARS.
Referenced by Qcommon_Init().
const char* Com_MacroExpandString | ( | const char * | text | ) |
Expands strings with cvar values that are dereferenced by a '*cvar'.
Definition at line 597 of file common.c.
References Com_Parse(), Com_Printf(), count, Cvar_GetString(), i, len, MACRO_CVAR_ID_LENGTH, MAX_STRING_CHARS, pos, Q_strncpyz(), and qfalse.
Referenced by Cmd_TokenizeString(), and UI_GetReferenceString().
void Com_MakeTimestamp | ( | char * | ts, | |
const size_t | tslen | |||
) |
Creates a timestamp with date and time at the specified location.
ts | ptr to the resulting string | |
tslen | length of target buffer |
Definition at line 332 of file common.c.
References Com_sprintf().
Referenced by CL_LogEvent(), Com_vPrintf(), and SAV_GameSave().
char* Com_MD5File | ( | const char * | fn, | |
int | length | |||
) |
Compute the md5sum of a given file.
[in] | fn | Filename to compute the md5 of |
[in] | length | Compute the md5 of the first 'length' bytes (if 0 - complete file) |
Definition at line 268 of file md5.c.
References f, FILE_READ, FS_CloseFile(), FS_OpenFile(), FS_Read(), i, MD5Final(), MD5Init(), MD5Update(), Q_strcat(), and va().
void Com_Quit | ( | void | ) |
Both client and server can use this, and it will do the appropriate things.
Definition at line 485 of file common.c.
References CL_Shutdown(), Com_WriteConfigToFile(), FS_CloseFile(), NET_Wait(), qfalse, SV_Clear(), SV_Shutdown(), and Sys_Quit().
Referenced by CL_Quit_f(), and Qcommon_Init().
int Com_ServerState | ( | void | ) |
Check whether we are the server or have a singleplayer tactical mission.
Definition at line 508 of file common.c.
References serverInstanceGame_t::state, and sv.
Referenced by B_MakeBaseMapShot_f(), CL_Disconnect(), CL_OnBattlescape(), CL_Reconnect_f(), CL_RequestNextDownload(), CL_SelectTeam_Init_f(), CL_SendCommand(), Cvar_FixCheatVars(), Cvar_Set2(), SCR_SetLoadingBackground(), SV_Configstring(), SV_ExecuteUserCommand(), SV_FindIndex(), and SV_New_f().
void Com_SetGameType | ( | void | ) |
Definition at line 791 of file common.c.
References Com_Printf(), Cvar_Set(), gametype_s::cvars, gt, gts, i, gametype_s::id, cvar_s::integer, cvarlist_s::name, numGTs, cvar_s::string, and cvarlist_s::value.
Referenced by GAME_MP_ChangeGametype_f(), GAME_MP_UpdateGametype_f(), SV_Frame(), and SV_NextMapcycle().
void Com_SetServerState | ( | int | state | ) |
Definition at line 517 of file common.c.
References Com_DPrintf(), DEBUG_ENGINE, qfalse, qtrue, ss_dead, ss_restart, serverInstanceGame_t::state, sv, and SV_Shutdown().
Referenced by SV_Map(), and SV_ShutdownWhenEmpty().
void Com_vPrintf | ( | const char * | fmt, | |
va_list | ap | |||
) |
Definition at line 348 of file common.c.
References COLORED_GREEN, Com_MakeTimestamp(), Con_Print(), qFILE_s::f, FILE_APPEND, FILE_WRITE, FS_OpenFile(), FS_Write(), cvar_s::integer, MAXPRINTMSG, name, NET_OOB_Printf(), Q_strcat(), Q_vsnprintf(), rd_buffer, rd_buffersize, and Sys_ConsoleOutput().
Referenced by Com_DPrintf(), Com_Printf(), and SV_dprintf().
void Com_WriteConfigToFile | ( | const char * | filename | ) |
Definition at line 939 of file common.c.
References Cmd_WriteAliases(), Com_Printf(), Cvar_WriteVariables(), qFILE_s::f, f, FILE_WRITE, FS_CloseFile(), FS_OpenFile(), and FS_Printf().
Referenced by Com_Quit(), and Com_WriteConfig_f().
void Con_Print | ( | const char * | txt | ) |
Handles cursor positioning, line wrapping, etc All console printing must go through this in order to be logged to disk If no console is visible, the text will appear at the top of the game window.
Definition at line 306 of file cl_console.c.
References CL_Milliseconds(), Con_Linefeed(), CONSOLE_COLORED_TEXT_MASK, console_t::currentLine, console_t::initialized, console_t::lineWidth, NUM_CON_TIMES, console_t::pos, qfalse, console_t::text, console_t::times, and console_t::totalLines.
Referenced by Com_vPrintf().
void Cvar_WriteVariables | ( | qFILE * | f | ) |
appends lines containing "set variable value" for all variables with the archive flag set to true.
Definition at line 855 of file cvar.c.
References CVAR_ARCHIVE, cvar_s::flags, FS_Printf(), cvar_s::name, cvar_s::next, and cvar_s::string.
Referenced by Com_WriteConfigToFile().
void Key_Init | ( | void | ) |
Definition at line 872 of file cl_keys.c.
References Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), Cmd_Dummy_f(), CONSOLE_COLORED_TEXT_MASK, CONSOLE_PROMPT_CHAR, i, Key_Bind_f(), Key_Bindlist_f(), Key_CompleteKeyName(), Key_Unbind_f(), Key_Unbindall_f(), Key_WriteBindings_f(), keyLinePos, keyLines, and MAXKEYLINES.
Referenced by Qcommon_Init().
void Qcommon_Frame | ( | void | ) |
This is the function that is called directly from main().
Definition at line 1328 of file common.c.
References abortframe, event::data, Dequeue_Event(), Mem_Free, NET_Wait(), Sys_Milliseconds(), and event::when.
void Qcommon_Init | ( | int | argc, | |
const char ** | argv | |||
) |
Init function.
Definition at line 988 of file common.c.
References abortframe, BUILDSTRING, Cbuf_AddEarlyCommands(), Cbuf_AddLateCommands(), Cbuf_AddText(), Cbuf_Execute(), Cbuf_Execute_timer(), Cbuf_Init(), CL_Frame(), CL_Init(), CL_InitAfter(), CL_SlowFrame(), Cmd_AddCommand(), Cmd_Init(), Com_CvarCheckMaxFPS(), Com_DeveloperSet_f(), Com_GameTypeList_f(), Com_InitArgv(), Com_ParseScripts(), Com_Printf(), Com_Quit(), Com_SetRenderModified(), Com_SetUserinfoModified(), Com_WriteConfig_f(), CPUSTRING, CVAR_ARCHIVE, Cvar_ForceSet(), Cvar_Get(), Cvar_Init(), CVAR_NOSET, CVAR_SERVERINFO, Cvar_SetCheckFunction(), DOUBLEQUOTE, FS_ExecAutoexec(), FS_InitFilesystem(), cvar_s::integer, Key_Init(), MASTER_SERVER, Mem_CheckGlobalIntegrity, Mem_CreatePool, Mem_Init(), Mem_TouchGlobal, cvar_s::modified, NET_Init(), PORT_SERVER, qfalse, qtrue, Schedule_Timer(), SCR_EndLoadingPlaque(), SV_Frame(), SV_Init(), Swap_Init(), Sys_Error(), Sys_Init(), Sys_InitSignals(), Sys_ShowConsole(), UFO_VERSION, and va().
void Qcommon_Shutdown | ( | void | ) |
Definition at line 1373 of file common.c.
References Cmd_Shutdown(), Cvar_Shutdown(), FS_Shutdown(), HTTP_Cleanup(), and Mem_Shutdown().
Referenced by Com_Error(), and Sys_Quit().
void Schedule_Event | ( | int | when, | |
event_func * | func, | |||
event_check_func * | check, | |||
event_clean_func * | clean, | |||
void * | data | |||
) |
Schedules an event to run on or after the given time, and when its check function returns true.
when | The earliest time the event can run | |
func | The function to call when running the event | |
check | A function that should return true when the event is safe to run. It should have no side-effects, as it might be called many times. | |
clean | A function that should cleanup any memory allocated for the event in the case that it is not executed. Either this function or func will be called, but never both. | |
data | Arbitrary data to be passed to the check and event functions. |
Definition at line 1233 of file common.c.
References Mem_PoolAlloc, event::next, and event::when.
Referenced by CL_ParseEvent(), Schedule_Timer(), and tick_timer().
void Schedule_Timer | ( | cvar_t * | interval, | |
event_func * | func, | |||
void * | data | |||
) |
Definition at line 1203 of file common.c.
References timer::checks_high, timer::checks_low, timer::data, timer::func, i, cvar_s::integer, timer::interval, Mem_PoolAlloc, timer::min_freq, timer::next_check, timer::next_lateness, timer::recent_lateness, Schedule_Event(), Sys_Milliseconds(), tick_timer(), TIMER_CHECK_INTERVAL, TIMER_LATENESS_HISTORY, and timer::total_lateness.
Referenced by Qcommon_Init().
void SCR_BeginLoadingPlaque | ( | void | ) |
Definition at line 348 of file cl_screen.c.
References CL_Milliseconds(), cls, client_static_s::disableScreen, SCR_UpdateScreen(), and screenDrawLoading.
Referenced by CL_CanMultiplayerStart(), and SV_Map().
void SCR_EndLoadingPlaque | ( | void | ) |
Definition at line 359 of file cl_screen.c.
References cls, Con_ClearNotify(), client_static_s::disableScreen, SCR_DrawLoading(), and screenDrawLoading.
Referenced by CL_Drop(), CL_StartGame(), Qcommon_Init(), and SCR_UpdateScreen().
void SV_Clear | ( | void | ) |
Cleanup when the whole game process is shutting down.
Definition at line 781 of file sv_main.c.
References SV_MapcycleClear().
Referenced by Com_Quit().
void SV_Frame | ( | int | now, | |
void * | data | |||
) |
Definition at line 600 of file sv_main.c.
References serverInstanceStatic_t::abandon, Cbuf_AddText(), Com_SetGameType(), serverInstanceGame_t::endgame, serverInstanceStatic_t::initialized, cvar_s::integer, serverInstanceStatic_t::killserver, Master_Heartbeat(), cvar_s::modified, qfalse, serverInstanceStatic_t::realtime, sv, SV_CheckGameStart(), sv_dedicated, sv_gametype, SV_NextMapcycle(), SV_RunGameFrame(), SV_Shutdown(), svs, Sys_ConsoleInput(), and va().
Referenced by Qcommon_Init().
mapData_t* SV_GetMapData | ( | void | ) |
Definition at line 697 of file sv_main.c.
References serverInstanceGame_t::mapData, and sv.
Referenced by CL_RequestNextDownload().
mapTiles_t* SV_GetMapTiles | ( | void | ) |
Definition at line 702 of file sv_main.c.
References serverInstanceGame_t::mapTiles, and sv.
Referenced by CL_RequestNextDownload().
void SV_Init | ( | void | ) |
Only called once at startup, not for each game.
Definition at line 710 of file sv_main.c.
References Com_Printf(), CVAR_ARCHIVE, Cvar_Get(), CVAR_LATCH, CVAR_NOSET, CVAR_SERVERINFO, Cvar_Set(), Cvar_SetCheckFunction(), DOUBLEQUOTE, cvar_s::integer, Mem_CreatePool, cvar_s::modified, PROTOCOL_VERSION, qfalse, SV_CheckMaxSoldiersPerPlayer(), sv_dedicated, SV_InitOperatorCommands(), SV_MapcycleInit(), and svs.
Referenced by Qcommon_Init().
void SV_Shutdown | ( | const char * | finalmsg, | |
qboolean | reconnect | |||
) |
Called when each game quits, before Sys_Quit or Sys_Error.
[in] | finalmsg | The message all clients get as server shutdown message |
[in] | reconnect | True if this is only a restart (new map or map restart), false if the server shutdown completely and you also want to disconnect all clients |
Definition at line 792 of file sv_main.c.
References serverInstanceStatic_t::clients, Com_Printf(), CVAR_LATCH, CVAR_NOSET, cvar_s::flags, i, serverInstanceStatic_t::initialized, Master_Shutdown(), Mem_Free, sv_model_s::name, NET_DatagramSocketClose(), serverInstanceStatic_t::netDatagramSocket, serverInstanceGame_t::numSVModels, serverInstanceStatic_t::serverMutex, sv, SV_FinalMessage(), SV_ShutdownGameProgs(), SV_Stop(), serverInstanceGame_t::svModels, and svs.
Referenced by CL_Connect_f(), CL_SequenceStart_f(), Com_Error(), Com_Quit(), Com_SetServerState(), CP_StartSelectedMission(), GAME_CP_Drop(), GAME_CP_Results(), GAME_CP_Shutdown(), GAME_Drop(), GAME_MP_Shutdown(), GAME_SK_Shutdown(), SV_Frame(), and SV_KillServer_f().
void SV_ShutdownWhenEmpty | ( | void | ) |
Will eventually shutdown the server once all clients have disconnected.
Definition at line 840 of file sv_main.c.
References serverInstanceStatic_t::abandon, Com_SetServerState(), qtrue, ss_dead, and svs.
Referenced by CL_Disconnect_f().
Definition at line 60 of file common.c.
Referenced by Cmd_Alias_f(), Com_RegisterConstInt(), and TEST_Init().
Definition at line 61 of file common.c.
Referenced by Cmd_AddCommand(), Cmd_TokenizeString(), and TEST_Init().
Definition at line 62 of file common.c.
Referenced by CM_LoadMap(), CM_MakeTracingNodes(), CMod_LoadBrushes(), CMod_LoadBrushSides(), CMod_LoadLeafBrushes(), CMod_LoadLeafs(), CMod_LoadLighting(), CMod_LoadNodes(), CMod_LoadPlanes(), CMod_LoadSubmodels(), CMod_LoadSurfaces(), and TEST_Init().
Definition at line 63 of file common.c.
Referenced by Cvar_FixCheatVars(), Cvar_FullSet(), Cvar_Get(), Cvar_GetChangeListener(), Cvar_Set2(), and TEST_Init().
Definition at line 42 of file common.c.
Referenced by Con_DrawNotify(), and MS_LoadXML().
gametype_t gts[MAX_GAMETYPES] |
Definition at line 2877 of file scripts.c.
Referenced by Com_GameTypeList_f(), Com_SetGameType(), and GAME_MP_ChangeGametype_f().
Definition at line 43 of file common.c.
Referenced by CL_StartHTTPDownload(), and HTTP_GetURL().
Definition at line 44 of file common.c.
Referenced by HTTP_GetURL().
Definition at line 52 of file common.c.
Referenced by CL_InitLocal(), CL_QueryMasterServerThread(), Master_HeartbeatThread(), Master_Shutdown(), and SV_SetMaster_f().
int numGTs |
Definition at line 2878 of file scripts.c.
Referenced by Com_GameTypeList_f(), Com_SetGameType(), and GAME_MP_ChangeGametype_f().
Definition at line 53 of file common.c.
Referenced by CL_Rcon_f(), CL_ServerInfo_f(), Irc_Client_CmdPrivmsg(), Irc_Client_Invite_f(), Master_HeartbeatThread(), Master_Shutdown(), SV_InitGame(), and SV_SetMaster_f().
Definition at line 51 of file common.c.
Referenced by GAME_MP_ChangeGametype_f(), GAME_MP_MapInfo(), SV_Frame(), SV_NextMapcycle(), and SVC_Info().
Definition at line 60 of file g_main.c.
Referenced by AI_CreatePlayer(), AI_FighterCalcBestAction(), AI_SetStats(), CL_InitLocal(), G_ActorSpawnIsAllowed(), G_CheckForceEndRound(), G_Damage(), G_GetStartingTeam(), G_GetTeam(), G_IsMoraleEnabled(), G_Morale(), G_MoraleBehaviour(), G_SpawnEntities(), SP_2x2_start(), SP_alien_start(), SP_civilian_start(), SP_human_start(), SP_player_start(), SP_worldspawn(), SV_InitGame(), SV_ParseAssembly(), SV_SetMaster_f(), and UFO_AddRandomMapAssemblyTests().
Definition at line 55 of file common.c.
Referenced by CL_Frame(), Sys_Init(), and Sys_SetAffinityAndPriority().
Definition at line 56 of file common.c.
Referenced by Sys_Init().
Definition at line 54 of file common.c.
Referenced by CL_Frame(), Sys_Init(), and Sys_SetAffinityAndPriority().