60 seconds cooldown ban on kick
authorunc0rr
Sun, 22 May 2011 19:44:53 +0400
changeset 5214 d2ad737891b0
parent 5213 a86768368309
child 5215 d4c529624460
60 seconds cooldown ban on kick
gameServer/Actions.hs
--- a/gameServer/Actions.hs	Tue May 17 19:05:13 2011 -0400
+++ b/gameServer/Actions.hs	Sun May 22 19:44:53 2011 +0400
@@ -381,7 +381,12 @@
 
 processAction (KickClient kickId) = do
     modify (\s -> s{clientIndex = Just kickId})
-    processAction $ ByeClient "Kicked"
+    clHost <- client's host
+    currentTime <- io getCurrentTime
+    mapM_ processAction [
+        AddIP2Bans clHost "60 seconds cooldown after kick" (addUTCTime 60 currentTime),
+        ByeClient "Kicked"
+        ]
 
 
 processAction (BanClient seconds reason banId) = do