--- a/gameServer/Actions.hs Fri Nov 30 15:26:49 2012 +0100
+++ b/gameServer/Actions.hs Fri Nov 30 18:43:43 2012 +0400
@@ -52,6 +52,7 @@
| KickRoomClient ClientIndex
| BanClient NominalDiffTime B.ByteString ClientIndex
| BanIP B.ByteString NominalDiffTime B.ByteString
+ | BanNick B.ByteString NominalDiffTime B.ByteString
| BanList
| Unban B.ByteString
| ChangeMaster
@@ -500,6 +501,16 @@
processAction $
AddIP2Bans ip msg (addUTCTime seconds currentTime)
+processAction (BanNick n seconds reason) = do
+ currentTime <- io getCurrentTime
+ let msg =
+ if seconds > 60 * 60 * 24 * 365 then
+ B.concat ["Permanent ban (", reason, ")"]
+ else
+ B.concat ["Ban for ", B.pack . show $ seconds, " (", reason, ")"]
+ processAction $
+ AddNick2Bans n msg (addUTCTime seconds currentTime)
+
processAction BanList = do
ch <- client's sendChan
b <- gets (B.pack . unlines . map show . bans . serverInfo)