From: Samual Date: Tue, 13 Dec 2011 10:37:47 +0000 (-0500) Subject: Move the gamecommand part of ipban.qc into server/command/ipban.qc (the rest stays... X-Git-Tag: xonotic-v0.6.0~188^2~28^2~148 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a8eb28efbdaaa2f78967184b26d439efb38a9171;p=xonotic%2Fxonotic-data.pk3dir.git Move the gamecommand part of ipban.qc into server/command/ipban.qc (the rest stays normal) --- diff --git a/qcsrc/server/ipban.qc b/qcsrc/server/ipban.qc index 66e5a97e5..77bc1d6a2 100644 --- a/qcsrc/server/ipban.qc +++ b/qcsrc/server/ipban.qc @@ -574,79 +574,3 @@ void Ban_KickBanClient(entity client, float bantime, float masksize, string reas dropclient(client); */ } - -float GameCommand_Ban(string command) -{ - float argc; - float bantime; - entity client; - float entno; - float masksize; - string reason; - float reasonarg; - - argc = tokenize_console(command); - if(argv(0) == "help") - { - print(" kickban # n m p reason - kickban player n for m seconds, using mask size p (1 to 4)\n"); - print(" ban ip m reason - ban an IP or range (incomplete IP, like 1.2.3) for m seconds\n"); - print(" bans - list all existing bans\n"); - print(" unban n - delete the entry #n from the bans list\n"); - return TRUE; - } - if(argv(0) == "kickban") - { -#define INITARG(c) reasonarg = c -#define GETARG(v,d) if((argc > reasonarg) && ((v = stof(argv(reasonarg))) != 0)) ++reasonarg; else v = d -#define RESTARG(v) if(argc > reasonarg) v = substring(command, argv_start_index(reasonarg), strlen(command) - argv_start_index(reasonarg)); else v = "" - if(argc >= 3) - { - entno = stof(argv(2)); - if(entno > maxclients || entno < 1) - return TRUE; - client = edict_num(entno); - - INITARG(3); - GETARG(bantime, autocvar_g_ban_default_bantime); - GETARG(masksize, autocvar_g_ban_default_masksize); - RESTARG(reason); - - Ban_KickBanClient(client, bantime, masksize, reason); - return TRUE; - } - } - else if(argv(0) == "ban") - { - if(argc >= 2) - { - string ip; - ip = argv(1); - - INITARG(2); - GETARG(bantime, autocvar_g_ban_default_bantime); - RESTARG(reason); - - Ban_Insert(ip, bantime, reason, 1); - return TRUE; - } -#undef INITARG -#undef GETARG -#undef RESTARG - } - else if(argv(0) == "bans") - { - Ban_View(); - return TRUE; - } - else if(argv(0) == "unban") - { - if(argc >= 2) - { - float who; - who = stof(argv(1)); - Ban_Delete(who); - return TRUE; - } - } - return FALSE; -} diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index 8cb8abad6..1ede57594 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -39,6 +39,7 @@ campaign.qh ../common/util.qc command/common.qh +command/ipban.qh command/radarmap.qh command/vote.qh command/cmd.qh @@ -145,6 +146,7 @@ campaign.qc ../common/command/generic.qc command/common.qc +command/ipban.qc command/radarmap.qc command/vote.qc command/cmd.qc