gameServer/Actions.hs
changeset 9433 f0a8ac191839
parent 9401 2af7bea32e5e
child 9435 59eec19cb31a
--- a/gameServer/Actions.hs	Tue Aug 27 17:22:07 2013 +0400
+++ b/gameServer/Actions.hs	Wed Aug 28 23:11:05 2013 +0400
@@ -651,9 +651,17 @@
     ri <- clientRoomA
     rnc <- gets roomsClients
 
-    io $ do
+    allci <- io $ do
         r <- room'sM rnc id ri
         saveReplay r
+        allClientsM rnc
+
+    readyCheckersIds <- liftM (filter (client'sM isReadyChecker rnc)) allClientsS
+    when (not $ null readyCheckersIds) $ do
+        modify (\s -> s{clientIndex = Just $ head readyCheckersIds})
+        processAction CheckRecord
+    where
+        isReadyChecker cl = isChecker cl && isReady cl
 
 
 processAction CheckRecord = do
@@ -666,10 +674,12 @@
             , ModifyClient $ \c -> c{checkInfo = cinfo}
             ]
 
+
 processAction (CheckFailed msg) = do
     Just (CheckInfo fileName _) <- client's checkInfo
     io $ moveFailedRecord fileName
 
+
 processAction (CheckSuccess info) = do
     Just (CheckInfo fileName teams) <- client's checkInfo
     si <- gets serverInfo