Console-only server commands. More...
#include "server.h"
Go to the source code of this file.
Functions | |
void | SV_Heartbeat_f (void) |
void | SV_SetMaster_f (void) |
Specify a list of master servers. | |
static client_t * | SV_GetPlayerClientStructure (const char *s) |
searches a player by id or name | |
qboolean | SV_CheckMap (const char *map, const char *assembly) |
Checks whether a map exists. | |
static void | SV_Map_f (void) |
Goes directly to a given map. | |
static void | SV_Kick_f (void) |
Kick a user off of the server. | |
static void | SV_StartGame_f (void) |
Forces a game start even if not all players are ready yet. | |
static void | SV_Status_f (void) |
Prints some server info to the game console - like connected players and current running map. | |
static void | SV_Serverinfo_f (void) |
Examine or change the serverinfo string. | |
static void | SV_UserInfo_f (void) |
Examine all a users info strings. | |
static void | SV_KillServer_f (void) |
Kick everyone off, possibly in preparation for a new game. | |
static void | SV_ServerCommand_f (void) |
Let the game dll handle a command. | |
static int | SV_CompleteMapCommand (const char *partial, const char **match) |
Autocomplete function for the map command. | |
static void | SV_ListMaps_f (void) |
List all valid maps. | |
static int | SV_CompleteServerCommand (const char *partial, const char **match) |
Autocomplete function for server commands. | |
static void | SV_PrintConfigStrings_f (void) |
void | SV_InitOperatorCommands (void) |
Variables | |
static const char * | serverCommandList [] |
List for SV_CompleteServerCommand. |
Console-only server commands.
These commands can only be entered from stdin or by a remote operator datagram.
Definition in file sv_ccmds.c.
qboolean SV_CheckMap | ( | const char * | map, | |
const char * | assembly | |||
) |
Checks whether a map exists.
Definition at line 105 of file sv_ccmds.c.
References Com_Printf(), Com_sprintf(), FS_CheckFile(), MAX_QPATH, qfalse, and qtrue.
Referenced by SV_Map_f(), and SV_MapcycleAdd_f().
static int SV_CompleteMapCommand | ( | const char * | partial, | |
const char ** | match | |||
) | [static] |
Autocomplete function for the map command.
[out] | match | The found entry of the list we are searching, in case of more than one entry their common suffix is returned. |
Definition at line 386 of file sv_ccmds.c.
References Cmd_GenericCompleteFunction(), Com_Printf(), FS_GetMaps(), fs_maps, fs_numInstalledMaps, i, len, MAX_COMPLETE, Q_strncpyz(), and qfalse.
Referenced by SV_InitOperatorCommands().
static int SV_CompleteServerCommand | ( | const char * | partial, | |
const char ** | match | |||
) | [static] |
Autocomplete function for server commands.
Definition at line 487 of file sv_ccmds.c.
References Cmd_GenericCompleteFunction(), COLORED_GREEN, Com_Printf(), i, len, and MAX_COMPLETE.
Referenced by SV_InitOperatorCommands().
static client_t* SV_GetPlayerClientStructure | ( | const char * | s | ) | [static] |
searches a player by id or name
[in] | s | Either the numeric id of the player, or the player name |
Definition at line 72 of file sv_ccmds.c.
References cl, Cmd_Argv(), Com_Printf(), cs_free, client_s::name, client_s::state, and SV_GetNextClient().
Referenced by SV_Kick_f(), and SV_UserInfo_f().
void SV_Heartbeat_f | ( | void | ) |
Definition at line 33 of file sv_ccmds.c.
References serverInstanceStatic_t::lastHeartbeat, and svs.
Referenced by SV_InitGame(), SV_InitOperatorCommands(), and SV_SetMaster_f().
void SV_InitOperatorCommands | ( | void | ) |
Definition at line 574 of file sv_ccmds.c.
References Cmd_AddCommand(), Cmd_AddParamCompleteFunction(), SV_CompleteMapCommand(), SV_CompleteServerCommand(), SV_Heartbeat_f(), SV_Kick_f(), SV_KillServer_f(), SV_ListMaps_f(), SV_Map_f(), SV_PrintConfigStrings_f(), SV_ServerCommand_f(), SV_Serverinfo_f(), SV_SetMaster_f(), SV_StartGame_f(), SV_Status_f(), and SV_UserInfo_f().
Referenced by SV_Init().
static void SV_Kick_f | ( | void | ) | [static] |
Kick a user off of the server.
Definition at line 190 of file sv_ccmds.c.
References cl, Cmd_Argc(), Cmd_Argv(), Com_Printf(), serverInstanceStatic_t::initialized, client_s::name, PRINT_CONSOLE, SV_BroadcastPrintf(), SV_DropClient(), SV_GetPlayerClientStructure(), and svs.
Referenced by SV_InitOperatorCommands().
static void SV_KillServer_f | ( | void | ) | [static] |
Kick everyone off, possibly in preparation for a new game.
Definition at line 348 of file sv_ccmds.c.
References serverInstanceStatic_t::initialized, qfalse, SV_Shutdown(), and svs.
Referenced by SV_InitOperatorCommands().
static void SV_ListMaps_f | ( | void | ) | [static] |
List all valid maps.
Definition at line 453 of file sv_ccmds.c.
References Com_Printf(), FS_GetMaps(), fs_maps, fs_numInstalledMaps, i, and qtrue.
Referenced by SV_InitOperatorCommands().
static void SV_Map_f | ( | void | ) | [static] |
Goes directly to a given map.
Definition at line 135 of file sv_ccmds.c.
References Cmd_Argc(), Cmd_Argv(), Com_Printf(), Cvar_SetValue(), MAX_TILESTRINGS, MAX_TOKEN_CHARS, Q_strncpyz(), qfalse, qtrue, SV_CheckMap(), and SV_Map().
Referenced by SV_InitOperatorCommands().
static void SV_PrintConfigStrings_f | ( | void | ) | [static] |
Definition at line 530 of file sv_ccmds.c.
References Com_Printf(), i, MAX_CONFIGSTRINGS, and SV_GetConfigString().
Referenced by SV_InitOperatorCommands().
static void SV_ServerCommand_f | ( | void | ) | [static] |
Let the game dll handle a command.
Definition at line 358 of file sv_ccmds.c.
References Cmd_Argc(), Cmd_Args(), Cmd_Argv(), Com_DPrintf(), Com_Printf(), DEBUG_SERVER, serverInstanceStatic_t::ge, serverInstanceStatic_t::serverMutex, and svs.
Referenced by SV_InitOperatorCommands().
static void SV_Serverinfo_f | ( | void | ) | [static] |
Examine or change the serverinfo string.
Definition at line 311 of file sv_ccmds.c.
References Com_Printf(), Cvar_Serverinfo(), and Info_Print().
Referenced by SV_InitOperatorCommands().
void SV_SetMaster_f | ( | void | ) |
Specify a list of master servers.
Definition at line 43 of file sv_ccmds.c.
References Com_DPrintf(), Com_Printf(), Cvar_Set(), DEBUG_SERVER, HTTP_GetURL(), cvar_s::integer, masterserver_url, Mem_Free, port, cvar_s::string, sv_dedicated, SV_Heartbeat_f(), sv_maxclients, and va().
Referenced by SV_InitGame(), and SV_InitOperatorCommands().
static void SV_StartGame_f | ( | void | ) | [static] |
Forces a game start even if not all players are ready yet.
Definition at line 218 of file sv_ccmds.c.
References cl, cs_free, player_s::isReady, client_s::player, qtrue, client_s::state, and SV_GetNextClient().
Referenced by SV_InitOperatorCommands().
static void SV_Status_f | ( | void | ) | [static] |
Prints some server info to the game console - like connected players and current running map.
Definition at line 230 of file sv_ccmds.c.
References cl, serverInstanceStatic_t::clients, Com_Printf(), cs_began, cs_connected, cs_free, CS_LIGHTMAP, cs_spawning, serverInstanceStatic_t::ge, i, client_s::name, serverInstanceGame_t::name, NET_StreamPeerToName(), qfalse, client_s::state, client_s::stream, sv, SV_GetConfigStringInteger(), SV_GetNextClient(), and svs.
Referenced by SV_InitOperatorCommands().
static void SV_UserInfo_f | ( | void | ) | [static] |
Examine all a users info strings.
Definition at line 322 of file sv_ccmds.c.
References cl, Cmd_Argc(), Cmd_Argv(), Com_Printf(), Info_Print(), serverInstanceStatic_t::initialized, SV_GetPlayerClientStructure(), svs, and client_s::userinfo.
Referenced by SV_InitOperatorCommands().
const char* serverCommandList[] [static] |
{ "startgame", "Force the gamestart - useful for multiplayer games", "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'", "removeip", "Removeip will only remove an address specified exactly the same way. You cannot addip a subnet, then removeip a single host", "listip", "Prints the current list of filters", "writeip", "Dumps ips to listip.cfg so it can be executed at a later date", "ai_add", "Used to add ai opponents to a game - but no civilians", "win", "Call the end game function with the given team", NULL }
List for SV_CompleteServerCommand.
Definition at line 468 of file sv_ccmds.c.