gameServer/Actions.hs
changeset 8509 eda9f2106d8d
parent 8507 f4475782cf45
child 8510 0a39b2f9c748
--- a/gameServer/Actions.hs	Sun Feb 17 00:25:53 2013 +0400
+++ b/gameServer/Actions.hs	Mon Feb 18 00:22:13 2013 +0400
@@ -678,21 +678,20 @@
 processAction CheckRecord = do
     p <- client's clientProto
     c <- client's sendChan
-    l <- io $ loadReplay (fromIntegral p)
-    when (not $ null l) $
-        processAction $ AnswerClients [c] ("REPLAY" : l)
-
+    (cinfo, l) <- io $ loadReplay (fromIntegral p)
+    when (not . null $ l) $
+        mapM_ processAction [
+            AnswerClients [c] ("REPLAY" : l)
+            , ModifyClient $ \c -> c{checkInfo = cinfo}
+            ]
 
-processAction CheckRecord = do
-    p <- client's clientProto
-    c <- client's sendChan
-    l <- io $ loadReplay (fromIntegral p)
-    when (not $ null l) $
-        processAction $ AnswerClients [c] ("REPLAY" : l)
+processAction (CheckFailed msg) = do
+    Just (CheckInfo fileName _) <- client's checkInfo
+    io $ moveFailedRecord fileName
 
-processAction (CheckFailed msg) = return ()
-
-processAction (CheckSuccess info) = return ()
+processAction (CheckSuccess info) = do
+    Just (CheckInfo fileName _) <- client's checkInfo
+    io $ moveCheckedRecord fileName
 
 #else
 processAction SaveReplay = return ()