gameServer/HWProtoChecker.hs
changeset 8507 f4475782cf45
parent 8479 8d71109b04d2
child 9109 878f06e9c484
equal deleted inserted replaced
8506:3889dab021b8 8507:f4475782cf45
    16 
    16 
    17 handleCmd_checker :: CmdHandler
    17 handleCmd_checker :: CmdHandler
    18 
    18 
    19 handleCmd_checker ["READY"] = return [CheckRecord]
    19 handleCmd_checker ["READY"] = return [CheckRecord]
    20 
    20 
       
    21 handleCmd_checker ["CHECKED", "FAIL", msg] = do
       
    22     isChecking <- liftM (isJust . checkInfo) thisClient
       
    23     if not isChecking then
       
    24         return []
       
    25         else
       
    26         return [CheckFailed msg, ModifyClient $ \c -> c{checkInfo = Nothing}]
       
    27 
       
    28 
       
    29 handleCmd_checker ("CHECKED" : "OK" : info) = do
       
    30     isChecking <- liftM (isJust . checkInfo) thisClient
       
    31     if not isChecking then
       
    32         return []
       
    33         else
       
    34         return [CheckSuccess info, ModifyClient $ \c -> c{checkInfo = Nothing}]
       
    35 
    21 handleCmd_checker _ = return [ProtocolError "Unknown command"]
    36 handleCmd_checker _ = return [ProtocolError "Unknown command"]