]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add proper usage support for bans plus also show total number of bans and such prints...
authorSamual <samual@xonotic.org>
Fri, 30 Dec 2011 04:53:07 +0000 (23:53 -0500)
committerSamual <samual@xonotic.org>
Fri, 30 Dec 2011 04:53:07 +0000 (23:53 -0500)
qcsrc/server/command/sv_cmd.qc
qcsrc/server/ipban.qc

index 7c234002d7f19ec0916187a6abffd23600c05081..8cfaf3884550baafef93c10a4c996565892a55a4 100644 (file)
@@ -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;
                }
index 77bc1d6a20c612334a5b3c8f92c987b7dbce603c..b40a1e3a289ad682f95cfe8a96b35e83d84a9aa3 100644 (file)
@@ -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)