35#include <SDL_thread.h>
39typedef struct sv_edict_s {
47typedef struct sv_model_s {
57typedef struct worldSector_s {
66typedef struct pending_event_s {
76typedef struct serverInstanceStatic_s {
89#ifndef HARD_LINKED_GAME
95typedef enum server_state_e {
106typedef struct serverInstanceGame_s {
137#define PLAYER_NUM(n) ((player_t*)((byte*)svs.ge->players + svs.ge->player_size * (n)))
155typedef struct client_s {
188#define SV_SetConfigString(index, value) SV_SetConfigString(index, value)
198void SV_Map(
bool day,
const char* levelstring,
const char* assembly,
bool verbose =
true);
212bool SV_CheckMap(const
char* map, const
char* assembly);
definitions common between client and server, but not game lib
Interface to game library.
#define MAX_CONFIGSTRINGS
void format(__printf__, 1, 2)))
QGL_EXTERN GLsizei const GLvoid * data
memPool_t * sv_genericPool
void SV_MapcycleClear(void)
Empty the mapcycle list.
char * SV_GetConfigString(int index)
cvar_t * sv_rmadisplaythemap
display a character graphic of the tiles placed when RMA2 reaches a dead end.
const char * SV_GetFootstepSound(const char *texture)
Query the footstep sound for the given surface texture.
trace_t SV_Trace(const Line &traceLine, const AABB &box, const edict_t *passedict, int contentmask)
Moves the given mins/maxs volume through the world from start to end.
void SV_ClearWorld(void)
Clear physics interaction links.
void SV_SetServerState(server_state_t)
client_t * SV_GetClient(int index)
void SV_Map(bool day, const char *levelstring, const char *assembly, bool verbose=true)
Change the server to a new map, taking all connected clients along with it.
void SV_Heartbeat_f(void)
bool SV_CheckMap(const char *map, const char *assembly)
Checks whether a map exists.
void SV_LinkEdict(edict_t *ent)
Needs to be called any time an entity changes origin, mins, maxs, or solid. Automatically unlinks if ...
void SV_MapcycleInit(void)
server_state_t SV_GetServerState(void)
void SV_ShutdownGameProgs(void)
Called when either the entire server is being killed, or it is changing to a different game directory...
void SV_ReadPacket(struct net_stream *s)
void SV_InitOperatorCommands(void)
void SV_InitGameProgs(void)
Init the game subsystem for a new map.
void SV_Multicast(int mask, const dbuffer &msg)
Sends the contents of msg to a subset of the clients, then frees msg.
int SV_GetConfigStringLength(int index)
void void SV_ClientPrintf(client_t *cl, int level, const char *fmt,...) __attribute__((format(__printf__
float SV_GetBounceFraction(const char *texture)
Different terrain types might have different bounce fraction.
int SV_GetConfigStringInteger(int index)
void SV_NextMapcycle(void)
Start the next map in the cycle.
void SV_SetMaster_f(void)
Add the server to the master server list so that others can see the server in the server list.
void SV_RunGameFrame(void)
Calls the G_RunFrame function from game api let everything in the world think and move.
bool SV_LoadModelAABB(const char *model, int frame, AABB &aabb)
Load the bounding box for the model on the serverside for pathfinding and clipping.
serverInstanceGame_t * sv
void SV_SetClientState(client_t *client, client_state_t state)
Set the client state.
void void void SV_BroadcastPrintf(int level, const char *fmt,...) __attribute__((format(__printf__
#define SV_SetConfigString(index, value)
int SV_CountPlayers(void)
Returns the number of spawned players.
void SV_UnlinkEdict(edict_t *ent)
call before removing an entity, and before trying to move one, so it doesn't clip against itself
client_t * SV_GetNextClient(client_t *lastClient)
Iterates through clients.
serverInstanceStatic_t svs
void SV_ClientCommand(client_t *client, const char *fmt,...) __attribute__((format(__printf__
void SV_DropClient(client_t *drop, const char *message)
Called when the player is totally leaving the server, either willingly or unwillingly....
void void void void SV_ExecuteClientMessage(client_t *cl, int cmd, dbuffer *msg)
The current net_message is parsed for the given client.
int SV_RunGameFrameThread(void *data)
Thread for the game frame function.
int SV_PointContents(const vec3_t p)
Returns the content flags for a given point.
void SV_UserinfoChanged(client_t *cl)
Pull specific info from a newly changed userinfo string into a more C friendly form.
cvar_t * sv_dumpmapassembly
char userinfo[MAX_INFO_STRING]
struct net_stream * stream
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
functions exported by the game subsystem
Struct that is only valid for one map. It's deleted on every map load.
worldSector_t worldSectors[AREA_NODES]
sv_model_t svModels[MAX_MOD_KNOWN]
pending_event_t pendingEvent
struct cBspModel_s * models[MAX_MODELS]
char configstrings[MAX_CONFIGSTRINGS][MAX_TOKEN_CHARS]
sv_edict_t edicts[MAX_EDICTS]
pending_event_t eventQueue[64]
unsigned int numWorldSectors
struct client_s * clients
struct datagram_socket * netDatagramSocket
struct worldSector_s * worldSector
struct sv_edict_s * nextEntityInWorldSector
static mesh models (none-animated) can have a server side flag set to be clipped for pathfinding
To avoid linearly searching through lists of entities during environment testing, the world is carved...
struct worldSector_s * children[2]