gameServer/Actions.hs
changeset 8507 f4475782cf45
parent 8482 5656a73fe3c3
child 8509 eda9f2106d8d
equal deleted inserted replaced
8506:3889dab021b8 8507:f4475782cf45
    76     | AddIP2Bans B.ByteString B.ByteString UTCTime
    76     | AddIP2Bans B.ByteString B.ByteString UTCTime
    77     | CheckBanned Bool
    77     | CheckBanned Bool
    78     | SaveReplay
    78     | SaveReplay
    79     | Stats
    79     | Stats
    80     | CheckRecord
    80     | CheckRecord
       
    81     | CheckFailed B.ByteString
       
    82     | CheckSuccess [B.ByteString]
    81 
    83 
    82 
    84 
    83 type CmdHandler = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action]
    85 type CmdHandler = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action]
    84 
    86 
    85 instance NFData Action where
    87 instance NFData Action where
   679     l <- io $ loadReplay (fromIntegral p)
   681     l <- io $ loadReplay (fromIntegral p)
   680     when (not $ null l) $
   682     when (not $ null l) $
   681         processAction $ AnswerClients [c] ("REPLAY" : l)
   683         processAction $ AnswerClients [c] ("REPLAY" : l)
   682 
   684 
   683 
   685 
       
   686 processAction CheckRecord = do
       
   687     p <- client's clientProto
       
   688     c <- client's sendChan
       
   689     l <- io $ loadReplay (fromIntegral p)
       
   690     when (not $ null l) $
       
   691         processAction $ AnswerClients [c] ("REPLAY" : l)
       
   692 
       
   693 processAction (CheckFailed msg) = return ()
       
   694 
       
   695 processAction (CheckSuccess info) = return ()
       
   696 
   684 #else
   697 #else
   685 processAction SaveReplay = return ()
   698 processAction SaveReplay = return ()
   686 processAction CheckRecord = return ()
   699 processAction CheckRecord = return ()
       
   700 processAction (CheckFailed _) = return ()
       
   701 processAction (CheckSuccess _) = return ()
   687 #endif
   702 #endif