netserver/Miscutils.hs
changeset 1591 1db9b654f880
parent 1578 f02806f66e00
child 1598 c853e02ed663
equal deleted inserted replaced
1590:646d56eacb8f 1591:1db9b654f880
   124 --clientByHandle chandle clients = find (\c -> handle c == chandle) clients
   124 --clientByHandle chandle clients = find (\c -> handle c == chandle) clients
   125 
   125 
   126 sameRoom :: HandlesSelector
   126 sameRoom :: HandlesSelector
   127 sameRoom client clients rooms = filter (\ci -> room ci == room client) clients
   127 sameRoom client clients rooms = filter (\ci -> room ci == room client) clients
   128 
   128 
       
   129 sameProtoLobbyClients :: HandlesSelector
       
   130 sameProtoLobbyClients client clients rooms = filter (\ci -> room ci == [] && protocol ci == protocol client) clients
       
   131 
   129 noRoomSameProto :: HandlesSelector
   132 noRoomSameProto :: HandlesSelector
   130 noRoomSameProto client clients _ = filter (null . room) $ filter (\ci -> protocol client == protocol ci) clients
   133 noRoomSameProto client clients _ = filter (null . room) $ filter (\ci -> protocol client == protocol ci) clients
   131 
   134 
   132 othersInRoom :: HandlesSelector
   135 othersInRoom :: HandlesSelector
   133 othersInRoom client clients rooms = filter (client /=) $ filter (\ci -> room ci == room client) clients
   136 othersInRoom client clients rooms = filter (client /=) $ filter (\ci -> room ci == room client) clients