Server /watch: Add back KICKED for old clients, remove REPLAY_START parameter
authorWuzzy <Wuzzy2@mail.ru>
Fri, 10 May 2019 23:24:56 +0200
changeset 14905 6b591186ab10
parent 14904 6b69e97dce43
child 14906 8b5d06749026
Server /watch: Add back KICKED for old clients, remove REPLAY_START parameter
gameServer/Actions.hs
--- a/gameServer/Actions.hs	Fri May 10 22:54:23 2019 +0200
+++ b/gameServer/Actions.hs	Fri May 10 23:24:56 2019 +0200
@@ -834,13 +834,24 @@
     let (teams', params1, params2, roundMsgs') = fromJust cInfo
 
     when (isJust cInfo) $ do
-        mapM_ processAction $ concat [
-            [AnswerClients [c] [if clientProto cl < 58 then "JOINED" else "REPLAY_START", nick cl]]
-            , answerFullConfigParams cl params1 params2
-            , answerAllTeams cl teams'
-            , [AnswerClients [c]  ["RUN_GAME"]]
-            , [AnswerClients [c] $ "EM" : roundMsgs']
-            ]
+        mapM_ processAction $
+            if clientProto cl < 58 then
+                concat [
+                    [AnswerClients [c] ["JOINED", nick cl]]
+                    , answerFullConfigParams cl params1 params2
+                    , answerAllTeams cl teams'
+                    , [AnswerClients [c]  ["RUN_GAME"]]
+                    , [AnswerClients [c] $ "EM" : roundMsgs']
+                    , [AnswerClients [c] ["KICKED"]]
+                ]
+            else
+                concat [
+                    [AnswerClients [c] ["REPLAY_START"]]
+                    , answerFullConfigParams cl params1 params2
+                    , answerAllTeams cl teams'
+                    , [AnswerClients [c]  ["RUN_GAME"]]
+                    , [AnswerClients [c] $ "EM" : roundMsgs']
+                ]
 
 processAction (SaveRoom rname) = do
     rnc <- gets roomsClients