Go to the source code of this file.
◆ MAX_IPFILTERS
#define MAX_IPFILTERS 1024 |
◆ ServerCommand()
Definition at line 275 of file g_svcmds.c.
280 if (Q_stricmp(cmd,
"test") == 0)
282 else if (Q_stricmp(cmd,
"addip") == 0)
284 else if (Q_stricmp(cmd,
"removeip") == 0)
286 else if (Q_stricmp(cmd,
"listip") == 0)
288 else if (Q_stricmp(cmd,
"writeip") == 0)
291 gi.cprintf(NULL, PRINT_HIGH,
"Unknown server command \"%s\"\n", cmd);
Referenced by GetGameAPI().
◆ StringToFilter()
static qboolean StringToFilter |
( |
char * |
s, |
|
|
ipfilter_t * |
f |
|
) |
| |
|
static |
Definition at line 73 of file g_svcmds.c.
80 for (i = 0 ; i < 4 ; i++) {
85 for (i = 0 ; i < 4 ; i++) {
86 if (*s < '0' || *s >
'9') {
87 gi.cprintf(NULL, PRINT_HIGH,
"Bad filter address: %s\n", s);
92 while (*s >=
'0' && *s <=
'9') {
105 f->
mask = *(
unsigned *)
m;
Referenced by SVCmd_AddIP_f(), and SVCmd_RemoveIP_f().
◆ SV_FilterPacket()
qboolean SV_FilterPacket |
( |
char * |
from | ) |
|
Definition at line 116 of file g_svcmds.c.
125 while (*p && i < 4) {
127 while (*p >=
'0' && *p <=
'9') {
128 m[i] =
m[i] * 10 + (*p -
'0');
131 if (!*p || *p ==
':')
Referenced by ClientConnect().
◆ SVCmd_AddIP_f()
Definition at line 151 of file g_svcmds.c.
156 gi.cprintf(NULL, PRINT_HIGH,
"Usage: addip <ip-mask>\n");
165 gi.cprintf(NULL, PRINT_HIGH,
"IP filter list is full\n");
Referenced by ServerCommand().
◆ SVCmd_ListIP_f()
Definition at line 210 of file g_svcmds.c.
215 gi.cprintf(NULL, PRINT_HIGH,
"Filter list:\n");
218 gi.cprintf(NULL, PRINT_HIGH,
"%3i.%3i.%3i.%3i\n", b[0], b[1], b[2], b[3]);
Referenced by ServerCommand().
◆ SVCmd_RemoveIP_f()
Definition at line 180 of file g_svcmds.c.
186 gi.cprintf(NULL, PRINT_HIGH,
"Usage: sv removeip <ip-mask>\n");
199 gi.cprintf(NULL, PRINT_HIGH,
"Removed.\n");
202 gi.cprintf(NULL, PRINT_HIGH,
"Didn't find %s.\n",
gi.argv(2));
Referenced by ServerCommand().
◆ Svcmd_Test_f()
◆ SVCmd_WriteIP_f()
Definition at line 227 of file g_svcmds.c.
230 char name[MAX_OSPATH];
236 game =
gi.cvar(
"game",
"", 0);
241 len =
Q_snprintf(name,
sizeof(name),
"%s/listip.cfg",
game->string);
243 if (len >=
sizeof(name)) {
244 gi.cprintf(NULL, PRINT_HIGH,
"File name too long\n");
248 gi.cprintf(NULL, PRINT_HIGH,
"Writing %s.\n", name);
250 f = fopen(name,
"wb");
252 gi.cprintf(NULL, PRINT_HIGH,
"Couldn't open %s\n", name);
256 fprintf(f,
"set filterban %d\n", (
int)
filterban->value);
260 fprintf(f,
"sv addip %i.%i.%i.%i\n", b[0], b[1], b[2], b[3]);
Referenced by ServerCommand().
◆ ipfilters
◆ numipfilters