]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/ipban.qc
Merge remote branch 'origin/terencehill/physics_panel_updates'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / ipban.qc
index b40a1e3a289ad682f95cfe8a96b35e83d84a9aa3..fc889ecf2d0ad9e683e82e2045ab9764b0fa10d9 100644 (file)
@@ -19,6 +19,8 @@
  *     server IP that registered the ban
  */
 
+#define MAX_IPBAN_URIS (URI_GET_IPBAN_END - URI_GET_IPBAN + 1)
+
 float Ban_Insert(string ip, float bantime, string reason, float dosync);
 
 void OnlineBanList_SendBan(string ip, float bantime, string reason)
@@ -551,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 = strcat1(ban_ip1);
                        break;
                case 2:
-                       Ban_Insert(ban_ip2, bantime, reason, 1);
+                       ip = strcat1(ban_ip2);
                        break;
                case 3:
-                       Ban_Insert(ban_ip3, bantime, reason, 1);
+                       ip = strcat1(ban_ip3);
                        break;
                case 4:
                default:
-                       Ban_Insert(ban_ip4, bantime, reason, 1);
+                       ip = strcat1(ban_ip4);
                        break;
        }
        if(ban_idfp)
-               Ban_Insert(ban_idfp, bantime, reason, 1);
+               id = strcat1(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