43static 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");
88 svs.serverMutex = SDL_CreateMutex();
113void SV_Map (
bool day,
const char* levelstring,
const char* assembly,
bool verbose)
116 unsigned checksum = 0;
128 if (!
svs.initialized) {
153 sv->assembly[0] =
'\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);
187 CM_LoadMap(tileString, day, posString, entityString, &
sv->mapData, &
sv->mapTiles);
189 Com_Printf(
"checksum for the map '%s': %u\n", levelstring,
sv->mapData.mapChecksum);
194 Com_Printf(
"ufo script checksum %u\n", checksum);
209 for (
i = 1;
i <=
sv->mapData.numInline;
i++)
224 Com_Printf(
"-------------------------------------\n");
void SCR_BeginLoadingPlaque(void)
void Cbuf_CopyToDefer(void)
Defers any outstanding commands.
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.
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 Com_SetServerState(int state)
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
void Com_Printf(const char *const fmt,...)
cvar_t * Cvar_FullSet(const char *varName, const char *value, int flags)
Sets a cvar from console with the given flags.
const char * Cvar_GetString(const char *varName)
Returns the value of cvar as string.
void Cvar_UpdateLatchedVars(void)
Any variables with latched values will now be updated.
void Sys_Error(const char *error,...)
#define Mem_PoolAllocTypeN(type, n, pool)
struct datagram_socket * NET_DatagramSocketNew(const char *node, const char *service, datagram_callback_func *func)
Opens a datagram socket (UDP).
bool SV_Start(const char *node, const char *service, stream_callback_func *func)
void NET_DatagramSend(struct datagram_socket *s, const char *buf, int len, struct sockaddr *to)
Shared parsing functions.
QGL_EXTERN GLuint GLchar GLuint * len
int Com_GetScriptChecksum(void)
Main server include file.
memPool_t * sv_genericPool
char * SV_GetConfigString(int index)
void SV_ClearWorld(void)
Clear physics interaction links.
void SV_Heartbeat_f(void)
void SV_ReadPacket(struct net_stream *s)
void SV_InitGameProgs(void)
Init the game subsystem for a new map.
int SV_GetConfigStringInteger(int index)
void SV_SetMaster_f(void)
Add the server to the master server list so that others can see the server in the server list.
serverInstanceGame_t * sv
void SV_SetClientState(client_t *client, client_state_t state)
Set the client state.
#define SV_SetConfigString(index, value)
client_t * SV_GetNextClient(client_t *lastClient)
Iterates through clients.
serverInstanceStatic_t svs
#define Q_strvalid(string)
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
char const * Q_strstart(char const *str, char const *start)
Matches the start of a string.
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 that is only valid for one map. It's deleted on every map load.
static void SV_InitGame(void)
A brand new game has been started.
static void SV_DiscoveryCallback(struct datagram_socket *s, const char *buf, int len, struct sockaddr *from)
static const char * SV_GetMapTitle(const char *asmTitle, const char *const mapname)
Get the map title for a given 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.
int SV_AssembleMapAndTitle(const char *mapTheme, const char *assembly, char *asmTiles, char *asmPos, char *entityString, const unsigned int seed, bool print, char *asmTitle)