--- a/netserver/Miscutils.hs Mon Nov 03 09:55:30 2008 +0000
+++ b/netserver/Miscutils.hs Mon Nov 03 11:28:41 2008 +0000
@@ -81,6 +81,9 @@
deleteFirstsBy2t :: (a -> b -> Bool) -> [a] -> [b] -> [a]
deleteFirstsBy2t eq = foldl (flip (deleteBy2t eq))
+clientByHandle :: Handle -> [ClientInfo] -> Maybe ClientInfo
+clientByHandle chandle clients = find (\c -> handle c == chandle) clients
+
sameRoom :: HandlesSelector
sameRoom client clients rooms = map handle $ filter (\ci -> room ci == room client) clients