gameServer/HandlerUtils.hs
changeset 15909 7409084d891f
parent 15900 fc3cb23fd26f
equal deleted inserted replaced
15908:014f4edd0421 15909:7409084d891f
    67 thisClientChans :: Reader (ClientIndex, IRnC) [ClientChan]
    67 thisClientChans :: Reader (ClientIndex, IRnC) [ClientChan]
    68 thisClientChans = do
    68 thisClientChans = do
    69     (ci, rnc) <- ask
    69     (ci, rnc) <- ask
    70     return [sendChan (rnc `client` ci)]
    70     return [sendChan (rnc `client` ci)]
    71 
    71 
       
    72 thisClientChansProto :: Reader (ClientIndex, IRnC) [(ClientChan, Word16)]
       
    73 thisClientChansProto = do
       
    74     (ci, rnc) <- ask
       
    75     return [(sendChan (rnc `client` ci), clientProto (rnc `client` ci))]
       
    76 
    72 sameProtoChans :: Reader (ClientIndex, IRnC) [ClientChan]
    77 sameProtoChans :: Reader (ClientIndex, IRnC) [ClientChan]
    73 sameProtoChans = do
    78 sameProtoChans = do
    74     (ci, rnc) <- ask
    79     (ci, rnc) <- ask
    75     let p = clientProto (rnc `client` ci)
    80     let p = clientProto (rnc `client` ci)
    76     return . map sendChan . filter (\c -> clientProto c == p) . map (client rnc) $ allClients rnc
    81     return . map sendChan . filter (\c -> clientProto c == p) . map (client rnc) $ allClients rnc