gameServer/Actions.hs
changeset 9437 8d1e9a9dda8e
parent 9435 59eec19cb31a
child 9439 e0570f2e5f41
child 9440 8a75d5d73787
equal deleted inserted replaced
9435:59eec19cb31a 9437:8d1e9a9dda8e
   657 #if defined(OFFICIAL_SERVER)
   657 #if defined(OFFICIAL_SERVER)
   658 processAction SaveReplay = do
   658 processAction SaveReplay = do
   659     ri <- clientRoomA
   659     ri <- clientRoomA
   660     rnc <- gets roomsClients
   660     rnc <- gets roomsClients
   661 
   661 
   662     allci <- io $ do
   662     readyCheckersIds <- io $ do
   663         r <- room'sM rnc id ri
   663         r <- room'sM rnc id ri
   664         saveReplay r
   664         saveReplay r
   665         allClientsM rnc
   665         allci <- allClientsM rnc
   666 
   666         filterM (client'sM rnc isReadyChecker) allci
   667     readyCheckersIds <- liftM (filter (client'sM isReadyChecker rnc)) allClientsS
   667 
   668     when (not $ null readyCheckersIds) $ do
   668     when (not $ null readyCheckersIds) $ do
   669         modify (\s -> s{clientIndex = Just $ head readyCheckersIds})
   669         modify (\s -> s{clientIndex = Just $ head readyCheckersIds})
   670         processAction CheckRecord
   670         processAction CheckRecord
   671     where
   671     where
   672         isReadyChecker cl = isChecker cl && isReady cl
   672         isReadyChecker cl = isChecker cl && isReady cl