sv_ccmds.c File Reference

Console-only server commands. More...

#include "server.h"
Include dependency graph for sv_ccmds.c:

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_tSV_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.

Detailed Description

Console-only server commands.

These commands can only be entered from stdin or by a remote operator datagram.

Definition in file sv_ccmds.c.


Function Documentation

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.

Parameters:
[out] match The found entry of the list we are searching, in case of more than one entry their common suffix is returned.
See also:
Cmd_AddParamCompleteFunction

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.

See also:
ServerCommand

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

Parameters:
[in] s Either the numeric id of the player, or the player name
Returns:
the client structure

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   ) 
static void SV_Kick_f ( void   )  [static]
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.

See also:
FS_GetMaps

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.

See also:
SV_InitGame
SV_SpawnServer

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]
See also:
CL_ShowConfigstrings_f

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   ) 
static void SV_StartGame_f ( void   )  [static]

Forces a game start even if not all players are ready yet.

See also:
SV_CheckGameStart

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]
static void SV_UserInfo_f ( void   )  [static]

Examine all a users info strings.

See also:
CL_UserInfo_f

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().


Variable Documentation

const char* serverCommandList[] [static]
Initial value:
 {
    "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.

See also:
ServerCommand

Definition at line 468 of file sv_ccmds.c.


Generated by  doxygen 1.6.2