netserver/Miscutils.hs
changeset 1466 c68b0a0969d3
parent 1461 87e5a6c3882c
child 1478 8bfb417d165e
--- 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