Compare commits

...
Author SHA1 Message Date
Ludovic MarieandClaude Opus 5.5 85bfd116a7 Server: the newcomer doesn't read its own join line, as in vanilla
PlayerList.placeNewPlayer calls broadcastSystemMessage before players.add,
so the joining player isn't in the list yet and never gets its own
"joined the game". #4634 sent it to the newcomer too, which the
dedicated_server harness (the real 26.3 server's packets) shows as an
extra system_chat at play start. Back to the others only, at the same
point as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 04:02:20 +01:00
+9 -6
View File
@@ -823,6 +823,15 @@ impl Hub {
// PlayerList.sendPlayerPermissionLevel, then the recipe book.
self.send_permission_level(i);
self.send_initial_recipe_book(i);
// PlayerList.placeNewPlayer calls broadcastSystemMessage before it adds the player to the
// list: the others read the join line, the newcomer doesn't.
self.broadcast_except(
conn,
&C::SystemChat(play::SystemChat {
content: yellow_names("multiplayer.player.joined", vec![display_name(uuid, &name)]),
overlay: false,
}),
);
self.guests[i].placed = true;
self.resend_teleport(i, None);
let g = &self.guests[i];
@@ -866,12 +875,6 @@ impl Hub {
// ServerPlayer.sendPostEffects and initInventoryMenu.
self.send_post_effects(i);
self.send_inventory(i);
// PlayerList.placeNewPlayer adds the player to the list, then calls
// broadcastSystemMessage: the newcomer reads its own join line too.
self.system_message(yellow_names(
"multiplayer.player.joined",
vec![display_name(uuid, &name)],
));
}
/// `ServerPlayer.sendPostEffects`: the player's `/posteffect` chains.