--- 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 ()