gameServer/Actions.hs
changeset 3656 c74a4a407146
parent 3654 18189fbc7530
child 3658 113cb9345be1
equal deleted inserted replaced
3655:1ae653467897 3656:c74a4a407146
   275     where
   275     where
   276         room = rooms ! rID
   276         room = rooms ! rID
   277         rID = roomID client
   277         rID = roomID client
   278         client = clients ! clID
   278         client = clients ! clID
   279 
   279 
   280 
   280 -}
   281 processAction (clID, serverInfo, rnc) (UnreadyRoomClients) = do
   281 processAction (UnreadyRoomClients) = do
   282     processAction (clID, serverInfo, rnc) $ AnswerThisRoom ("NOT_READY" : roomPlayers)
   282     rnc <- gets roomsClients
   283     return (clID,
   283     ri <- clientRoomA
   284         serverInfo,
   284     roomPlayers <- roomClientsS ri
   285         Data.IntMap.map (\cl -> if roomID cl == rID then cl{isReady = False} else cl) clients,
   285     roomClIDs <- liftIO $ roomClientsIndicesM rnc ri
   286         adjust (\r -> r{readyPlayers = 0}) rID rooms)
   286     processAction $ AnswerClients (map sendChan roomPlayers) ("NOT_READY" : map nick roomPlayers)
   287     where
   287     liftIO $ mapM_ (modifyClient rnc (\cl -> cl{isReady = False})) roomClIDs
   288         room = rooms ! rID
   288     processAction $ ModifyRoom (\r -> r{readyPlayers = 0})
   289         rID = roomID client
   289 
   290         client = clients ! clID
       
   291         roomPlayers = Prelude.map (nick . (clients !)) roomPlayersIDs
       
   292         roomPlayersIDs = IntSet.elems $ playersIDs room
       
   293 
       
   294 -}
       
   295 
   290 
   296 processAction (RemoveTeam teamName) = do
   291 processAction (RemoveTeam teamName) = do
   297     rnc <- gets roomsClients
   292     rnc <- gets roomsClients
   298     cl <- client's id
   293     cl <- client's id
   299     ri <- clientRoomA
   294     ri <- clientRoomA