25 | UnreadyRoomClients |
25 | UnreadyRoomClients |
26 | MoveToLobby |
26 | MoveToLobby |
27 | ProtocolError String |
27 | ProtocolError String |
28 | Warning String |
28 | Warning String |
29 | ByeClient String |
29 | ByeClient String |
|
30 | KickClient Int -- clID |
30 | ModifyClient (ClientInfo -> ClientInfo) |
31 | ModifyClient (ClientInfo -> ClientInfo) |
31 | ModifyRoom (RoomInfo -> RoomInfo) |
32 | ModifyRoom (RoomInfo -> RoomInfo) |
32 | AddRoom String String |
33 | AddRoom String String |
33 | CheckRegistered |
34 | CheckRegistered |
34 | ProcessAccountInfo AccountInfo |
35 | ProcessAccountInfo AccountInfo |
35 | Dump |
36 | Dump |
36 |
37 |
37 type CmdHandler = Int -> Clients -> Rooms -> [String] -> [Action] |
38 type CmdHandler = Int -> Clients -> Rooms -> [String] -> [Action] |
38 |
39 |
|
40 replaceID a (b, c, d, e) = (a, c, d, e) |
39 |
41 |
40 processAction :: (Int, ServerInfo, Clients, Rooms) -> Action -> IO (Int, ServerInfo, Clients, Rooms) |
42 processAction :: (Int, ServerInfo, Clients, Rooms) -> Action -> IO (Int, ServerInfo, Clients, Rooms) |
41 |
43 |
42 |
44 |
43 processAction (clID, serverInfo, clients, rooms) (AnswerThisClient msg) = do |
45 processAction (clID, serverInfo, clients, rooms) (AnswerThisClient msg) = do |