gameServer/HWProtoCore.hs
changeset 8479 8d71109b04d2
parent 8478 d12531f09d59
child 8519 98e2dbdda8c0
equal deleted inserted replaced
8478:d12531f09d59 8479:8d71109b04d2
     9 import CoreTypes
     9 import CoreTypes
    10 import Actions
    10 import Actions
    11 import HWProtoNEState
    11 import HWProtoNEState
    12 import HWProtoLobbyState
    12 import HWProtoLobbyState
    13 import HWProtoInRoomState
    13 import HWProtoInRoomState
       
    14 import HWProtoChecker
    14 import HandlerUtils
    15 import HandlerUtils
    15 import RoomsAndClients
    16 import RoomsAndClients
    16 import Utils
    17 import Utils
    17 
    18 
    18 handleCmd, handleCmd_loggedin :: CmdHandler
    19 handleCmd, handleCmd_loggedin :: CmdHandler
    46         h ["QUIT", msg] = handleCmd ["QUIT", msg]
    47         h ["QUIT", msg] = handleCmd ["QUIT", msg]
    47         h c = return [Warning . B.concat . L.intersperse " " $ "Unknown cmd" : c]
    48         h c = return [Warning . B.concat . L.intersperse " " $ "Unknown cmd" : c]
    48 
    49 
    49 handleCmd cmd = do
    50 handleCmd cmd = do
    50     (ci, irnc) <- ask
    51     (ci, irnc) <- ask
    51     if logonPassed (irnc `client` ci) then
    52     let cl = irnc `client` ci
    52         handleCmd_loggedin cmd
    53     if logonPassed cl then
       
    54         if isChecker cl then
       
    55             handleCmd_checker cmd
       
    56             else
       
    57             handleCmd_loggedin cmd
    53         else
    58         else
    54         handleCmd_NotEntered cmd
    59         handleCmd_NotEntered cmd
    55 
    60 
    56 
    61 
    57 handleCmd_loggedin ["INFO", asknick] = do
    62 handleCmd_loggedin ["INFO", asknick] = do