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");
195 ai_equipment =
gi.
Cvar_Get(
"ai_equipment",
"multiplayer_alien", 0,
"Initial equipment definition for aliens");
284 gi.DPrintf(
"==== ShutdownGame ====\n");
355 gi.DPrintf(
"The minimum value for sv_roundtimelimit is 30\n");
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);
int GetUsedSlots()
Calculate the number of used inventory slots.
void initInventory(const char *name, const csi_t *csi, const inventoryImport_t *import)
Initializes the inventory definition by linking the ->next pointers properly.
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.
#define SERVER_FRAME_SECONDS
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)
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.
cvar_t * ai_singleplayeraliens
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.
cvar_t * sv_maxplayersperteam
static const int TAG_INVENTORY
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)
cvar_t * sv_maxsoldiersperplayer
static cvar_t * sv_cheats
cvar_t * ai_multiplayeraliens
cvar_t * sv_roundtimelimit
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,...)
cvar_t * sv_maxsoldiersperteam
cvar_t * mor_regeneration
static bool G_RunFrame(void)
static const inventoryImport_t inventoryImport
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
const char *EXPORT * ClientGetName(int pnum)
functions provided by the main engine
cvar_t *IMPORT * Cvar_Set(const char *varName, const char *value,...) __attribute__((format(__printf__
cvar_t *IMPORT * Cvar_Get(const char *varName, const char *value, int flags, const char *desc)
FILE *IMPORT * Sys_Fopen(const char *filename, const char *mode)
const char *IMPORT * FS_Gamedir(void)
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