equal
deleted
inserted
replaced
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 |