UFO: Alien Invasion
|
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"
Go to the source code of this file.
Data Structures | |
struct | ipfilter_s |
PACKET FILTERING. More... | |
Macros | |
#define | MAX_IPFILTERS 1024 |
Typedefs | |
typedef struct ipfilter_s | ipfilter_t |
PACKET FILTERING. More... | |
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. More... | |
static void | SVCmd_WriteIP_f (void) |
Store all ips in the current filter list in. More... | |
static void | SVCmd_AI_Add_f (void) |
Used to add ai opponents to a game. More... | |
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. More... | |
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. More... | |
Variables | |
static ipfilter_t | ipfilters [MAX_IPFILTERS] |
static int | numipfilters |
Server commands.
Definition in file g_svcmds.cpp.
#define MAX_IPFILTERS 1024 |
Definition at line 63 of file g_svcmds.cpp.
Referenced by SVCmd_AddIP_f().
typedef struct ipfilter_s ipfilter_t |
PACKET FILTERING.
addip IP removeip IP 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 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 "addip IP" commands to listip.cfg so it can be executed at a later date. The filter lists are not saved and restored by default, because I beleive it would cause too much confusion.
sv_filterban <0 or 1> If 1 (the default), then ip addresses matching the current list will be prohibited from entering the game. This is the default setting. If 0, then only addresses matching the list will be allowed. This lets you easily set up a private game, or a game that only allows players from your local network.
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.
Definition at line 337 of file g_svcmds.cpp.
References game_import_s::Cmd_Argv(), 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().
|
static |
Definition at line 68 of file g_svcmds.cpp.
References ipfilter_s::compare, i, m, ipfilter_s::mask, and OBJZERO.
Referenced by SVCmd_AddIP_f(), and SVCmd_RemoveIP_f().
bool SV_FilterPacket | ( | const char * | from | ) |
Definition at line 104 of file g_svcmds.cpp.
References ipfilter_s::compare, i, cvar_s::integer, m, numipfilters, and sv_filterban.
Referenced by G_ClientConnect().
Definition at line 134 of file g_svcmds.cpp.
References game_import_s::Cmd_Argv(), ipfilter_s::compare, gi, i, MAX_IPFILTERS, numipfilters, and StringToFilter().
Referenced by G_ServerCommand().
Used to add ai opponents to a game.
Definition at line 228 of file g_svcmds.cpp.
References AI_CreatePlayer(), game_import_s::Cmd_Argv(), gi, MAX_TEAMS, and TEAM_CIVILIAN.
Referenced by G_ServerCommand().
Shows the current ip in the filter list.
Definition at line 185 of file g_svcmds.cpp.
References gi, i, and numipfilters.
Referenced by G_ServerCommand().
Definition at line 160 of file g_svcmds.cpp.
References game_import_s::Cmd_Argv(), ipfilter_s::compare, f, gi, i, ipfilter_s::mask, numipfilters, and StringToFilter().
Referenced by G_ServerCommand().
Call the end game function with the given team used to e.g. abort singleplayer games and let the aliens win.
Definition at line 248 of file g_svcmds.cpp.
References game_import_s::Cmd_Argv(), G_MatchEndTrigger(), gi, MAX_TEAMS, and TEAM_CIVILIAN.
Referenced by G_ServerCommand().
Store all ips in the current filter list in.
Definition at line 198 of file g_svcmds.cpp.
References Com_sprintf(), f, FILE, game_import_s::FS_Gamedir(), gi, i, cvar_s::integer, MAX_OSPATH, name, numipfilters, sv_filterban, and game_import_s::Sys_Fopen().
Referenced by G_ServerCommand().
|
static |
Definition at line 65 of file g_svcmds.cpp.
|
static |
Definition at line 66 of file g_svcmds.cpp.
Referenced by SV_FilterPacket(), SVCmd_AddIP_f(), SVCmd_ListIP_f(), SVCmd_RemoveIP_f(), and SVCmd_WriteIP_f().