gameServer/HWProtoInRoomState.hs
changeset 7537 833a0c34fafc
parent 7321 57bd4f201401
child 7757 c20e6c80e249
equal deleted inserted replaced
7535:87e5838103ff 7537:833a0c34fafc
   276     chans <- roomSameClanChans
   276     chans <- roomSameClanChans
   277     return [AnswerClients chans ["EM", engineMsg cl]]
   277     return [AnswerClients chans ["EM", engineMsg cl]]
   278     where
   278     where
   279         engineMsg cl = toEngineMsg $ B.concat ["b", nick cl, "(team): ", msg, "\x20\x20"]
   279         engineMsg cl = toEngineMsg $ B.concat ["b", nick cl, "(team): ", msg, "\x20\x20"]
   280 
   280 
       
   281 handleCmd_inRoom ["BAN", banNick] = do
       
   282     (_, rnc) <- ask
       
   283     maybeClientId <- clientByNick banNick
       
   284     let banId = fromJust maybeClientId
       
   285     master <- liftM isMaster thisClient
       
   286     return [ModifyRoom (\r -> r{roomBansList = (host $ rnc `client` banId) : roomBansList r}) | master && isJust maybeClientId]
       
   287 
       
   288 
   281 handleCmd_inRoom ["LIST"] = return [] -- for old clients (<= 0.9.17)
   289 handleCmd_inRoom ["LIST"] = return [] -- for old clients (<= 0.9.17)
   282 
   290 
   283 handleCmd_inRoom (s:_) = return [ProtocolError $ "Incorrect command '" `B.append` s `B.append` "' (state: in room)"]
   291 handleCmd_inRoom (s:_) = return [ProtocolError $ "Incorrect command '" `B.append` s `B.append` "' (state: in room)"]
   284 
   292 
   285 handleCmd_inRoom [] = return [ProtocolError "Empty command (state: in room)"]
   293 handleCmd_inRoom [] = return [ProtocolError "Empty command (state: in room)"]