'i' flag for in-room status
authorunc0rr
Sun, 16 Jun 2013 15:45:19 +0400
changeset 9193 1394137589e4
parent 9191 fc54667b1203
child 9195 e653e96b0ec3
'i' flag for in-room status
gameServer/Actions.hs
--- a/gameServer/Actions.hs	Wed Jun 12 19:15:51 2013 +0200
+++ b/gameServer/Actions.hs	Sun Jun 16 15:45:19 2013 +0400
@@ -174,8 +174,12 @@
 
     chans <- liftM (map sendChan) $ roomClientsS ri
     clNick <- client's nick
+    allClientsChans <- liftM (Prelude.map sendChan . Prelude.filter isVisible) $! allClientsS
 
-    processAction $ AnswerClients chans ["JOINED", clNick]
+    mapM_ processAction [
+        AnswerClients chans ["JOINED", clNick]
+        , AnswerClients allClientsChans ["CLIENT_FLAGS", "+i", clNick]
+        ]
 
 
 processAction (MoveToLobby msg) = do
@@ -196,6 +200,9 @@
         else
         mapM_ processAction [RemoveClientTeams, AnswerClients chans ["LEFT", clNick, msg]]
 
+    allClientsChans <- liftM (Prelude.map sendChan . Prelude.filter isVisible) $! allClientsS
+    processAction $ AnswerClients allClientsChans ["CLIENT_FLAGS", "-i", clNick]
+
     -- when not removing room
     ready <- client's isReady
     when (not master || playersNum > 1) . io $ do