gameServer/HWProtoInRoomState.hs
changeset 3579 f5d28402ca1d
parent 3577 0ef6f5182a75
child 3655 1ae653467897
equal deleted inserted replaced
3577:0ef6f5182a75 3579:f5d28402ca1d
   181         return []
   181         return []
   182     where
   182     where
   183         enoughClans = not . null . drop 1 . group . map teamcolor . teams
   183         enoughClans = not . null . drop 1 . group . map teamcolor . teams
   184 
   184 
   185 
   185 
       
   186 handleCmd_inRoom ["EM", msg] = do
       
   187     cl <- thisClient
       
   188     r <- thisRoom
       
   189     chans <- roomOthersChans
       
   190     
       
   191     if (teamsInGame cl > 0) && isLegal then
       
   192         return $ (AnswerClients chans ["EM", msg]) : [ModifyRoom (\r -> r{roundMsgs = roundMsgs r |> msg}) | not isKeepAlive]
       
   193         else
       
   194         return []
       
   195     where
       
   196         (isLegal, isKeepAlive) = checkNetCmd msg
       
   197 
   186 {-
   198 {-
   187 handleCmd_inRoom clID clients rooms ["EM", msg] =
       
   188     if (teamsInGame client > 0) && isLegal then
       
   189         (AnswerOthersInRoom ["EM", msg]) : [ModifyRoom (\r -> r{roundMsgs = roundMsgs r |> msg}) | not isKeepAlive]
       
   190     else
       
   191         []
       
   192     where
       
   193         client = clients IntMap.! clID
       
   194         (isLegal, isKeepAlive) = checkNetCmd msg
       
   195 
       
   196 handleCmd_inRoom clID clients rooms ["ROUNDFINISHED"] =
   199 handleCmd_inRoom clID clients rooms ["ROUNDFINISHED"] =
   197     if isMaster client then
   200     if isMaster client then
   198         [ModifyRoom
   201         [ModifyRoom
   199                 (\r -> r{
   202                 (\r -> r{
   200                     gameinprogress = False,
   203                     gameinprogress = False,