]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix banning
authorRudolf Polzer <divverent@xonotic.org>
Fri, 17 Feb 2012 18:59:08 +0000 (19:59 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 17 Feb 2012 18:59:08 +0000 (19:59 +0100)
qcsrc/server/ipban.qc

index 2034b27dca1e285ce8f06db62f7e62e3c4aad5ac..9965113f67474bee4e6cc878cc9f11c04b34fef5 100644 (file)
@@ -553,31 +553,39 @@ float Ban_Insert(string ip, float bantime, string reason, float dosync)
 
 void Ban_KickBanClient(entity client, float bantime, float masksize, string reason)
 {
+       string ip, id;
        if(!Ban_GetClientIP(client))
        {
                sprint(client, strcat("Kickbanned: ", reason, "\n"));
                dropclient(client);
                return;
        }
-       // now ban him
+
+       // who to ban?
        switch(masksize)
        {
                case 1:
-                       Ban_Insert(ban_ip1, bantime, reason, 1);
+                       ip = ban_ip1;
                        break;
                case 2:
-                       Ban_Insert(ban_ip2, bantime, reason, 1);
+                       ip = ban_ip2;
                        break;
                case 3:
-                       Ban_Insert(ban_ip3, bantime, reason, 1);
+                       ip = ban_ip3;
                        break;
                case 4:
                default:
-                       Ban_Insert(ban_ip4, bantime, reason, 1);
+                       ip = ban_ip4;
                        break;
        }
        if(ban_idfp)
-               Ban_Insert(ban_idfp, bantime, reason, 1);
+               id = ban_idfp;
+       else
+               id = string_null;
+
+       Ban_Insert(ip, bantime, reason, 1);
+       if(id)
+               Ban_Insert(id, bantime, reason, 1);
        /*
         * not needed, as we enforce the ban in Ban_Insert anyway
        // and kick him