32 #include "../shared/parse.h"
33 #include "../shared/scopedmutex.h"
43 static const char*
SV_GetMapTitle (
const char* asmTitle,
const char*
const mapname)
47 if (mapname[0] ==
'+') {
48 if (asmTitle && asmTitle[0]) {
50 if (asmTitle[0] ==
'_')
53 Com_Printf(
"The assembly title '%s' is not marked as translatable\n", asmTitle);
66 const char match[] =
"discover";
67 if (len ==
sizeof(match) && memcmp(buf, match, len) == 0) {
68 const char msg[] =
"discovered";
85 Sys_Error(
"There is still a server running");
113 void SV_Map (
bool day,
const char* levelstring,
const char* assembly,
bool verbose)
116 unsigned checksum = 0;
166 if (levelstring[0] ==
'+') {
169 Com_Printf(
"Map info - map name: %s\n", levelstring);
170 Com_Printf(
"Map info - assembly name: %s\n", assembly);
172 numPlaced =
SV_AssembleMapAndTitle(levelstring + 1, assembly, tileString, posString, entityString, 0, verbose, asmTitle);
174 Com_Printf(
"Could not load assembly for map '%s'\n", levelstring);
183 Com_Printf(
"Map info - map name: %s\n", levelstring);
194 Com_Printf(
"ufo script checksum %u\n", checksum);
224 Com_Printf(
"-------------------------------------\n");
void Sys_Error(const char *error,...)
char * SV_GetConfigString(int index)
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...
struct datagram_socket * NET_DatagramSocketNew(const char *node, const char *service, datagram_callback_func *func)
Opens a datagram socket (UDP)
serverInstanceStatic_t svs
bool SV_Start(const char *node, const char *service, stream_callback_func *func)
static const char * SV_GetMapTitle(const char *asmTitle, const char *const mapname)
Get the map title for a given map.
memPool_t * sv_genericPool
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 Cvar_UpdateLatchedVars(void)
Any variables with latched values will now be updated.
client_t * SV_GetNextClient(client_t *lastClient)
Iterates through clients.
void Com_Printf(const char *const fmt,...)
struct cBspModel_s * models[MAX_MODELS]
void SV_SetClientState(client_t *client, client_state_t state)
Set the client state.
void Com_SetServerState(int state)
static void SV_InitGame(void)
A brand new game has been started.
#define Q_strvalid(string)
int Com_GetScriptChecksum(void)
void NET_DatagramSend(struct datagram_socket *s, const char *buf, int len, struct sockaddr *to)
Struct that is only valid for one map. It's deleted on every map load.
#define SV_SetConfigString(index, value)
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
Main server include file.
char const * Q_strstart(char const *str, char const *start)
Matches the start of a string.
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
cBspModel_t * CM_InlineModel(const mapTiles_t *mapTiles, const char *name)
Searches all inline models and return the cBspModel_t pointer for the given modelnumber or -name...
void Cbuf_CopyToDefer(void)
Defers any outstanding commands.
cvar_t * Cvar_FullSet(const char *varName, const char *value, int flags)
Sets a cvar from console with the given flags.
void SV_ClearWorld(void)
Clear physics interaction links.
#define Mem_PoolAllocTypeN(type, n, pool)
void SV_Heartbeat_f(void)
void SCR_BeginLoadingPlaque(void)
int SV_AssembleMapAndTitle(const char *mapTheme, const char *assembly, char *asmTiles, char *asmPos, char *entityString, const unsigned int seed, bool print, char *asmTitle)
QGL_EXTERN GLuint GLchar GLuint * len
struct client_s * clients
void SV_InitGameProgs(void)
Init the game subsystem for a new map.
void SV_Map(bool day, const char *levelstring, const char *assembly, bool verbose)
Change the server to a new map, taking all connected clients along with it.
static void SV_DiscoveryCallback(struct datagram_socket *s, const char *buf, int len, struct sockaddr *from)
char mapEntityString[MAX_MAP_ENTSTRING]
serverInstanceGame_t * sv
const char * Cvar_GetString(const char *varName)
Returns the value of cvar as string.
void SV_ReadPacket(struct net_stream *s)
void CM_LoadMap(const char *tiles, bool day, const char *pos, const char *entityString, mapData_t *mapData, mapTiles_t *mapTiles)
Loads in the map and all submodels.
int SV_GetConfigStringInteger(int index)
struct datagram_socket * netDatagramSocket