UFO: Alien Invasion
Loading...
Searching...
No Matches
g_svcmds.cpp File Reference

Server commands. More...

#include "g_local.h"
#include "g_ai.h"
#include "g_client.h"
#include "g_edicts.h"
#include "g_inventory.h"
#include "g_match.h"
#include "g_vis.h"
Include dependency graph for g_svcmds.cpp:

Go to the source code of this file.

Data Structures

struct  ipfilter_t
 PACKET FILTERING. More...

Macros

#define MAX_IPFILTERS   1024

Functions

static bool StringToFilter (const char *s, ipfilter_t *f)
bool SV_FilterPacket (const char *from)
static void SVCmd_AddIP_f (void)
static void SVCmd_RemoveIP_f (void)
static void SVCmd_ListIP_f (void)
 Shows the current ip in the filter list.
static void SVCmd_WriteIP_f (void)
 Store all ips in the current filter list in.
static void SVCmd_AI_Add_f (void)
 Used to add ai opponents to a game.
static void SVCmd_Win_f (void)
 Call the end game function with the given team used to e.g. abort singleplayer games and let the aliens win.
void G_ServerCommand (void)
 ServerCommand will be called when an "sv" command is issued. The game can issue gi.Cmd_Argc() / gi.Cmd_Argv() commands to get the rest of the parameters.

Variables

static ipfilter_t ipfilters [MAX_IPFILTERS]
static int numipfilters

Detailed Description

Server commands.

Definition in file g_svcmds.cpp.

Macro Definition Documentation

◆ MAX_IPFILTERS

#define MAX_IPFILTERS   1024

Definition at line 63 of file g_svcmds.cpp.

Referenced by SVCmd_AddIP_f().

Function Documentation

◆ G_ServerCommand()

void G_ServerCommand ( void )

ServerCommand will be called when an "sv" command is issued. The game can issue gi.Cmd_Argc() / gi.Cmd_Argv() commands to get the rest of the parameters.

See also
serverCommandList

Definition at line 337 of file g_svcmds.cpp.

References gi, Q_strcasecmp, SVCmd_AddIP_f(), SVCmd_AI_Add_f(), SVCmd_ListIP_f(), SVCmd_RemoveIP_f(), SVCmd_Win_f(), and SVCmd_WriteIP_f().

Referenced by GetGameAPI().

◆ StringToFilter()

bool StringToFilter ( const char * s,
ipfilter_t * f )
static
Todo
find out if this printf is needed. Passing nullptr as a player would have crashed anyway.

Definition at line 68 of file g_svcmds.cpp.

References f, i, m, and OBJZERO.

Referenced by SVCmd_AddIP_f(), and SVCmd_RemoveIP_f().

◆ SV_FilterPacket()

bool SV_FilterPacket ( const char * from)

Definition at line 104 of file g_svcmds.cpp.

References i, ipfilters, m, numipfilters, and sv_filterban.

Referenced by G_ClientConnect().

◆ SVCmd_AddIP_f()

void SVCmd_AddIP_f ( void )
static
See also
SVCmd_RemoveIP_f

Definition at line 134 of file g_svcmds.cpp.

References gi, i, ipfilters, MAX_IPFILTERS, numipfilters, and StringToFilter().

Referenced by G_ServerCommand().

◆ SVCmd_AI_Add_f()

void SVCmd_AI_Add_f ( void )
static

Used to add ai opponents to a game.

Note
civilians can not be added with this function
See also
AI_CreatePlayer

Definition at line 228 of file g_svcmds.cpp.

References AI_CreatePlayer(), gi, MAX_TEAMS, and TEAM_CIVILIAN.

Referenced by G_ServerCommand().

◆ SVCmd_ListIP_f()

void SVCmd_ListIP_f ( void )
static

Shows the current ip in the filter list.

Definition at line 185 of file g_svcmds.cpp.

References gi, i, ipfilters, and numipfilters.

Referenced by G_ServerCommand().

◆ SVCmd_RemoveIP_f()

void SVCmd_RemoveIP_f ( void )
static
See also
SVCmd_AddIP_f

Definition at line 160 of file g_svcmds.cpp.

References f, gi, i, ipfilters, numipfilters, and StringToFilter().

Referenced by G_ServerCommand().

◆ SVCmd_Win_f()

void SVCmd_Win_f ( void )
static

Call the end game function with the given team used to e.g. abort singleplayer games and let the aliens win.

See also
G_MatchEndTrigger

Definition at line 248 of file g_svcmds.cpp.

References G_MatchEndTrigger(), gi, MAX_TEAMS, and TEAM_CIVILIAN.

Referenced by G_ServerCommand().

◆ SVCmd_WriteIP_f()

void SVCmd_WriteIP_f ( void )
static

Store all ips in the current filter list in.

Definition at line 198 of file g_svcmds.cpp.

References Com_sprintf(), f, FILE, gi, i, ipfilters, MAX_OSPATH, name, numipfilters, and sv_filterban.

Referenced by G_ServerCommand().

Variable Documentation

◆ ipfilters

◆ numipfilters

int numipfilters
static