Show others if spectator is in game flibqtfrontend
authorunc0rr
Wed, 05 Dec 2012 23:55:22 +0400
branchflibqtfrontend
changeset 8233 d3966a555e5e
parent 8230 bd4b8f9488a4
child 8236 6984e15bb8f6
Show others if spectator is in game
gameServer/HWProtoLobbyState.hs
--- a/gameServer/HWProtoLobbyState.hs	Wed Dec 05 23:51:04 2012 +0400
+++ b/gameServer/HWProtoLobbyState.hs	Wed Dec 05 23:55:22 2012 +0400
@@ -96,7 +96,7 @@
             ++ (if clientProto cl < 38 then map (readynessMessage cl) jRoomClients else [sendStateFlags cl jRoomClients])
             ++ answerFullConfig cl (mapParams jRoom) (params jRoom)
             ++ answerTeams cl jRoom
-            ++ watchRound cl jRoom
+            ++ watchRound cl jRoom chans
 
         where
         readynessMessage cl c = AnswerClients [sendChan cl] [if isReady c then "READY" else "NOT_READY", nick c]
@@ -122,11 +122,13 @@
 
         answerTeams cl jRoom = let f = if isJust $ gameInfo jRoom then teamsAtStart . fromJust . gameInfo else teams in answerAllTeams cl $ f jRoom
 
-        watchRound cl jRoom = if isNothing $ gameInfo jRoom then
+        watchRound cl jRoom chans = if isNothing $ gameInfo jRoom then
                     []
                 else
-                    [AnswerClients [sendChan cl]  ["RUN_GAME"],
-                    AnswerClients [sendChan cl] $ "EM" : toEngineMsg "e$spectate 1" : Foldable.toList (roundMsgs . fromJust . gameInfo $ jRoom)]
+                    [AnswerClients [sendChan cl]  ["RUN_GAME"]
+                    , AnswerClients chans ["CLIENT_FLAGS", "+g", nick cl]
+                    , ModifyClient (\c -> c{isInGame = True})
+                    , AnswerClients [sendChan cl] $ "EM" : toEngineMsg "e$spectate 1" : Foldable.toList (roundMsgs . fromJust . gameInfo $ jRoom)]
 
 
 handleCmd_lobby ["JOIN_ROOM", roomName] =