UFO: Alien Invasion
|
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 "cvar.h"
#include "mem.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"
Go to the source code of this file.
Data Structures | |
struct | comDrop_t |
class | comRestart_t |
struct | date_s |
Engine-side time information in the game. More... | |
struct | scheduleEvent_t |
Macros | |
#define | UFO_VERSION "2.6-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.org/" /* sponsored by NineX */ |
#define | PROTOCOL_VERSION 18 |
#define | PORT_CLIENT 27901 |
#define | PORT_SERVER 27910 |
#define | MAX_SVC_STUFFTEXT 1024 |
#define | MAX_SVC_PRINT 1024 |
#define | MAX_SVC_RECONNECT 256 |
#define | MAX_SVC_DISCONNECT 256 |
#define | MAX_CLC_STRINGCMD 512 |
#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 /* exit the entire game with a popup window */ |
#define | ERR_DROP 1 /* print to console and disconnect from game */ |
#define | ERR_QUIT 2 /* not an error, just a normal exit */ |
#define | Q_COLOR_ESCAPE '^' |
#define | Q_IsColorString(p) ((p) && *(p) == Q_COLOR_ESCAPE && *((p) + 1) && isalnum(*((p) + 1))) |
#define | S_COLOR_BLACK "^0" |
#define | S_COLOR_RED "^1" |
#define | S_COLOR_GREEN "^2" |
#define | S_COLOR_YELLOW "^3" |
#define | S_COLOR_BLUE "^4" |
#define | S_COLOR_CYAN "^5" |
#define | S_COLOR_MAGENTA "^6" |
#define | S_COLOR_WHITE "^7" |
#define | CON_COLOR_BLACK 0 |
#define | CON_COLOR_RED 1 |
#define | CON_COLOR_GREEN 2 |
#define | CON_COLOR_YELLOW 3 |
#define | CON_COLOR_BLUE 4 |
#define | CON_COLOR_CYAN 5 |
#define | CON_COLOR_MAGENTA 6 |
#define | CON_COLOR_WHITE 7 |
#define | MAX_COLORS 8 |
#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 | HOURS_PER_DAY 24 |
#define | MAXCMDLINE 256 |
#define | REMOVE_ELEM(array, index, n) |
#define | REMOVE_ELEM_ADJUST_IDX(array, index, n) |
#define | HASH_Add(hash, elem, index) |
#define | HASH_Delete(anchor) (*(anchor) = (*(anchor))->hash_next) |
Typedefs | |
typedef int32_t | svc_ops_t |
typedef void(* | exceptionCallback_t )(void) |
typedef struct date_s | date_t |
Engine-side time information in the game. More... | |
typedef void(* | vPrintfPtr_t )(const char *fmt, va_list ap) |
typedef void | event_func (int now, void *data) |
typedef bool | event_check_func (int now, void *data) |
typedef bool | event_delay_func (int now, void *data) |
typedef void | event_notify_delay_func (int now, void *data, int delay) |
typedef bool | event_filter (int when, event_func *func, event_check_func *check, void *data) |
typedef void | event_clean_func (void *data) |
typedef SharedPtr < scheduleEvent_t > | ScheduleEventPtr |
Enumerations | |
enum | svc_ops_e { svc_bad, svc_nop, svc_ping, svc_disconnect, svc_reconnect, 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_ack, clc_endround, clc_teaminfo, clc_initactorstates, clc_action, clc_userinfo, clc_stringcmd, clc_oob = svc_oob } |
client to server More... | |
Functions | |
void | Com_BeginRedirect (struct net_stream *stream, char *buffer, int buffersize) |
Redirect packets/output from server to client. More... | |
void | Com_EndRedirect (void) |
End the redirection of packets/output. More... | |
void | Com_vPrintf (const char *fmt, va_list) |
void | Com_Drop (void) __attribute__((noreturn)) |
void | Com_Quit (void) |
void | Com_BreakIntoDebugger (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. More... | |
int | Com_ServerState (void) |
Check whether we are the server or have a singleplayer tactical mission. More... | |
void | Com_SetServerState (int state) |
void | Com_SetRandomSeed (unsigned int seed) |
const char * | Com_UnsignedIntToBinary (uint32_t x) |
const char * | Com_ByteToBinary (byte x) |
const char * | Com_MD5File (const char *fn, int length=0) |
Compute the md5sum of a given file. More... | |
const char * | Com_MD5Buffer (const byte *buf, size_t len) |
Compute the md5sum of the given buffer. More... | |
vPrintfPtr_t | Qcommon_GetPrintFunction (void) |
void | Qcommon_SetPrintFunction (vPrintfPtr_t func) |
void | Qcommon_Init (int argc, char **argv) |
Init function. More... | |
void | Qcommon_Frame (void) |
This is the function that is called directly from main() More... | |
void | Qcommon_Shutdown (void) |
void | Com_SetGameType (void) |
void | Com_ReadFromPipe (void) |
Read whatever is in com_pipefile, if anything, and execute it. More... | |
float | Com_GrenadeTarget (const vec3_t from, const vec3_t at, float speed, bool launched, bool rolled, vec3_t v0) |
Calculates parabola-type shot. More... | |
bool | Com_CheckConfigStringIndex (int index) |
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. More... | |
ScheduleEventPtr | 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. More... | |
int | CL_FilterEventQueue (event_filter *filter) |
Filters every event in the queue using the given function. Keeps all events for which the function returns true. More... | |
void | CL_Init (void) |
void | CL_Drop (void) |
Ensures the right menu cvars are set after error drop or map change. More... | |
void | CL_Shutdown (void) |
Saves configuration file and shuts the client systems down. More... | |
int | CL_Milliseconds (void) |
void | CL_Frame (int now, void *data) |
void | CL_SlowFrame (int now, void *data) |
bool | CL_ParseClientData (const char *type, const char *name, const char **text) |
Called at client startup. More... | |
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. More... | |
void | SV_Init (void) |
Only called once at startup, not for each game. More... | |
void | SV_Clear (void) |
Cleanup when the whole game process is shutting down. More... | |
void | SV_Shutdown (const char *finalmsg, bool reconnect) |
Called when each game quits, before Sys_Quit or Sys_Error. More... | |
void | SV_ShutdownWhenEmpty (void) |
Will eventually shutdown the server once all clients have disconnected. More... | |
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. More... | |
const char * | Com_Argv (int arg) |
Returns an argument of script commandline. More... | |
void | Com_ClearArgv (int arg) |
Reset com_argv entry to empty string. More... | |
const char * | Com_MacroExpandString (const char *text) |
Expands strings with cvar values that are dereferenced by a '*cvar'. More... | |
void | Com_UploadCrashDump (const char *crashDumpFile) |
bool | Com_ConsoleCompleteCommand (const char *s, char *target, size_t bufSize, uint32_t *pos, uint32_t offset) |
Console completion for command and variables. More... | |
void | Key_Init (void) |
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 207 of file common.h.
Referenced by NET_WriteAngle16().
#define BUILDSTRING BUILDSTRING_OS " " BUILDSTRING_VARIANT |
Definition at line 121 of file common.h.
Referenced by Qcommon_Init(), and Sys_Backtrace().
#define BUILDSTRING_OS "Unknown" |
Definition at line 89 of file common.h.
Referenced by Com_UploadCrashDump().
#define CON_COLOR_GREEN 2 |
Definition at line 228 of file common.h.
Referenced by Con_DrawConsole().
#define CON_COLOR_WHITE 7 |
Definition at line 233 of file common.h.
Referenced by Con_Clear(), Con_DrawConsole(), Con_DrawInput(), Con_DrawString(), Con_Linefeed(), and Con_Print().
#define CPUSTRING "Unknown" |
Definition at line 109 of file common.h.
Referenced by GAME_LoadGame(), Qcommon_Init(), SV_LoadGame(), and Sys_Backtrace().
#define DAYS_PER_YEAR 365 |
Definition at line 296 of file common.h.
Referenced by Com_ParseValue(), Com_ValueToStr(), CP_DateConvertLong(), uiGeoscapeNode::draw(), and R_Draw3DGlobe().
#define DAYS_PER_YEAR_AVG 365.25 |
Definition at line 297 of file common.h.
Referenced by GEO_IsNight().
#define ERR_DROP 1 /* print to console and disconnect from game */ |
Definition at line 211 of file common.h.
Referenced by _LE_NotFoundError(), AII_ReloadWeapon(), AIM_AutoEquipAircraft(), AIR_AircraftSelect(), AIR_AircraftStatusToName(), AIR_DestroyAircraft(), AIR_GetAircraft(), AIR_GetDestinationFindRoot(), AIR_LoadAircraftXML(), AIR_ParseAircraft(), AIR_RemoveEmployees(), AM_CalculateTeamScores(), B_AddAntimatter(), B_AntimatterInBase(), B_AssembleMap(), B_Build(), B_BuildBase_f(), B_BuildBuilding(), B_BuildFromTemplate(), B_BuildingDestroy(), B_FireEvent(), B_ParseBaseTemplate(), B_ParseBuildings(), B_SetUpFirstBase(), B_UpdateBaseCapacities(), BATTLE_Start(), BDEF_AutoTarget(), BS_Buy_f(), BS_BuyAircraft(), BS_BuyItem(), BS_BuyUGV(), BS_SellItem(), BS_SellUGV(), CHAR_GetMaxExperiencePerMission(), CHAR_ParseData(), CIN_ROQ_DecodeInfo(), CL_ActorAppear(), CL_ActorDie(), CL_ActorDoMove(), CL_ActorDoMoveTime(), CL_ActorDoShoot(), CL_ActorDoTurn(), CL_ActorGetMuzzle(), CL_ActorRevitalised(), CL_ActorSelect(), CL_ActorStartShoot(), CL_AddActor(), CL_AddBrushModel(), CL_BattlescapeSearchAtGridPos(), CL_DoorClose(), CL_DoorOpen(), CL_DoSwapSkills(), CL_ExecuteBattlescapeEvent(), CL_FinishHTTPDownload(), CL_GetConfigString(), CL_GetEvent(), CL_GetHitProbability(), CL_HullForEntity(), CL_InvAdd(), CL_InvDel(), CL_NetReceiveItem(), CL_ParseActorSkin(), CL_ParseEvent(), CL_ParseLanguages(), CL_ParseMapParticle(), CL_ParsePtlCmds(), CL_ParseRanks(), CL_ParseResults(), CL_ParseSequence(), CL_ParseServerData(), CL_ParseServerMessage(), CL_ParticleFunction(), CL_ParticleGetArt(), CL_ParticleLoadArt(), CL_ParticleSpawnTimed(), CL_SendCommand(), CL_SetConfigString(), CL_SetHTTPServer(), CL_SpawnParseEntitystring(), CL_ViewLoadMedia(), CM_AddMapTile(), CM_EntCompleteBoxTrace(), CM_EntTestLine(), CM_EntTestLineDM(), CM_InitBoxHull(), CM_InlineModel(), CM_LoadMap(), CMod_LoadBrushSides(), CMod_LoadEntityString(), CMod_LoadLeafs(), CMod_LoadRouting(), CMod_ValidateLump(), Com_BeginRedirect(), Com_Error(), Com_GetCharacterValues(), Com_GetGender(), Com_ParseActorModels(), Com_ParseActorNames(), Com_ParseBodyPart(), Com_ParseEquipment(), Com_ParseTeam(), COMP_GetComponentsByID(), COMP_ParseComponents(), CP_AttackUFOCarrier_f(), CP_BaseAttackGoToBase(), CP_BeginRescueMission(), CP_ChooseMap(), CP_CleanupContainerWeapons(), CP_MissionChooseUFO(), CP_MissionRemove(), CP_ParseAlienTeam(), CP_ParseCampaignData(), CP_SetAlienEquipmentByInterest(), CP_SetAlienTeamByInterest(), CP_SpawnCrashSiteMission(), CP_SpawnRescueMission(), CP_TEAM_AssignSoldierByUCN_f(), CP_TEAM_DeEquipActor_f(), CP_TEAM_SelectActorByUCN_f(), CP_ToDifficultyName(), CP_XVIInit(), uiTextNode::doLayout(), E_CreateEmployee(), E_GetEmployeeString(), E_GetEmployeeTypeString(), GAME_AppendTeamMember(), GAME_ChangeEquip(), GAME_CP_TeamIsKnown(), GAME_GenerateTeam(), GAME_GetCharacter(), GAME_LoadInventory(), GAME_NetSendCharacter(), GAME_SK_MapInfo(), GEO_GetCivilianNumberByPosition(), GEO_GetColor(), GEO_Init(), HTTP_ResolvURL(), INS_FinishInstallation(), INV_GetEquipmentDefinitionByID(), LE_Add(), LE_DoEndPathMove(), LE_GetClipModel(), LE_GetDrawModel(), LE_Lock(), LE_PlaceItem(), LE_Unlock(), LET_StartIdle(), LM_AddModel(), LM_AddToSceneOrder(), LMT_Init(), M_ParseMusic(), MD2GLCmdsRemove(), MD2HeaderCheck(), MIS_GetModel(), MIS_IsSpawnedFromGround(), ModelWorker(), MSO_ParseCategory(), MSO_ParseMessageSettings(), NET_DatagramBroadcast(), NET_ReadDir(), NET_SkipFormat(), NET_vReadFormat(), NET_vWriteFormat(), uiText2Node::onLoaded(), PR_DecreaseProduction(), PR_GetName(), PR_ProductionInfo(), PR_QueueDelete(), PR_UpdateRequiredItemsInBasestorage(), PrecalcNormalsAndTangents(), R_AddEntity(), R_AliasModelState(), R_AllocModelSlot(), R_CalcTransform(), R_CreateSurfaceLightmap(), R_GetEntityLists(), R_GetFreeEntity(), R_LoadImageData(), R_LoadObjModel(), R_LoadObjModelFace(), R_LoadObjModelLine(), R_ModAddMapTile(), R_ModBeginLoading(), R_ModCalcUniqueNormalsAndTangents(), R_ModLoadAliasMD2Mesh(), R_ModLoadAliasMD2MeshIndexed(), R_ModLoadAliasMD2MeshUnindexed(), R_ModLoadAliasMD2Model(), R_ModLoadAliasMD3Model(), R_ModLoadAnims(), R_ModLoadEdges(), R_ModLoadLeafs(), R_ModLoadMDX(), R_ModLoadNodes(), R_ModLoadNormals(), R_ModLoadPlanes(), R_ModLoadSubmodels(), R_ModLoadSurfaces(), R_ModLoadSurfedges(), R_ModLoadTexinfo(), R_ModLoadVertexes(), R_PreprocessShaderR(), R_SetBlendMode(), R_SetupSubmodels(), RADAR_UpdateInstallationRadarCoverage(), RS_AssignTechLinks(), RS_GetTechForItem(), RS_GetTechForTeam(), RS_InitTree(), RS_ParseTechnologies(), SP_misc_model(), SV_AddEvent(), SV_AddMapTiles(), SV_AddTile(), SV_AssembleMap_(), SV_CreateWorldSector(), SV_error(), SV_GetCvarToken(), SV_GetServerDataForEdict(), SV_GetTileFromTileSet(), SV_GetTilesFromTileSet(), SV_InitGameProgs(), SV_LoadModelAABB(), SV_ParseAssembly(), SV_ParseMapTileSet(), SV_ParseUMP(), SV_QueueEvent(), tileMask(), TR_Add_f(), TR_BoxTrace(), TR_BuildTracingNode_r(), TR_CargoList(), TR_Fill(), TR_FillEmployees(), TR_Init_f(), TR_LoadXML(), UFO_GetByType(), UFO_IsUFOSeenOnGeoscape(), UFO_TypeToName(), UI_BuildRadarImageList(), UI_DrawModelNode(), UI_NodeAbsoluteToRelativePos(), UP_Article(), UP_DisplayTechTree(), UP_GenerateSummary(), UP_ParseChapter(), UP_SetMailHeader(), UP_TechTreeClick_f(), US_RemoveUFOsExceedingCapacity(), and US_TransferUFO().
#define ERR_FATAL 0 /* exit the entire game with a popup window */ |
Definition at line 210 of file common.h.
Referenced by AIR_IsAircraftOnGeoscape(), uiBox_t::alignBox(), BEP_Evaluate(), CL_ParseLanguages(), CL_ParseSequence(), CL_SetClientState(), CL_SetRatioFilter_f(), CM_AddMapTile(), Com_InitArgv(), CP_SpawnAlienBaseMission(), GAME_GetCGameAPI(), Key_Event(), LoadModel(), ModelWorker(), NET_Init(), R_Draw3DGlobe(), R_DrawFlatGeoscape(), R_DrawInitLocal(), R_EnforceVersion(), R_FindImage(), R_FindModel(), R_FontAnalyze(), R_FontInit(), R_GetFont(), R_GetFreeFBOTexture(), R_GetModel(), R_GetSpriteVectors(), R_InitExtensions(), R_InitializeShader(), R_InitImages(), R_LoadImage(), R_LoadModel(), R_LoadModelAsync(), R_ModLoadAnims(), R_ModLoadTags(), R_PreprocessShaderR(), R_SoftenTexture(), R_SortSurfacesArrays_(), R_UploadData(), R_VerifyDriver(), Rimp_Init(), RS_InitTree(), SEQ_ExecuteModel(), SEQ_ExecuteObj2D(), SV_GetConfigString(), SV_GetConfigStringLength(), SV_GetGameAPI(), SV_HullForEntity(), SV_SetConfigString(), SZ_GetSpace(), UI_AllocNodeWithoutNew(), UI_AllocStaticAction(), UI_AllocStaticColor(), UI_AllocStaticFloat(), UI_AllocStaticKeyBinding(), UI_AllocStaticSprite(), UI_AllocStaticString(), UI_AllocTimer(), UI_CreateWindow(), UI_DrawString(), UI_ExecuteAction(), UI_ExecuteSetAction(), UI_GetBooleanFromExpression(), UI_GetFloatFromExpression(), UI_GetNodeAbsPos(), UI_GetNodeScreenPos(), UI_GetStringFromExpression(), UI_ImageAlignBoxInBox(), 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_RegisterNodePropertyPosSize_(), UI_ReleaseVariable(), UI_SetKeyBindingEx(), and UI_SetOneButton().
#define GAME_TITLE "UFO:AI" |
Definition at line 37 of file common.h.
Referenced by CL_StartHTTPDownload(), HTTP_GetURLInternal(), HTTP_PutFile(), R_InitExtensions(), and Rimp_Init().
#define GAME_TITLE_LONG "UFO:Alien Invasion" |
Definition at line 38 of file common.h.
Referenced by R_InitGraphics(), Rimp_Init(), and S_MumbleLink().
Definition at line 430 of file common.h.
Referenced by CL_ParseMessageID(), Cmd_AddCommand(), Cvar_Get(), and R_LoadImageData().
#define HASH_Delete | ( | anchor | ) | (*(anchor) = (*(anchor))->hash_next) |
Definition at line 439 of file common.h.
Referenced by Cvar_Delete(), and R_DeleteImage().
#define MASTER_SERVER "http://ufoai.org/" /* sponsored by NineX */ |
Definition at line 124 of file common.h.
Referenced by CL_InitLocal(), Qcommon_Init(), and GameTest::SetUpTestCase().
#define MAX_CLC_STRINGCMD 512 |
Definition at line 163 of file common.h.
Referenced by SV_ExecuteClientMessage().
#define MAX_SVC_DISCONNECT 256 |
Definition at line 162 of file common.h.
Referenced by CL_ParseServerMessage().
#define MAX_SVC_PRINT 1024 |
Definition at line 160 of file common.h.
Referenced by CL_ParseServerMessage(), SV_BroadcastPrintf(), and SV_ClientPrintf().
#define MAX_SVC_RECONNECT 256 |
Definition at line 161 of file common.h.
Referenced by CL_ParseServerMessage().
#define MAX_SVC_STUFFTEXT 1024 |
Definition at line 159 of file common.h.
Referenced by CL_ParseServerMessage(), and SV_ClientCommand().
#define MAXCMDLINE 256 |
Definition at line 307 of file common.h.
Referenced by Com_ConsoleCompleteCommand(), Con_DrawInput(), Con_LoadConsoleHistory(), Con_SaveConsoleHistory(), Key_Console(), Sys_ConsoleInit(), and Sys_ConsoleInput().
#define MINUTES_PER_HOUR 60 |
(60)
Definition at line 304 of file common.h.
Referenced by PR_CalculateTotalFrames(), PR_GetProductionHours(), and PR_GetRemainingHours().
#define MONTHS_PER_YEAR 12 |
DAYS_PER_MONTH ->
Definition at line 299 of file common.h.
Referenced by CP_DateConvertLong(), NAT_BackupMonthlyData(), NAT_DrawCharts_f(), NAT_GetFunding(), NAT_ListStats_f(), NAT_LoadXML(), and NAT_SaveXML().
#define PORT_CLIENT 27901 |
Definition at line 136 of file common.h.
Referenced by GAME_MP_PingServers_f().
#define PORT_SERVER 27910 |
Definition at line 137 of file common.h.
Referenced by GAME_MP_Connect_f(), GAME_MP_PingServers_f(), GAME_MP_Rcon(), GAME_MP_ServerInfo_f(), Qcommon_Init(), and GameTest::SetUpTestCase().
#define PROTOCOL_VERSION 18 |
Definition at line 134 of file common.h.
Referenced by CL_Connect(), CL_ParseServerData(), GAME_MP_PingServer(), GAME_MP_ProcessPingReply(), GAME_MP_SelectTeam_Init_f(), GAME_MP_ServerInfo_f(), SV_Init(), SV_New_f(), SVC_DirectConnect(), SVC_Info(), and TEST_F().
#define Q_IsColorString | ( | p | ) | ((p) && *(p) == Q_COLOR_ESCAPE && *((p) + 1) && isalnum(*((p) + 1))) |
Definition at line 215 of file common.h.
Referenced by Con_DrawString(), and Con_Print().
#define REMOVE_ELEM | ( | array, | |
index, | |||
n | |||
) |
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 408 of file common.h.
Referenced by B_BuildingDestroy(), BDEF_RemoveBattery(), NAT_ScriptSanityCheck(), RADAR_RemoveUFO(), and UI_RemoveWindow().
#define REMOVE_ELEM_ADJUST_IDX | ( | array, | |
index, | |||
n | |||
) |
Same as REMOVE_ELEM() and also updates the idx attribute of every moved element
Definition at line 419 of file common.h.
Referenced by AIRFIGHT_RemoveProjectile(), PR_QueueDelete(), and UFO_RemoveFromGeoscape().
#define S_COLOR_GREEN "^2" |
Definition at line 219 of file common.h.
Referenced by Cmd_CompleteCommand(), Cmd_Help_f(), Cmd_List_f(), CMod_ValidateLump(), Cvar_CompleteVariable(), Cvar_List_f(), GAME_MP_ParseServerInfoMessage(), Irc_Client_CmdPrivmsg(), and SV_CompleteServerCommand().
#define S_COLOR_YELLOW "^3" |
Definition at line 220 of file common.h.
Referenced by CL_RunMapParticles().
#define SEASONS_PER_YEAR 4 |
Definition at line 300 of file common.h.
Referenced by R_Draw3DGlobe().
#define SECONDS_PER_DAY 86400 |
(24 * 60 * 60)
Definition at line 301 of file common.h.
Referenced by B_GetConstructionTimeRemain(), CP_AdvanceTimeBySeconds(), CP_ReadCampaignData(), Date_Add(), Date_Random(), Date_Substract(), uiGeoscapeNode::draw(), GEO_IsNight(), R_Draw3DGlobe(), TEST_F(), and TR_TransferStart().
#define SECONDS_PER_HOUR 3600 |
(60 * 60)
Definition at line 302 of file common.h.
Referenced by AIR_AircraftHasEnoughFuel(), AIR_AircraftHasEnoughFuelOneWay(), AIR_AircraftMakeMove(), AIR_GetOperationRange(), AIR_ParseAircraft(), AIRFIGHT_CampaignRunProjectiles(), AIRFIGHT_ProjectileReachedTarget(), CL_DisplayPopupInterceptMission(), Com_ParseValue(), CP_CampaignRun(), CP_DateConvertLong(), CP_SecondConvert(), uiGeoscapeNode::draw(), and GEO_GetAircraftText().
#define SECONDS_PER_MINUTE 60 |
#define SHORT2ANGLE | ( | x | ) | ((x)*(360.0/65536)) |
Definition at line 208 of file common.h.
Referenced by NET_ReadAngle16().
#define SOUND_ATTN_IDLE 1.2f |
Definition at line 187 of file common.h.
Referenced by CL_ActorDoThrow(), CL_ActorPlaySound(), CL_SpawnParseEntitystring(), Com_ParseItem(), and LE_PlaySoundFileForContents().
#define SOUND_ATTN_MAX SOUND_ATTN_STATIC |
Definition at line 189 of file common.h.
Referenced by Com_ParseFire(), and Com_ParseItem().
#define SOUND_ATTN_NONE 0.0f |
full volume the entire level
Definition at line 185 of file common.h.
Referenced by Com_ParseFire(), and Com_ParseItem().
#define SOUND_ATTN_NORM 1.0f |
Definition at line 186 of file common.h.
Referenced by CL_Explode(), CL_SoundEvent(), Com_ParseFireDefinition(), LE_PlayFootStepSound(), and S_StartLocalSample().
#define SOUND_ATTN_STATIC 3.0f |
dimish very rapidly with distance
Definition at line 188 of file common.h.
Referenced by LE_PlaySoundFileAndParticleForSurface().
#define UFO_VERSION "2.6-dev" |
Definition at line 36 of file common.h.
Referenced by CL_CanMultiplayerStart(), CL_StartHTTPDownload(), Com_ParseVersion(), Com_UploadCrashDump(), Con_DrawConsole(), FS_GetHomeDirectory(), GAME_MP_ProcessPingReply(), HTTP_GetURLInternal(), HTTP_PutFile(), Irc_Client_CmdPrivmsg(), Irc_GetExternalIP(), Qcommon_Init(), SAV_GameSave(), SV_Map(), SVC_Info(), and Sys_Backtrace().
Engine-side time information in the game.
typedef bool event_filter(int when, event_func *func, event_check_func *check, void *data) |
typedef SharedPtr<scheduleEvent_t> ScheduleEventPtr |
enum clc_ops_e |
enum svc_ops_e |
server to client the svc_strings[] array in cl_parse.c should mirror this
Enumerator | |
---|---|
svc_bad | |
svc_nop |
the rest are private to the client and server |
svc_ping | |
svc_disconnect | |
svc_reconnect | |
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 |
Ensures the right menu cvars are set after error drop or map change.
Definition at line 167 of file cl_main.cpp.
References CL_Disconnect(), GAME_Drop(), and SCR_EndLoadingPlaque().
Referenced by CL_ConnectionlessPacket(), CL_ParseServerMessage(), Com_Error(), GAME_GetImportData(), and GAME_HandleResults().
int 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 1446 of file common.cpp.
References eventQueue, and i.
Referenced by CL_ClearBattlescapeEvents(), and Qcommon_Frame().
Definition at line 1048 of file cl_main.cpp.
References ca_active, ca_connected, cl, CL_CameraMove(), CL_ParticleRun(), CL_ReadPackets(), CL_RunHTTPDownloads(), 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, Sys_SetAffinityAndPriority(), and clientBattleScape_s::time.
Referenced by Qcommon_Init().
Definition at line 1142 of file cl_main.cpp.
References BASEDIRNAME, CIN_Init(), CL_ClearState(), CL_InitLocal(), CL_InitLua(), CL_InitMemPools(), CL_RContextCvarChange(), CL_RImagesCvarChange(), CL_ViewInit(), Com_DPrintf(), Com_sprintf(), Con_Init(), Cvar_Get(), Cvar_GetFirst(), CVAR_R_CONTEXT, CVAR_R_IMAGES, Cvar_RegisterChangeListener(), DEBUG_CLIENT, FS_GetCwd(), fs_i18ndir, cvar_s::integer, Irc_Init(), isdown, MAX_OSPATH, cvar_s::next, OBJZERO, Q_strncpyz(), S_Init(), SCR_DrawLoadingScreen(), SCR_Init(), cvar_s::string, sv_dedicated, TEXT_DOMAIN, and VID_Init().
Referenced by Qcommon_Init().
Init function for clients - called after menu was initialized and ufo-scripts were parsed.
Definition at line 738 of file cl_main.cpp.
References CL_LanguageInit(), CL_ViewPrecacheModels(), CLMN_Init(), Com_MapDefSort(), csi, cvar_s::integer, csi_s::mds, csi_s::numMDs, S_Frame(), S_LoadSamples(), and sv_dedicated.
Referenced by Qcommon_Init().
Definition at line 1208 of file cl_main.cpp.
References client_static_s::realtime.
Referenced by CIN_OGM_OpenCinematic(), CIN_OGM_RunCinematic(), CIN_ROQ_DecodeChunk(), CIN_ROQ_OpenCinematic(), CL_Connect(), CL_ParseServerMessage(), CL_ParticleRunTimed(), CL_Reconnect(), CL_RequestNextDownload(), CL_SendCommand(), Con_DrawInput(), uiTextEntryNode::draw(), uiTimerNode::draw(), GAME_GetImportData(), IN_KeyDown(), IN_SendKeyEvents(), Irc_Proto_Connect(), Irc_Proto_RefillBucket(), uiTimerNode::onWindowOpened(), S_LoopSample(), S_PlaySample(), SCR_BeginLoadingPlaque(), SCR_UpdateScreen(), UI_AbstractNodeCallDeleteTimed(), UI_DisplayNotice(), UI_Draw(), UI_DrawNode(), UI_HandleTimers(), and UI_TimerStart().
bool CL_ParseClientData | ( | const char * | type, |
const char * | name, | ||
const char ** | text | ||
) |
Called at client startup.
Definition at line 771 of file cl_main.cpp.
References CL_ParseActorSkin(), CL_ParseLanguages(), CL_ParseParticle(), CL_ParseSequence(), CL_ParseTipOfTheDay(), GAME_ParseModes(), M_ParseMusic(), Q_streq, SCR_DrawLoadingScreen(), TUT_ParseTutorials(), UI_ParseAndLoadLuaScript(), UI_ParseComponent(), UI_ParseFont(), UI_ParseSprite(), UI_ParseUIModel(), and UI_ParseWindow().
Referenced by Com_ParseScripts(), and TEST_ParseScript().
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 1220 of file cl_main.cpp.
References CIN_Shutdown(), CL_HTTP_Cleanup(), CL_LanguageShutdown(), CL_RContextCvarChange(), CL_RImagesCvarChange(), CL_ShutdownLua(), CLMN_Shutdown(), Con_SaveConsoleHistory(), Cvar_GetFirst(), CVAR_R_CONTEXT, CVAR_R_IMAGES, Cvar_UnRegisterChangeListener(), GAME_SetMode(), GAME_Shutdown(), GAME_UnloadGame(), Irc_Shutdown(), isdown, Key_WriteBindings(), cvar_s::next, R_Shutdown(), S_Shutdown(), SCR_Shutdown(), SEQ_Shutdown(), TOTD_Shutdown(), and UI_Shutdown().
Referenced by Com_Error(), Com_Quit(), Qcommon_Frame(), and Sys_Quit().
Definition at line 1109 of file cl_main.cpp.
References CL_LanguageTryToSet(), CL_Reconnect(), HUD_Update(), Irc_Logic_Frame(), cvar_s::modified, s_language, and cvar_s::string.
Referenced by Qcommon_Init().
Returns the script commandline argument count.
Definition at line 560 of file common.cpp.
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 568 of file common.cpp.
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 308 of file common.cpp.
References Com_Error(), ERR_DROP, MAXPRINTMSG, rd_buffer, and rd_buffersize.
Referenced by SVC_RemoteCommand().
Definition at line 470 of file common.cpp.
References buttons, lengthof, OBJZERO, and Sys_Breakpoint().
Referenced by Sys_Backtrace(), and Sys_Error().
const char* Com_ByteToBinary | ( | byte | x | ) |
Definition at line 1005 of file common.cpp.
Referenced by NET_WriteByte(), NET_WriteChar(), and TEST_F().
bool Com_CheckConfigStringIndex | ( | int | index | ) |
[in] | index | The index of the config string array |
Definition at line 860 of file common.cpp.
References CS_MODELS, CS_POSITIONS, CS_TILES, and MAX_CONFIGSTRINGS.
Referenced by CL_GetConfigString(), CL_SetConfigString(), SV_Configstring(), SV_GetConfigString(), SV_GetConfigStringLength(), and SV_SetConfigString().
Reset com_argv entry to empty string.
[in] | arg | Which argument in com_argv |
Definition at line 580 of file common.cpp.
References com_argc, and com_argv.
Referenced by Cbuf_AddEarlyCommands().
bool Com_ConsoleCompleteCommand | ( | const char * | s, |
char * | target, | ||
size_t | bufSize, | ||
uint32_t * | pos, | ||
uint32_t | 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 717 of file common.cpp.
References Cmd_CompleteCommand(), Cmd_CompleteCommandParameters(), Com_Printf(), Cvar_CompleteVariable(), MAX_QPATH, MAXCMDLINE, Q_strcat(), and Q_strncpyz().
Referenced by Key_Console(), Sys_ConsoleEditProc(), and Sys_ConsoleInput().
Definition at line 465 of file common.cpp.
Referenced by Com_Error(), and GAME_GetImportData().
End the redirection of packets/output.
Definition at line 325 of file common.cpp.
References NET_OOB_Printf(), rd_buffer, rd_buffersize, and SV_CMD_PRINT.
Referenced by SVC_RemoteCommand().
float Com_GrenadeTarget | ( | const vec3_t | from, |
const vec3_t | at, | ||
float | speed, | ||
bool | launched, | ||
bool | 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 231 of file common.cpp.
References DIST_EPSILON, GRAVITY, len, torad, v, VectorLength(), VectorNormalizeFast(), VectorScale, and VectorSubtract.
Referenced by CL_TargetingGrenade(), and SV_InitGameProgs().
const char* Com_MacroExpandString | ( | const char * | text | ) |
Expands strings with cvar values that are dereferenced by a '*cvar'.
Definition at line 607 of file common.cpp.
References Com_Parse(), Com_Printf(), count, Cvar_GetString(), i, len, MACRO_CVAR_ID_LENGTH, MAX_STRING_CHARS, OBJZERO, and Q_strncpyz().
Referenced by Cmd_TokenizeString(), and UI_GetReferenceString().
const char* Com_MD5Buffer | ( | const byte * | buf, |
size_t | len | ||
) |
Compute the md5sum of the given buffer.
[in] | buf | Data to compute the md5 of |
[in] | len | Buffer length in bytes |
Definition at line 300 of file md5.cpp.
References i, MD5Final(), MD5Init(), MD5Update(), and Q_strcat().
Referenced by TEST_F().
const 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 257 of file md5.cpp.
References f, FILE_READ, FS_OpenFile(), FS_Read(), i, MD5Final(), MD5Init(), MD5Update(), and Q_strcat().
Referenced by TEST_F().
Both client and server can use this, and it will do the appropriate things.
Definition at line 511 of file common.cpp.
References CL_Shutdown(), Com_WriteConfigToFile(), qFILE_s::f, FS_CloseFile(), FS_Gamedir(), FS_RemoveFile(), qFILE_s::name, NET_Wait(), SV_Clear(), SV_Shutdown(), Sys_Quit(), and va().
Referenced by CL_Quit_f(), and Qcommon_Init().
Read whatever is in com_pipefile, if anything, and execute it.
Definition at line 1260 of file common.cpp.
References Cmd_ExecuteString(), qFILE_s::f, FS_Read2(), and MAX_STRING_CHARS.
Referenced by SV_Frame().
Check whether we are the server or have a singleplayer tactical mission.
Definition at line 538 of file common.cpp.
References SV_GetServerState().
Referenced by CL_Disconnect(), CL_GridRecalcRouting(), CL_OnBattlescape(), CL_RequestNextDownload(), CL_SendCommand(), Cvar_FixCheatVars(), Cvar_Set2(), GAME_GetImportData(), SV_Configstring(), SV_ExecuteUserCommand(), SV_FindIndex(), and SV_New_f().
Definition at line 815 of file common.cpp.
References Com_Printf(), Cvar_Set(), gametype_s::cvars, csi_s::gts, i, gametype_s::id, cvar_s::integer, cvarlist_s::name, csi_s::numGTs, Q_streq, cvar_s::string, and cvarlist_s::value.
Referenced by GAME_GetImportData(), SV_Frame(), and SV_NextMapcycle().
Definition at line 999 of file common.cpp.
Referenced by Qcommon_Init(), SV_AssemblyThread(), and SV_DoMapAssemble().
Definition at line 547 of file common.cpp.
References Com_DPrintf(), DEBUG_ENGINE, ss_dead, ss_restart, serverInstanceGame_s::state, sv, and SV_Shutdown().
Referenced by SV_Map(), SV_ShutdownGameProgs(), and SV_ShutdownWhenEmpty().
const char* Com_UnsignedIntToBinary | ( | uint32_t | x | ) |
Definition at line 1021 of file common.cpp.
Referenced by SV_AddEvent(), SV_QueueEvent(), and TEST_F().
void Com_UploadCrashDump | ( | const char * | crashDumpFile | ) |
Definition at line 683 of file common.cpp.
References BUILDSTRING_OS, consoleLogName, FS_Gamedir(), HTTP_PutFile(), cvar_s::integer, upparam_s::name, upparam_s::next, Sys_GetCurrentUser(), UFO_VERSION, va(), and upparam_s::value.
Referenced by Sys_Backtrace().
void Com_vPrintf | ( | const char * | fmt, |
va_list | ap | ||
) |
Definition at line 338 of file common.cpp.
References Com_MakeTimestamp(), Con_Print(), consoleLogName, qFILE_s::f, FILE_APPEND, FILE_WRITE, FS_OpenFile(), FS_Write(), cvar_s::integer, MAXPRINTMSG, NET_OOB_Printf(), Q_strcat(), Q_vsnprintf(), rd_buffer, rd_buffersize, SV_CMD_PRINT, and Sys_ConsoleOutput().
void Com_WriteConfigToFile | ( | const char * | filename | ) |
Definition at line 981 of file common.cpp.
References Cmd_WriteAliases(), Com_Printf(), Cvar_WriteVariables(), f, ScopedFile::file(), FILE_WRITE, 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 318 of file cl_console.cpp.
References ColorIndex, CON_COLOR_WHITE, Con_Linefeed(), console_t::currentLine, console_t::initialized, len, console_t::lineWidth, console_t::pos, Q_IsColorString, console_t::text, console_t::totalLines, and UTF8_char_len().
Referenced by Com_vPrintf().
appends lines containing "set variable value" for all variables with the archive flag set to true.
Definition at line 868 of file cvar.cpp.
References CVAR_ARCHIVE, FS_Printf(), qFILE_s::name, and cvar_s::next.
Referenced by Com_WriteConfigToFile().
Definition at line 776 of file cl_keys.cpp.
References battleKeyBindings, Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), CONSOLE_PROMPT_CHAR, i, Key_Bind_f(), Key_Bindlist_f(), Key_CompleteKeyName(), Key_Unbind_f(), Key_Unbindall_f(), Key_WriteBindings_f(), keyBindings, keyDown, keyLinePos, keyLines, MAXKEYLINES, menuKeyBindings, and OBJZERO.
Referenced by Qcommon_Init().
This is the function that is called directly from main()
Definition at line 1493 of file common.cpp.
References CL_FilterEventQueue(), CL_Shutdown(), Dequeue_Event(), Event_FilterAll(), eventQueue, comRestart_t::gamedir, NET_Wait(), Qcommon_Init(), Qcommon_Shutdown(), SV_Shutdown(), and Sys_Milliseconds().
Referenced by main(), SDL_main(), and WinMain().
vPrintfPtr_t Qcommon_GetPrintFunction | ( | void | ) |
Definition at line 1066 of file common.cpp.
References vPrintfPtr.
Init function.
Definition at line 1078 of file common.cpp.
References 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_SetRandomSeed(), Com_SetRenderModified(), Com_SetUserinfoModified(), Com_WriteConfig_f(), CPUSTRING, CVAR_ARCHIVE, Cvar_ForceSet(), Cvar_Get(), Cvar_Init(), CVAR_NOSET, CVAR_SERVERINFO, Cvar_SetCheckFunction(), DOUBLEQUOTE, FS_CreateOpenPipeFile(), FS_ExecAutoexec(), FS_InitFilesystem(), cvar_s::integer, Key_Init(), MASTER_SERVER, Mem_CheckGlobalIntegrity, Mem_CreatePool, Mem_Init(), cvar_s::modified, NET_Init(), OBJZERO, PORT_SERVER, Schedule_Timer(), SCR_EndLoadingPlaque(), cvar_s::string, SV_Frame(), SV_Init(), Swap_Init(), Sys_Error(), Sys_Init(), Sys_InitSignals(), Sys_ShowConsole(), UFO_VERSION, and va().
Referenced by main(), Qcommon_Frame(), SDL_main(), and WinMain().
void Qcommon_SetPrintFunction | ( | vPrintfPtr_t | func | ) |
Definition at line 1537 of file common.cpp.
References Cmd_Shutdown(), Com_Shutdown(), Cvar_Shutdown(), FS_Shutdown(), HTTP_Cleanup(), Mem_Shutdown(), and NET_Shutdown().
Referenced by Com_Error(), Qcommon_Frame(), and Sys_Quit().
ScheduleEventPtr 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. This is needed e.g. for battlescape events to not play events too fast because the beginning of the event queue was blocked. |
Definition at line 1362 of file common.cpp.
References eventQueue, and timer::func.
Referenced by CL_ParseEvent(), Schedule_Timer(), TEST_F(), and tick_timer().
Definition at line 269 of file cl_screen.cpp.
References CL_Milliseconds(), cls, and client_static_s::disableScreen.
Referenced by CL_CanMultiplayerStart(), and SV_Map().
Definition at line 277 of file cl_screen.cpp.
References cls, and client_static_s::disableScreen.
Referenced by CL_Drop(), CL_ViewLoadMedia(), and Qcommon_Init().
Cleanup when the whole game process is shutting down.
Definition at line 1030 of file sv_main.cpp.
References SV_LogShutdown(), and SV_MapcycleClear().
Referenced by Com_Quit().
Definition at line 837 of file sv_main.cpp.
References serverInstanceStatic_s::abandon, serverInstanceGame_s::assembly, Cbuf_AddText(), Com_Printf(), Com_ReadFromPipe(), Com_SetGameType(), serverInstanceGame_s::endgame, serverInstanceStatic_s::gameFrameCond, serverInstanceStatic_s::initialized, cvar_s::integer, serverInstanceStatic_s::killserver, Master_Heartbeat(), cvar_s::modified, serverInstanceGame_s::name, serverInstanceStatic_s::realtime, sv, SV_CheckSpawnSoldiers(), SV_CheckStartMatch(), SV_CheckTimeouts(), sv_dedicated, sv_gametype, SV_LogHandleOutput(), SV_Map(), SV_NextMapcycle(), SV_PingPlayers(), SV_RunGameFrame(), SV_Shutdown(), svs, and Sys_ConsoleInput().
Referenced by Qcommon_Init().
Definition at line 947 of file sv_main.cpp.
References serverInstanceGame_s::mapData, and sv.
Referenced by CL_RequestNextDownload().
mapTiles_t* SV_GetMapTiles | ( | void | ) |
Definition at line 952 of file sv_main.cpp.
References serverInstanceGame_s::mapTiles, and sv.
Referenced by CL_RequestNextDownload().
Only called once at startup, not for each game.
Definition at line 960 of file sv_main.cpp.
References Com_Printf(), CVAR_ARCHIVE, Cvar_Get(), CVAR_LATCH, CVAR_NOSET, CVAR_SERVERINFO, Cvar_SetCheckFunction(), DOUBLEQUOTE, MAX_ACTIVETEAM, Mem_CreatePool, Mem_PoolAllocType, OBJZERO, PROTOCOL_VERSION, sv, SV_CheckMaxSoldiersPerPlayer(), SV_InitOperatorCommands(), SV_LogInit(), SV_MapcycleInit(), and svs.
Referenced by Qcommon_Init(), and TEST_Init().
void SV_Shutdown | ( | const char * | finalmsg, |
bool | 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 1042 of file sv_main.cpp.
References serverInstanceStatic_s::clients, Com_Printf(), CVAR_LATCH, CVAR_NOSET, cvar_s::flags, i, serverInstanceStatic_s::initialized, Master_Shutdown(), Mem_Free, sv_model_s::name, NET_DatagramSocketClose(), serverInstanceStatic_s::netDatagramSocket, serverInstanceGame_s::numSVModels, OBJZERO, serverInstanceStatic_s::serverMutex, sv, SV_FinalMessage(), SV_ShutdownGameProgs(), SV_Stop(), serverInstanceGame_s::svModels, and svs.
Referenced by Com_Error(), Com_Quit(), Com_SetServerState(), GAME_Drop(), GAME_GetImportData(), Qcommon_Frame(), SV_Frame(), SV_KillServer_f(), and TEST_Shutdown().
Will eventually shutdown the server once all clients have disconnected.
Definition at line 1085 of file sv_main.cpp.
References serverInstanceStatic_s::abandon, Com_SetServerState(), ss_dead, and svs.
Referenced by GAME_GetImportData().
memPool_t* com_aliasSysPool |
Definition at line 68 of file common.cpp.
Referenced by Cmd_Alias_f(), Com_RegisterConstInt(), TEST_Init(), and TEST_Shutdown().
memPool_t* com_cmdSysPool |
Definition at line 69 of file common.cpp.
Referenced by Cmd_AddCommand(), Cmd_Shutdown(), Cmd_TokenizeString(), TEST_Init(), and TEST_Shutdown().
memPool_t* com_cmodelSysPool |
Definition at line 70 of file common.cpp.
Referenced by CM_LoadMap(), CM_MakeTracingNodes(), CMod_LoadBrushes(), CMod_LoadBrushSides(), CMod_LoadLeafBrushes(), CMod_LoadLeafs(), CMod_LoadLighting(), CMod_LoadNodes(), CMod_LoadPlanes(), CMod_LoadSubmodels(), CMod_LoadSurfaces(), TEST_Init(), and TEST_Shutdown().
memPool_t* com_cvarSysPool |
Definition at line 71 of file common.cpp.
Referenced by Cvar_FixCheatVars(), Cvar_FullSet(), Cvar_Get(), Cvar_GetChangeListener(), Cvar_Set2(), TEST_Init(), and TEST_Shutdown().
memPool_t* com_fileSysPool |
Definition at line 72 of file common.cpp.
memPool_t* com_genericPool |
Definition at line 73 of file common.cpp.
memPool_t* com_networkPool |
Definition at line 74 of file common.cpp.
Referenced by NET_DatagramSend(), NET_DatagramSocketDoNew(), NET_StreamNew(), FootStepTest::SetUpTestCase(), MapDefStatsTest::SetUpTestCase(), MapDefMassRMATest::SetUpTestCase(), MapDefTest::SetUpTestCase(), and GameTest::SetUpTestCase().
cvar_t* developer |
Definition at line 46 of file common.cpp.
cvar_t* http_proxy |
Definition at line 47 of file common.cpp.
Referenced by CL_StartHTTPDownload(), HTTP_GetURLInternal(), and TEST_Init().
cvar_t* http_timeout |
Definition at line 48 of file common.cpp.
Referenced by CL_StartHTTPDownload(), HTTP_GetURLInternal(), HTTP_PutFile(), and TEST_Init().
cvar_t* hwclass |
Definition at line 62 of file common.cpp.
Referenced by Com_ParseMapDefinition(), and TEST_Init().
cvar_t* masterserver_url |
Definition at line 57 of file common.cpp.
Referenced by CL_InitLocal(), CL_QueryMasterServer(), Irc_Client_Invite_f(), Master_HeartbeatThread(), Master_Shutdown(), FootStepTest::SetUpTestCase(), MapDefStatsTest::SetUpTestCase(), MapDefMassRMATest::SetUpTestCase(), MapDefTest::SetUpTestCase(), GameTest::SetUpTestCase(), and SV_SetMaster_f().
cvar_t* port |
Definition at line 58 of file common.cpp.
Referenced by GAME_MP_Rcon(), GAME_MP_ServerInfo_f(), HTTP_ResolvURL(), Irc_Client_CmdPrivmsg(), Irc_GetExternalIP(), Master_HeartbeatThread(), Master_Shutdown(), FootStepTest::SetUpTestCase(), MapDefStatsTest::SetUpTestCase(), MapDefMassRMATest::SetUpTestCase(), MapDefTest::SetUpTestCase(), GameTest::SetUpTestCase(), SV_InitGame(), SV_SetMaster_f(), and TEST_F().
cvar_t* sv_dedicated |
Definition at line 51 of file common.cpp.
cvar_t* sv_gametype |
Definition at line 56 of file common.cpp.
Referenced by SV_Frame(), SV_NextMapcycle(), and SVC_Info().
cvar_t* sv_maxclients |
Definition at line 43 of file g_main.cpp.
Referenced by CL_InitLocal(), RandomMapAssemblyTest::SetUpTestCase(), GameTest::SetUpTestCase(), SP_worldspawn(), SV_InitGame(), SV_ParseAssembly(), and SV_SetMaster_f().
cvar_t* sys_affinity |
Definition at line 60 of file common.cpp.
Referenced by CL_Frame(), and Sys_Init().
cvar_t* sys_os |
Definition at line 61 of file common.cpp.
Referenced by Sys_Init().
cvar_t* sys_priority |
Definition at line 59 of file common.cpp.
Referenced by CL_Frame(), and Sys_Init().