UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
sv_ccmds.cpp
Go to the documentation of this file.
1 
8 /*
9 All original material Copyright (C) 2002-2020 UFO: Alien Invasion.
10 
11 Original file from Quake 2 v3.21: quake2-2.31/server/sv_ccmds.c
12 Copyright (C) 1997-2001 Id Software, Inc.
13 
14 This program is free software; you can redistribute it and/or
15 modify it under the terms of the GNU General Public License
16 as published by the Free Software Foundation; either version 2
17 of the License, or (at your option) any later version.
18 
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 
23 See the GNU General Public License for more details.
24 
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, write to the Free Software
27 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 
29 */
30 
31 #include "server.h"
32 #include "../common/http.h"
33 #include "../shared/scopedmutex.h"
34 
35 void SV_Heartbeat_f (void)
36 {
37  /* heartbeats will always be sent to the ufo master */
38  svs.lastHeartbeat = -9999999; /* send immediately */
39 }
40 
45 void SV_SetMaster_f (void)
46 {
47  if (sv_maxclients->integer == 1)
48  return;
49 
50  /* make sure the server is listed public */
51  Cvar_Set("public", "1");
52 
53  Com_Printf("Master server at [%s] - sending a ping\n", masterserver_url->string);
54  HTTP_GetURL(va("%s/ufo/masterserver.php?ping&port=%s", masterserver_url->string, port->string), nullptr);
55 
56  if (!sv_dedicated->integer)
57  return;
58 
59  /* only dedicated servers are sending heartbeats */
61 }
62 
68 static client_t* SV_GetPlayerClientStructure (const char* s)
69 {
70  /* numeric values are just slot numbers */
71  if (s[0] >= '0' && s[0] <= '9') {
72  int idnum = atoi(Cmd_Argv(1));
73  client_t* cl = nullptr;
74  /* check for a name match */
75  while ((cl = SV_GetNextClient(cl)) != nullptr && idnum > 0)
76  idnum--;
77  if (cl->state == cs_free) {
78  Com_Printf("Client %i is not active\n", idnum);
79  return nullptr;
80  }
81  return cl;
82  } else {
83  client_t* cl = nullptr;
84  /* check for a name match */
85  while ((cl = SV_GetNextClient(cl)) != nullptr) {
86  if (cl->state == cs_free)
87  continue;
88  if (Q_streq(cl->name, s)) {
89  return cl;
90  }
91  }
92  }
93 
94  Com_Printf("Userid %s is not on the server\n", s);
95  return nullptr;
96 }
97 
101 bool SV_CheckMap (const char* map, const char* assembly)
102 {
103  char expanded[MAX_QPATH];
104 
105  /* base attacks starts with . and random maps with + */
106  if (map[0] == '+') {
107  Com_sprintf(expanded, sizeof(expanded), "maps/%s.ump", map + 1);
108 
109  /* check for ump file */
110  if (FS_CheckFile("%s", expanded) < 0) {
111  Com_Printf("Can't find %s\n", expanded);
112  return false;
113  }
114  } else if (!assembly) {
115  Com_sprintf(expanded, sizeof(expanded), "maps/%s.bsp", map);
116 
117  /* check for bsp file */
118  if (FS_CheckFile("%s", expanded) < 0) {
119  Com_Printf("Can't find %s\n", expanded);
120  return false;
121  }
122  }
123  return true;
124 }
125 
131 static void SV_Map_f (void)
132 {
133  if (Cmd_Argc() < 3) {
134  Com_Printf("Usage: %s <day|night> <mapname> [<assembly>]\n", Cmd_Argv(0));
135  Com_Printf("Use 'maplist' to get a list of all installed maps\n");
136  return;
137  }
138 
139  if (Q_streq(Cmd_Argv(0), "devmap")) {
140  Com_Printf("deactivate ai - make sure to reset sv_ai after maptesting\n");
141  Cvar_SetValue("sv_ai", 0);
142  Cvar_SetValue("sv_cheats", 1);
143  Cvar_SetValue("sv_send_edicts", 1);
144  Cvar_SetValue("g_notu", 1);
145  Cvar_SetValue("g_nospawn", 1);
146  } else {
147  Cvar_SetValue("sv_ai", 1);
148  Cvar_SetValue("sv_send_edicts", 0);
149  Cvar_SetValue("g_notu", 0);
150  Cvar_SetValue("g_nospawn", 0);
151  }
152 
153  bool day;
154  if (Q_streq(Cmd_Argv(1), "day")) {
155  day = true;
156  } else if (Q_streq(Cmd_Argv(1), "night")) {
157  day = false;
158  } else {
159  Com_Printf("Invalid lightmap parameter - use day or night\n");
160  return;
161  }
162 
163  /* we copy them to buffers because the command pointers might be invalid soon */
164  /* the buffers must be as big as the CS_TILES/CS_POSITONS config strings, because the base assembly
165  * gives the full resolved rma assembly string */
166  char bufMap[MAX_TOKEN_CHARS * MAX_TILESTRINGS];
167  const char* assembly = nullptr;
168  char bufAssembly[MAX_TOKEN_CHARS * MAX_TILESTRINGS] = "";
169  Q_strncpyz(bufMap, Cmd_Argv(2), sizeof(bufMap));
170  /* assembled maps uses position strings */
171  if (Cmd_Argc() == 4) {
172  Q_strncpyz(bufAssembly, Cmd_Argv(3), sizeof(bufAssembly));
173  assembly = bufAssembly;
174  }
175 
176  /* check to make sure the level exists */
177  if (!SV_CheckMap(bufMap, assembly))
178  return;
179 
180  /* start up the next map */
181  SV_Map(day, bufMap, assembly);
182 }
183 
187 static void SV_Kick_f (void)
188 {
189  client_t* cl;
190 
191  if (!svs.initialized) {
192  Com_Printf("No server running.\n");
193  return;
194  }
195 
196  if (Cmd_Argc() != 2) {
197  Com_Printf("Usage: %s <userid>\n", Cmd_Argv(0));
198  return;
199  }
200 
202  if (cl == nullptr)
203  return;
204 
205  SV_BroadcastPrintf(PRINT_CONSOLE, "%s was kicked\n", cl->name);
206  /* print directly, because the dropped client won't get the
207  * SV_BroadcastPrintf message */
208  SV_DropClient(cl, "You were kicked from the game\n");
209 }
210 
215 static void SV_StartGame_f (void)
216 {
217  client_t* cl = nullptr;
218  int cnt = 0;
219  while ((cl = SV_GetNextClient(cl)) != nullptr) {
220  if (cl->state != cs_free) {
221  cl->player->setReady(true);
222  cnt++;
223  }
224  }
225  Cvar_ForceSet("sv_maxclients", va("%i", cnt));
226 }
227 
232 static void SV_Status_f (void)
233 {
234  int i;
235  client_t* cl;
236  const char* s;
237  char buf[256];
238 
239  if (!svs.clients) {
240  Com_Printf("No server running.\n");
241  return;
242  }
243  Com_Printf("map : %s (%s)\n", sv->name, (SV_GetConfigStringInteger(CS_LIGHTMAP) ? "day" : "night"));
244  Com_Printf("active team : %i\n", svs.ge->ClientGetActiveTeam());
245 
246  Com_Printf("num status name timeout ready address \n");
247  Com_Printf("--- ------- --------------- -------------- ----- ---------------------\n");
248 
249  cl = nullptr;
250  i = 0;
251  while ((cl = SV_GetNextClient(cl)) != nullptr) {
252  char state_buf[16];
253  char const* state;
254 
255  i++;
256 
257  if (cl->state == cs_free)
258  continue;
259 
260  switch (cl->state) {
261  case cs_connected:
262  state = "CONNECT"; break;
263  case cs_spawning:
264  state = "SPAWNIN"; break;
265  case cs_began:
266  state = "BEGAN "; break;
267  case cs_spawned:
268  state = "SPAWNED"; break;
269 
270  default:
271  sprintf(state_buf, "%7i", cl->state);
272  state = state_buf;
273  break;
274  }
275 
276  s = NET_StreamPeerToName(cl->stream, buf, sizeof(buf), false);
277  Com_Printf("%3i %s %-15s %14i %-5s %-21s\n", i, state, cl->name, cl->lastmessage,
278  cl->player->isReady() ? "true" : "false", s);
279  }
280  Com_Printf("\n");
281 }
282 
283 #ifdef DEDICATED_ONLY
284 
287 static void SV_ConSay_f (void)
288 {
289  const char* p;
290  char text[1024];
291 
292  if (Cmd_Argc() < 2)
293  return;
294 
295  if (!Com_ServerState()) {
296  Com_Printf("no server is running\n");
297  return;
298  }
299 
300  Q_strncpyz(text, "serverconsole: ", sizeof(text));
301  p = Cmd_Args();
302 
303  if (*p == '"')
304  p++;
305 
306  Q_strcat(text, sizeof(text), "%s", p);
307  if (text[strlen(text)] == '"')
308  text[strlen(text)] = 0;
309  SV_BroadcastPrintf(PRINT_CHAT, "%s\n", text);
310 }
311 #endif
312 
316 static void SV_Serverinfo_f (void)
317 {
318  Com_Printf("Server info settings:\n");
319  char info[MAX_INFO_STRING];
320  Info_Print(Cvar_Serverinfo(info, sizeof(info)));
321 }
322 
323 
328 static void SV_UserInfo_f (void)
329 {
330  client_t* cl;
331 
332  if (!svs.initialized) {
333  Com_Printf("No server running.\n");
334  return;
335  }
336 
337  if (Cmd_Argc() != 2) {
338  Com_Printf("Usage: %s <userid>\n", Cmd_Argv(0));
339  return;
340  }
341 
343  if (cl == nullptr)
344  return;
345 
346  Com_Printf("userinfo\n");
347  Com_Printf("--------\n");
348  Info_Print(cl->userinfo);
349 }
350 
354 static void SV_KillServer_f (void)
355 {
356  if (!svs.initialized)
357  return;
358  SV_Shutdown("Server was killed.", false);
359 }
360 
364 static void SV_ServerCommand_f (void)
365 {
366  if (!svs.ge) {
367  Com_Printf("No game loaded.\n");
368  return;
369  }
370 
371  if (Cmd_Argc() < 2) {
372  Com_Printf("Usage: %s <command> <parameter>\n", Cmd_Argv(0));
373  return;
374  }
375 
376  Com_DPrintf(DEBUG_SERVER, "Execute game command '%s'\n", Cmd_Args());
377 
378  const ScopedMutex scopedMutex(svs.serverMutex);
379  svs.ge->ServerCommand();
380 }
381 
382 /*=========================================================== */
383 
390 static int SV_CompleteMapCommand (const char* partial, const char** match)
391 {
392  const char* dayNightStr = nullptr;
393  static char dayNightMatch[7];
394 
395  if (partial[0])
396  dayNightStr = strstr(partial, " ");
397  if (!dayNightStr) {
398  if (partial[0] == 'd') {
399  Q_strncpyz(dayNightMatch, "day ", sizeof(dayNightMatch));
400  *match = dayNightMatch;
401  return 1;
402  } else if (partial[0] == 'n') {
403  Q_strncpyz(dayNightMatch, "night ", sizeof(dayNightMatch));
404  *match = dayNightMatch;
405  return 1;
406  }
407  /* neither day or night, delete previous content and display options */
408  Com_Printf("day\nnight\n");
409  dayNightMatch[0] = '\0';
410  *match = dayNightMatch;
411  return 2;
412  } else {
413  if (!Q_strncasecmp(partial, "day ", 4) || !Q_strncasecmp(partial, "night ", 6)) {
414  /* dayNightStr is correct, use it */
415  partial = dayNightStr + 1;
416  } else {
417  /* neither day or night, delete previous content and display options */
418  Com_Printf("day\nnight\n");
419  dayNightMatch[0] = '\0';
420  *match = dayNightMatch;
421  return 2;
422  }
423  }
424 
425  FS_GetMaps(false);
426 
427  int n = 0;
428  const char* const* endOfMaps = fs_maps + fs_numInstalledMaps + 1; /* bug: fs_numInstalledMaps is off by one */
429  for (const char* const* mapName = fs_maps; mapName < endOfMaps; mapName++) {
430  if (Cmd_GenericCompleteFunction(*mapName, partial, match)) {
431  Com_Printf("%s\n", *mapName);
432  ++n;
433  }
434  }
435  return n;
436 }
437 
442 static void SV_ListMaps_f (void)
443 {
444  FS_GetMaps(true);
445 
446  for (int i = 0; i <= fs_numInstalledMaps; i++)
447  Com_Printf("%s\n", fs_maps[i]);
448  Com_Printf("-----\n %i installed maps\n+name means random map assembly\n", fs_numInstalledMaps + 1);
449 }
450 
456  char const* name;
457  char const* description;
458 };
459 
461  { "startgame", "Force the gamestart - useful for multiplayer games" },
462  { "addip", "The ip address is specified in dot format, and any unspecified digits will match any value, so you can specify an entire class C network with 'addip 192.246.40'" },
463  { "removeip", "Removeip will only remove an address specified exactly the same way. You cannot addip a subnet, then removeip a single host" },
464  { "listip", "Prints the current list of filters" },
465  { "writeip", "Dumps ips to listip.cfg so it can be executed at a later date" },
466  { "ai_add", "Used to add ai opponents to a game - but no civilians" },
467  { "win", "Call the end game function with the given team" },
468 #ifdef DEBUG
469  { "debug_showall", "Debug function: Reveal all items to all sides" },
470  { "debug_actorinvlist", "Debug function to show the whole inventory of all connected clients on the server" },
471 #endif
472  { 0, 0 }
473 };
474 
479 static int SV_CompleteServerCommand (const char* partial, const char** match)
480 {
481  int n = 0;
482  for (serverCommand_t const* i = serverCommandList; i->name; ++i) {
483  if (Cmd_GenericCompleteFunction(i->name, partial, match)) {
484  Com_Printf("[cmd] %s\n", i->name);
485  if (*i->description)
486  Com_Printf(S_COLOR_GREEN " %s\n", i->description);
487  ++n;
488  }
489  }
490  return n;
491 }
492 
496 static void SV_PrintConfigStrings_f (void)
497 {
498  for (int i = 0; i < MAX_CONFIGSTRINGS; i++) {
499  const char* configString;
500  /* CS_TILES and CS_POSITIONS can stretch over multiple configstrings,
501  * so don't send the middle parts again. */
502  if (i > CS_TILES && i < CS_POSITIONS)
503  continue;
504  if (i > CS_POSITIONS && i < CS_MODELS)
505  continue;
506  configString = SV_GetConfigString(i);
507  if (configString[0] == '\0')
508  continue;
509  Com_Printf("configstring[%3i]: %s\n", i, configString);
510  }
511 }
512 
513 #ifdef DEBUG
514 
515 #include "../common/routing.h"
516 
521 static void Grid_DumpWholeServerMap_f (void)
522 {
523  RT_DumpWholeMap(&sv->mapTiles, sv->mapData.routing);
524 }
525 
530 static void Grid_DumpServerRoutes_f (void)
531 {
533  VecToPos(sv->mapData.mapBox.mins, wpMins);
534  VecToPos(sv->mapData.mapBox.maxs, wpMaxs);
535  RT_WriteCSVFiles(sv->mapData.routing, "ufoaiserver", GridBox(wpMins, wpMaxs));
536 }
537 #endif
538 
543 {
544  Cmd_AddCommand("heartbeat", SV_Heartbeat_f, "Sends a heartbeat to the masterserver");
545  Cmd_AddCommand("kick", SV_Kick_f, "Kick a user from the server");
546  Cmd_AddCommand("startgame", SV_StartGame_f, "Forces a game start even if not all players are ready yet");
547  Cmd_AddCommand("status", SV_Status_f, "Prints status of server and connected clients");
548  Cmd_AddCommand("serverinfo", SV_Serverinfo_f, "Prints the serverinfo that is visible in the server browsers");
549  Cmd_AddCommand("info", SV_UserInfo_f, "Prints the userinfo for a given userid");
550 
551  Cmd_AddCommand("map", SV_Map_f, "Quit client and load the new map");
553  Cmd_AddCommand("devmap", SV_Map_f, "Quit client and load the new map - deactivate the ai");
555  Cmd_AddCommand("maplist", SV_ListMaps_f, "List of all available maps");
556 
557  Cmd_AddCommand("setmaster", SV_SetMaster_f, "Send ping command to masterserver (see cvar masterserver_url)");
558 
559 #ifdef DEDICATED_ONLY
560  Cmd_AddCommand("say", SV_ConSay_f, "Broadcasts server messages to all connected players");
561 #endif
562 
563 #ifdef DEBUG
564  Cmd_AddCommand("debug_sgrid", Grid_DumpWholeServerMap_f, "Shows the whole server side pathfinding grid of the current loaded map");
565  Cmd_AddCommand("debug_sroute", Grid_DumpServerRoutes_f, "Shows the whole server side pathfinding grid of the current loaded map");
566 #endif
567 
568  Cmd_AddCommand("killserver", SV_KillServer_f, "Shuts the server down - and disconnect all clients");
569  Cmd_AddCommand("sv_configstrings", SV_PrintConfigStrings_f, "Prints the server config strings to game console");
570 
571  Cmd_AddCommand("sv", SV_ServerCommand_f, "Server command");
573 }
static void SV_KillServer_f(void)
Kick everyone off, possibly in preparation for a new game.
Definition: sv_ccmds.cpp:354
char const * name
Definition: sv_ccmds.cpp:456
const char * Cmd_Argv(int arg)
Returns a given argument.
Definition: cmd.cpp:516
void Cmd_AddCommand(const char *cmdName, xcommand_t function, const char *desc)
Add a new command to the script interface.
Definition: cmd.cpp:744
static void SV_UserInfo_f(void)
Examine all a users info strings.
Definition: sv_ccmds.cpp:328
void void void SV_BroadcastPrintf(int level, const char *fmt,...) __attribute__((format(__printf__
void SV_SetMaster_f(void)
Add the server to the master server list so that others can see the server in the server list...
Definition: sv_ccmds.cpp:45
int FS_CheckFile(const char *fmt,...)
Just returns the filelength and -1 if the file wasn't found.
Definition: files.cpp:298
static int SV_CompleteServerCommand(const char *partial, const char **match)
Autocomplete function for server commands.
Definition: sv_ccmds.cpp:479
char * SV_GetConfigString(int index)
Definition: sv_main.cpp:77
static ipos3_t wpMaxs
Definition: routing.cpp:35
#define DEBUG_SERVER
Definition: defines.h:60
SDL_mutex * serverMutex
Definition: server.h:86
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...
Definition: shared.cpp:410
#define PRINT_CHAT
Definition: defines.h:106
void RT_WriteCSVFiles(const Routing &routing, const char *baseFilename, const GridBox &box)
Definition: routing.cpp:1330
cvar_t * sv_maxclients
Definition: g_main.cpp:43
const char * Cvar_Serverinfo(char *info, size_t infoSize)
Returns an info string containing all the CVAR_SERVERINFO cvars.
Definition: cvar.cpp:977
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
Definition: shared.cpp:494
#define MAX_TILESTRINGS
Definition: q_shared.h:298
static void SV_ListMaps_f(void)
List all valid maps.
Definition: sv_ccmds.cpp:442
char userinfo[MAX_INFO_STRING]
Definition: server.h:157
void FS_GetMaps(bool reset)
File the fs_maps array with valid maps.
Definition: files.cpp:1373
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.
Definition: sv_init.cpp:113
player_t * player
Definition: server.h:158
client_t * SV_GetNextClient(client_t *lastClient)
Iterates through clients.
Definition: sv_main.cpp:152
void Com_Printf(const char *const fmt,...)
Definition: common.cpp:386
bool Cmd_GenericCompleteFunction(char const *candidate, char const *partial, char const **match)
Definition: cmd.cpp:648
vec3_t maxs
Definition: aabb.h:258
#define CS_POSITIONS
Definition: q_shared.h:326
int integer
Definition: cvar.h:81
cvar_t * masterserver_url
Definition: common.cpp:57
voidpf void * buf
Definition: ioapi.h:42
ipos_t ipos3_t[3]
Definition: ufotypes.h:70
int lastmessage
Definition: server.h:161
serverInstanceGame_t * sv
Definition: sv_init.cpp:36
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
Definition: shared.cpp:457
#define CS_MODELS
Definition: q_shared.h:327
#define MAX_INFO_STRING
Definition: infostring.h:36
void SV_DropClient(client_t *drop, const char *message)
Called when the player is totally leaving the server, either willingly or unwillingly. This is NOT called if the entire server is quitting or crashing.
Definition: sv_main.cpp:184
#define Q_strncasecmp(s1, s2, n)
Definition: shared.h:132
List for SV_CompleteServerCommand.
Definition: sv_ccmds.cpp:455
static void SV_Status_f(void)
Prints some server info to the game console - like connected players and current running map...
Definition: sv_ccmds.cpp:232
int Cmd_Argc(void)
Return the number of arguments of the current command. "command parameter" will result in a argc of 2...
Definition: cmd.cpp:505
bool isReady() const
Definition: game.h:64
bool SV_CheckMap(const char *map, const char *assembly)
Checks whether a map exists.
Definition: sv_ccmds.cpp:101
#define VecToPos(v, p)
Map boundary is +/- MAX_WORLD_WIDTH - to get into the positive area we add the possible max negative ...
Definition: mathlib.h:100
Main server include file.
static void SV_StartGame_f(void)
Forces a game start even if not all players are ready yet.
Definition: sv_ccmds.cpp:215
clientBattleScape_t cl
mapData_t mapData
Definition: server.h:124
#define MAX_TOKEN_CHARS
Definition: defines.h:372
#define S_COLOR_GREEN
Definition: common.h:219
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
Definition: common.cpp:398
static void SV_ServerCommand_f(void)
Let the game dll handle a command.
Definition: sv_ccmds.cpp:364
#define MAX_CONFIGSTRINGS
Definition: q_shared.h:330
int fs_numInstalledMaps
Definition: files.cpp:1312
void setReady(bool ready)
Definition: game.h:67
char name[32]
Definition: server.h:159
char name[MAX_QPATH]
Definition: server.h:109
char * fs_maps[MAX_MAPS]
Definition: files.cpp:1311
mapTiles_t mapTiles
Definition: server.h:126
void SV_Heartbeat_f(void)
Definition: sv_ccmds.cpp:35
#define MAX_QPATH
Definition: filesys.h:40
QGL_EXTERN GLint i
Definition: r_gl.h:113
static void SV_PrintConfigStrings_f(void)
Definition: sv_ccmds.cpp:496
char * string
Definition: cvar.h:73
cvar_t * sv_dedicated
Definition: common.cpp:51
struct net_stream * stream
Definition: server.h:163
struct client_s * clients
Definition: server.h:80
#define CS_TILES
Definition: q_shared.h:325
#define CS_LIGHTMAP
Definition: q_shared.h:321
static void SV_Map_f(void)
Goes directly to a given map.
Definition: sv_ccmds.cpp:131
cvar_t * port
Definition: common.cpp:58
void Q_strcat(char *dest, size_t destsize, const char *format,...)
Safely (without overflowing the destination buffer) concatenates two strings.
Definition: shared.cpp:475
void SV_InitOperatorCommands(void)
Definition: sv_ccmds.cpp:542
void Cmd_AddParamCompleteFunction(const char *cmdName, int(*function)(const char *partial, const char **match))
Definition: cmd.cpp:679
client_state_t state
Definition: server.h:156
void Info_Print(const char *s)
Prints info strings (like userinfo or serverinfo - CVAR_USERINFO, CVAR_SERVERINFO) ...
Definition: infostring.cpp:209
#define PRINT_CONSOLE
Definition: defines.h:108
char const * description
Definition: sv_ccmds.cpp:457
vec3_t mins
Definition: aabb.h:257
AABB mapBox
Definition: typedefs.h:351
cvar_t * Cvar_ForceSet(const char *varName, const char *value)
Will set the variable even if NOSET or LATCH.
Definition: cvar.cpp:604
bool HTTP_GetURL(const char *url, http_callback_t callback, void *userdata, const char *postfields)
Downloads the given url and return the data to the callback (optional)
Definition: http.cpp:374
static serverCommand_t const serverCommandList[]
Definition: sv_ccmds.cpp:460
static client_t * SV_GetPlayerClientStructure(const char *s)
searches a player by id or name
Definition: sv_ccmds.cpp:68
const char * NET_StreamPeerToName(struct net_stream *s, char *dst, int len, bool appendPort)
Definition: net.cpp:872
cvar_t * Cvar_Set(const char *varName, const char *value,...)
Sets a cvar value.
Definition: cvar.cpp:615
#define Q_streq(a, b)
Definition: shared.h:136
static void SV_Serverinfo_f(void)
Examine or change the serverinfo string.
Definition: sv_ccmds.cpp:316
void Cvar_SetValue(const char *varName, float value)
Expands value to a string and calls Cvar_Set.
Definition: cvar.cpp:671
Routing routing
Definition: typedefs.h:341
int Com_ServerState(void)
Check whether we are the server or have a singleplayer tactical mission.
Definition: common.cpp:538
static int SV_CompleteMapCommand(const char *partial, const char **match)
Autocomplete function for the map command.
Definition: sv_ccmds.cpp:390
serverInstanceStatic_t svs
Definition: sv_init.cpp:35
static ipos3_t wpMins
world min and max values converted from vec to pos
Definition: routing.cpp:35
static void SV_Kick_f(void)
Kick a user off of the server.
Definition: sv_ccmds.cpp:187
const char * Cmd_Args(void)
Returns a single string containing argv(1) to argv(argc()-1)
Definition: cmd.cpp:526
int SV_GetConfigStringInteger(int index)
Definition: sv_main.cpp:108
static const char * mapName
void SV_Shutdown(const char *finalmsg, bool reconnect)
Called when each game quits, before Sys_Quit or Sys_Error.
Definition: sv_main.cpp:1042
game_export_t * ge
Definition: server.h:92