From: Samual Date: Fri, 30 Dec 2011 04:53:07 +0000 (-0500) Subject: Add proper usage support for bans plus also show total number of bans and such prints... X-Git-Tag: xonotic-v0.6.0~188^2~28^2~21 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1aedca5b52d6a4296354501e480e3af7122a8e86;p=xonotic%2Fxonotic-data.pk3dir.git Add proper usage support for bans plus also show total number of bans and such prints with the banlist command --- diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 7c234002d..8cfaf3884 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -1766,7 +1766,11 @@ void GameCommand(string command) return; } - else if(CommonCommand_macro_usage(argc, world)) // Instead of trying to call a command, we're going to see detailed information about it + else if(BanCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it + { + return; + } + else if(CommonCommand_macro_usage(argc, world)) // same here, but for common commands instead { return; } diff --git a/qcsrc/server/ipban.qc b/qcsrc/server/ipban.qc index 77bc1d6a2..b40a1e3a2 100644 --- a/qcsrc/server/ipban.qc +++ b/qcsrc/server/ipban.qc @@ -317,17 +317,26 @@ void Ban_LoadBans() void Ban_View() { - float i; + float i, n; string msg; + + print("^2Listing all existing active bans:\n"); + for(i = 0; i < ban_count; ++i) { if(time > ban_expire[i]) continue; + + ++n; // total number of existing bans + msg = strcat("#", ftos(i), ": "); msg = strcat(msg, ban_ip[i], " is still banned for "); msg = strcat(msg, ftos(ban_expire[i] - time), " seconds"); - print(msg, "\n"); + + print(" ", msg, "\n"); } + + print("^2Done listing all active (", ftos(n), ") bans.\n"); } float Ban_GetClientIP(entity client)