gameServer/Actions.hs
changeset 8479 8d71109b04d2
parent 8476 61d7269f16be
child 8482 5656a73fe3c3
equal deleted inserted replaced
8478:d12531f09d59 8479:8d71109b04d2
    75     | AddNick2Bans B.ByteString B.ByteString UTCTime
    75     | AddNick2Bans B.ByteString B.ByteString UTCTime
    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 
    81 
    81 
    82 
    82 type CmdHandler = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action]
    83 type CmdHandler = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action]
    83 
    84 
    84 instance NFData Action where
    85 instance NFData Action where
   668     rnc <- gets roomsClients
   669     rnc <- gets roomsClients
   669 
   670 
   670     io $ do
   671     io $ do
   671         r <- room'sM rnc id ri
   672         r <- room'sM rnc id ri
   672         saveReplay r
   673         saveReplay r
       
   674 
       
   675 
       
   676 processAction CheckRecord = do
       
   677     p <- client's clientProto
       
   678     c <- client's clChan
       
   679     l <- loadReplay p
       
   680     when (not $ null l) $
       
   681         processAction $ AnswerClients [c] ("REPLAY" : l)
       
   682 
       
   683 
   673 #else
   684 #else
   674 processAction SaveReplay = return ()
   685 processAction SaveReplay = return ()
       
   686 processAction CheckRecord = return ()
   675 #endif
   687 #endif