Don't add ip ban with new timestamp when user gets kicked due to ban
authorunc0rr
Sun, 13 Mar 2011 20:25:44 +0300
changeset 5008 af9e4a66111b
parent 5007 c401891fe5e0
child 5009 12135f659bf1
Don't add ip ban with new timestamp when user gets kicked due to ban
gameServer/Actions.hs
--- a/gameServer/Actions.hs	Sun Mar 13 20:21:27 2011 +0300
+++ b/gameServer/Actions.hs	Sun Mar 13 20:25:44 2011 +0300
@@ -411,10 +411,13 @@
 
 
 processAction (AddNick2Bans n reason expiring) = do
-        processAction $ ModifyServerInfo (\s -> s{bans = BanByNick n reason expiring : bans s})
+    processAction $ ModifyServerInfo (\s -> s{bans = BanByNick n reason expiring : bans s})
 
 processAction (AddIP2Bans ip reason expiring) = do
-        processAction $ ModifyServerInfo (\s -> s{bans = BanByIP ip reason expiring : bans s})
+    (Just ci) <- gets clientIndex
+    rc <- gets removedClients
+    when (not $ ci `Set.member` rc)
+        $ processAction $ ModifyServerInfo (\s -> s{bans = BanByIP ip reason expiring : bans s})
 
 processAction CheckBanned = do
     clTime <- client's connectTime