rust/hedgewars-server/src/server/handlers/lobby.rs
changeset 14509 6cc0fce249f9
parent 14462 98ef2913ec73
child 14676 455865ccd36c
--- a/rust/hedgewars-server/src/server/handlers/lobby.rs	Thu Dec 27 23:43:54 2018 +0100
+++ b/rust/hedgewars-server/src/server/handlers/lobby.rs	Fri Dec 28 03:10:05 2018 +0300
@@ -27,9 +27,20 @@
                     "+hr".to_string(),
                     vec![server.clients[client_id].nick.clone()],
                 );
-                vec![AddRoom(name, password), flags_msg.send_self().action()]
+
+                let room_id = server.create_room(client_id, name, password);
+                let room = &server.rooms[room_id];
+                let client = &server.clients[client_id];
+
+                vec![
+                    RoomAdd(room.info(Some(&client)))
+                        .send_all()
+                        .with_protocol(room.protocol_number)
+                        .action(),
+                    flags_msg.send_self().action(),
+                ]
             };
-            server.react(client_id, actions);
+            server.react(client_id, actions)
         }
         Chat(msg) => {
             let actions = vec![ChatMsg {