gameServer/Actions.hs
changeset 8507 f4475782cf45
parent 8482 5656a73fe3c3
child 8509 eda9f2106d8d
--- a/gameServer/Actions.hs	Fri Feb 15 00:12:19 2013 +0400
+++ b/gameServer/Actions.hs	Sat Feb 16 23:28:16 2013 +0400
@@ -78,6 +78,8 @@
     | SaveReplay
     | Stats
     | CheckRecord
+    | CheckFailed B.ByteString
+    | CheckSuccess [B.ByteString]
 
 
 type CmdHandler = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action]
@@ -681,7 +683,20 @@
         processAction $ AnswerClients [c] ("REPLAY" : l)
 
 
+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) = return ()
+
+processAction (CheckSuccess info) = return ()
+
 #else
 processAction SaveReplay = return ()
 processAction CheckRecord = return ()
+processAction (CheckFailed _) = return ()
+processAction (CheckSuccess _) = return ()
 #endif