equal
deleted
inserted
replaced
46 thisClientChans :: Reader (ClientIndex, IRnC) [ClientChan] |
46 thisClientChans :: Reader (ClientIndex, IRnC) [ClientChan] |
47 thisClientChans = do |
47 thisClientChans = do |
48 (ci, rnc) <- ask |
48 (ci, rnc) <- ask |
49 return [sendChan (rnc `client` ci)] |
49 return [sendChan (rnc `client` ci)] |
50 |
50 |
|
51 sameProtoChans :: Reader (ClientIndex, IRnC) [ClientChan] |
|
52 sameProtoChans = do |
|
53 (ci, rnc) <- ask |
|
54 let p = clientProto (rnc `client` ci) |
|
55 return . map sendChan . filter (\c -> clientProto c == p) . map (client rnc) $ allClients rnc |
|
56 |
51 answerClient :: [B.ByteString] -> Reader (ClientIndex, IRnC) [Action] |
57 answerClient :: [B.ByteString] -> Reader (ClientIndex, IRnC) [Action] |
52 answerClient msg = liftM ((: []) . flip AnswerClients msg) thisClientChans |
58 answerClient msg = liftM ((: []) . flip AnswerClients msg) thisClientChans |
53 |
59 |
54 allRoomInfos :: Reader (a, IRnC) [RoomInfo] |
60 allRoomInfos :: Reader (a, IRnC) [RoomInfo] |
55 allRoomInfos = liftM ((\irnc -> map (room irnc) $ allRooms irnc) . snd) ask |
61 allRoomInfos = liftM ((\irnc -> map (room irnc) $ allRooms irnc) . snd) ask |