gameServer/HWProtoInRoomState.hs
changeset 7537 833a0c34fafc
parent 7321 57bd4f201401
child 7757 c20e6c80e249
--- a/gameServer/HWProtoInRoomState.hs	Mon Aug 13 23:04:42 2012 +0400
+++ b/gameServer/HWProtoInRoomState.hs	Mon Aug 13 23:17:09 2012 +0400
@@ -278,6 +278,14 @@
     where
         engineMsg cl = toEngineMsg $ B.concat ["b", nick cl, "(team): ", msg, "\x20\x20"]
 
+handleCmd_inRoom ["BAN", banNick] = do
+    (_, rnc) <- ask
+    maybeClientId <- clientByNick banNick
+    let banId = fromJust maybeClientId
+    master <- liftM isMaster thisClient
+    return [ModifyRoom (\r -> r{roomBansList = (host $ rnc `client` banId) : roomBansList r}) | master && isJust maybeClientId]
+
+
 handleCmd_inRoom ["LIST"] = return [] -- for old clients (<= 0.9.17)
 
 handleCmd_inRoom (s:_) = return [ProtocolError $ "Incorrect command '" `B.append` s `B.append` "' (state: in room)"]