fix room joining
authoralfadur
Thu, 28 Mar 2024 00:17:01 +0300
changeset 16003 abea7f16a03b
parent 16002 e915ed28726e
child 16004 2871fc57a282
fix room joining
rust/hedgewars-server/src/handlers/common.rs
--- a/rust/hedgewars-server/src/handlers/common.rs	Wed Mar 27 02:57:44 2024 +0300
+++ b/rust/hedgewars-server/src/handlers/common.rs	Thu Mar 28 00:17:01 2024 +0300
@@ -140,7 +140,15 @@
             .but_self(),
     );
     response.add(ClientFlags(add_flags(&[Flags::InRoom]), vec![nick.clone()]).send_all());
-    let nicks = room_clients.clone().map(|c| c.nick.clone()).collect();
+    let nicks = once(nick.clone())
+        .chain(
+            room_clients
+                .clone()
+                .filter(|c| c.id != client.id)
+                .map(|c| c.nick.clone()),
+        )
+        .collect();
+
     response.add(RoomJoined(nicks).send_self());
 
     let mut flag_selectors = [