rust/hedgewars-server/src/server/handlers.rs
changeset 14928 c156273b57de
parent 14823 a40139603cde
--- a/rust/hedgewars-server/src/server/handlers.rs	Fri May 10 23:30:42 2019 +0200
+++ b/rust/hedgewars-server/src/server/handlers.rs	Sat May 11 00:41:28 2019 +0300
@@ -347,12 +347,22 @@
             response.remove_client(client_id);
         }
         IoResult::Replay(Some(replay)) => {
-            response.add(RoomJoined(vec![server.clients[client_id].nick.clone()]).send_self());
+            let protocol = server.clients[client_id].protocol_number;
+            let start_msg = if protocol < 58 {
+                RoomJoined(vec![server.clients[client_id].nick.clone()])
+            } else {
+                ReplayStart
+            };
+            response.add(start_msg.send_self());
+
             common::get_room_config_impl(&replay.config, client_id, response);
             common::get_teams(replay.teams.iter(), client_id, response);
             response.add(RunGame.send_self());
             response.add(ForwardEngineMessage(replay.message_log).send_self());
-            response.add(Kicked.send_self());
+
+            if protocol < 58 {
+                response.add(Kicked.send_self());
+            }
         }
         IoResult::Replay(None) => {
             response.add(Warning("Could't load the replay".to_string()).send_self())