gameServer/OfficialServer/checker.hs
changeset 8479 8d71109b04d2
parent 8474 f6abe50095d2
child 8497 c5605c6f5bb3
equal deleted inserted replaced
8478:d12531f09d59 8479:8d71109b04d2
    70     answer :: [B.ByteString] -> IO ()
    70     answer :: [B.ByteString] -> IO ()
    71     answer p = do
    71     answer p = do
    72         debugM "Network" $ "Send: " ++ show p
    72         debugM "Network" $ "Send: " ++ show p
    73         sendAll s $ B.unlines p `B.snoc` '\n'
    73         sendAll s $ B.unlines p `B.snoc` '\n'
    74     onPacket :: [B.ByteString] -> IO ()
    74     onPacket :: [B.ByteString] -> IO ()
    75     onPacket ("CONNECTED":_) = answer ["CHECKER", protocolNumber, l, p]
    75     onPacket ("CONNECTED":_) = do
       
    76         answer ["CHECKER", protocolNumber, l, p]
       
    77         answer ["READY"]
    76     onPacket ["PING"] = answer ["PONG"]
    78     onPacket ["PING"] = answer ["PONG"]
    77     onPacket ("BYE" : xs) = error $ show xs
    79     onPacket ("BYE" : xs) = error $ show xs
    78     onPacket _ = return ()
    80     onPacket _ = return ()
    79 
    81 
    80 
    82