42#ifndef HARD_LINKED_GAME
153 gi.DPrintf(
"==== InitGame ====\n");
162 developer =
gi.Cvar_Get(
"developer",
"0", 0,
"Print out a lot of developer debug messages - useful to track down bugs");
184 sv_ai =
gi.Cvar_Get(
"sv_ai",
"1", 0,
"Activate or deativate the ai");
187 sv_maxclients =
gi.Cvar_Get(
"sv_maxclients",
"1",
CVAR_SERVERINFO,
"If sv_maxclients is 1 we are in singleplayer - otherwise we are mutliplayer mode (see sv_teamplay)");
188 sv_shot_origin =
gi.Cvar_Get(
"sv_shot_origin",
"8", 0,
"Assumed distance of muzzle from model");
192 ai_alienteam =
gi.Cvar_Get(
"ai_alienteam",
"ortnok", 0,
"Alien team");
195 ai_equipment =
gi.Cvar_Get(
"ai_equipment",
"multiplayer_alien", 0,
"Initial equipment definition for aliens");
197 ai_singleplayeraliens =
gi.Cvar_Get(
"ai_singleplayeraliens",
"30", 0,
"How many aliens in this battle (singleplayer)");
199 ai_numcivilians =
gi.Cvar_Get(
"ai_numcivilians",
"10", 0,
"How many civilians in this battle");
233 g_ailua =
gi.Cvar_Get(
"g_ailua",
"0", 0,
"Activate or deactivate the LUA AI");
244 flood_msgs =
gi.Cvar_Get(
"flood_msgs",
"4", 0,
nullptr);
246 flood_waitdelay =
gi.Cvar_Get(
"flood_waitdelay",
"10", 0,
"Delay until someone is unlocked from talking again");
263 globals.maxplayersperteam =
game.sv_maxplayersperteam;
284 gi.DPrintf(
"==== ShutdownGame ====\n");
296 Com_Printf(
"Used inventory slots in game on shutdown: %i\n",
game.invi.GetUsedSlots());
308 gi.Cvar_Set(
"sv_needpass",
"%i", need);
355 gi.DPrintf(
"The minimum value for sv_roundtimelimit is 30\n");
356 gi.Cvar_Set(
"sv_roundtimelimit",
"30");
419#ifndef HARD_LINKED_GAME
426 va_start(argptr, error);
430 gi.Error(
"%s", text);
438 va_start(argptr, msg);
442 gi.DPrintf(
"%s", text);
457 va_start(argptr, msg);
461 gi.DPrintf(
"%s", text);
static const int TAG_INVENTORY
static const inventoryImport_t inventoryImport
void AI_Run(void)
Every server frame one single actor is handled - always in the same order.
Artificial Intelligence functions.
void G_ClientUserinfoChanged(Player &player, const char *userinfo)
called whenever the player updates a userinfo variable.
int G_GetActiveTeam(void)
Returns the current active team to the server.
bool G_ClientIsReady(const Player *player)
void G_ClientDisconnect(Player &player)
bool G_ClientBegin(Player &player)
This functions starts the client.
int G_ClientGetTeamNum(const Player &player)
Returns the assigned team number of the player.
int G_ClientAction(Player &player)
The client sent us a message that he did something. We now execute the related function(s) and notify...
bool G_ClientConnect(Player *player, char *userinfo, size_t userinfoSize)
Checks whether the connection is valid or invalid and set some user info keys.
void G_ClientStartMatch(Player &player)
Sets the team, init the TU and sends the player stats.
void G_ClientInitActorStates(const Player &player)
This is called after the actors are spawned and will set actor states without consuming TUs.
void G_ClientTeamInfo(const Player &player)
The client lets the server spawn the actors for a given player by sending their information (models,...
Interface for g_client.cpp.
void G_ClientCommand(Player &player)
Edict * G_EdictsGetFirst(void)
Returns the first entity.
Edict * G_EdictsConstruct(void)
Allocate space for the entity pointers.
Edict * G_EdictsGetNextInUse(Edict *lastEnt)
Iterate through the entities that are in use.
void G_EdictsThink(void)
Called every frame to let the edicts tick.
functions to handle the storage and lifecycle of all edicts in the game module.
void G_EventSendEdict(const Edict &ent)
Send the bounding box info to the client.
Local definitions for game module.
cvar_t * ai_singleplayeraliens
#define SERVER_FRAME_SECONDS
cvar_t * sv_maxplayersperteam
void G_ServerCommand(void)
ServerCommand will be called when an "sv" command is issued. The game can issue gi....
#define G_TagMalloc(size, tag)
#define G_IsMultiPlayer()
void G_ClientEndRound(Player &player)
cvar_t * sv_maxsoldiersperplayer
cvar_t * ai_multiplayeraliens
cvar_t * sv_roundtimelimit
cvar_t * sv_maxsoldiersperteam
cvar_t * mor_regeneration
void G_CheckForceEndRound(void)
Check whether a forced turn end should be executed.
static void G_Init(void)
This will be called when the game library is first loaded.
void Sys_Error(const char *error,...)
game_export_t * GetGameAPI(game_import_t *import)
Returns a pointer to the structure with all entry points and global variables.
static cvar_t * sv_send_edicts
static void G_SendBoundingBoxes(void)
static void * G_AllocInventoryMemory(size_t size)
static void G_Shutdown(void)
Free the tags TAG_LEVEL and TAG_GAME.
static void G_FreeAllInventory(void)
static void G_FreeInventory(void *data)
static cvar_t * sv_cheats
void Com_Printf(const char *msg,...)
static void CheckNeedPass(void)
If password has changed, update sv_needpass cvar as needed.
void Com_DPrintf(int level, const char *msg,...)
static bool G_RunFrame(void)
bool G_MatchIsRunning(void)
Checks whether the game is running (active team and no intermission time).
bool G_MatchDoEnd(void)
Checks whether a match is over.
void G_SpawnEntities(const char *mapname, bool day, const char *entities)
Creates a server's entity / program execution context by parsing textual entity definitions out of an...
Brings new objects into the world.
void G_CompleteRecalcRouting(void)
const char * G_GetPlayerName(int pnum)
Returns the player name for a give player number.
Misc utility functions for game module.
void INVSH_InitCSI(const csi_t *import)
Initializes client server shared data pointer. This works because the client and the server are both ...
QGL_EXTERN GLsizei const GLvoid * data
#define Q_strvalid(string)
#define Q_strcasecmp(a, b)
int Q_vsnprintf(char *str, size_t size, const char *format, va_list ap)
Safe (null terminating) vsnprintf implementation.
const char * va(const char *format,...)
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functi...
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
functions exported by the game subsystem
functions provided by the main engine
this structure is left intact through an entire game it should be initialized at game library load ti...
this structure is cleared as each map is entered