gameServer/HandlerUtils.hs
changeset 6541 08ed346ed341
parent 4989 4771fed9272e
child 9109 878f06e9c484
--- a/gameServer/HandlerUtils.hs	Thu Dec 29 09:40:16 2011 +0100
+++ b/gameServer/HandlerUtils.hs	Thu Dec 29 23:02:40 2011 +0300
@@ -48,6 +48,12 @@
     (ci, rnc) <- ask
     return [sendChan (rnc `client` ci)]
 
+sameProtoChans :: Reader (ClientIndex, IRnC) [ClientChan]
+sameProtoChans = do
+    (ci, rnc) <- ask
+    let p = clientProto (rnc `client` ci)
+    return . map sendChan . filter (\c -> clientProto c == p) . map (client rnc) $ allClients rnc
+
 answerClient :: [B.ByteString] -> Reader (ClientIndex, IRnC) [Action]
 answerClient msg = liftM ((: []) . flip AnswerClients msg) thisClientChans