netserver/Miscutils.hs
changeset 1484 c01512115c12
parent 1478 8bfb417d165e
child 1491 0b1f44751509
equal deleted inserted replaced
1483:89e24edb6020 1484:c01512115c12
    88 clientByHandle chandle clients = find (\c -> handle c == chandle) clients
    88 clientByHandle chandle clients = find (\c -> handle c == chandle) clients
    89 
    89 
    90 sameRoom :: HandlesSelector
    90 sameRoom :: HandlesSelector
    91 sameRoom client clients rooms = map handle $ filter (\ci -> room ci == room client) clients
    91 sameRoom client clients rooms = map handle $ filter (\ci -> room ci == room client) clients
    92 
    92 
       
    93 noRoomSameProto :: HandlesSelector
       
    94 noRoomSameProto client clients _ = map handle $ filter (null . room) $ filter (\ci -> protocol client == protocol ci) clients
       
    95 
    93 othersInRoom :: HandlesSelector
    96 othersInRoom :: HandlesSelector
    94 othersInRoom client clients rooms = map handle $ filter (client /=) $ filter (\ci -> room ci == room client) clients
    97 othersInRoom client clients rooms = map handle $ filter (client /=) $ filter (\ci -> room ci == room client) clients
    95 
    98 
    96 fromRoom :: String -> HandlesSelector
    99 fromRoom :: String -> HandlesSelector
    97 fromRoom roomName _ clients _ = map handle $ filter (\ci -> room ci == roomName) clients
   100 fromRoom roomName _ clients _ = map handle $ filter (\ci -> room ci == roomName) clients