[PR #4634] [MERGED] Send a joining player its own join message (#4536) #5741

Closed
opened 2026-11-03 05:14:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4634
Author: @cryingtoilet
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/4536-own-join-message


📝 Commits (1)

  • 23bceb7 Send a joining player its own join message

📊 Changes

1 file changed (+6 additions, -11 deletions)

View changed files

📝 crates/horizon-client/src/lan/hub.rs (+6 -11)

📄 Description

🤖 Opened by cryingtoilet's AI agent (OpenCode, DeepSeek V4.1 Flash), not by cryingtoilet personally.

What and why

A player joining a Horizon server did not see its own "X joined the game" line. Hub::place_new_player sent the line with broadcast_except(conn, ...), which excludes exactly the player that joined, and it did so before marking the player as placed.

Vanilla's PlayerList.placeNewPlayer adds the player to the list and then calls broadcastSystemMessage, which includes the newcomer. This change places the player first, sends the initial packets, and then broadcasts the line to every placed guest, so the joining player reads it too. Other players see the same line as before.

Fixes #4536.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

  • PlayerList.placeNewPlayer: this.players.add(player) before this.broadcastSystemMessage(Component.translatable("multiplayer.player.joined", ...)).
  • PlayerList.broadcastSystemMessage: iterates every listed player, the newcomer included.

Rebased onto 101280753; the only conflict was the neighbouring recipe-book and teleport calls in hub.rs, which the patch keeps. cargo fmt --check and cargo check -p horizon-client --lib pass at the new head.

Self-check

pr_ready (tools/pr_ready.py --quick against origin/main at 6e8e088c2, before the rebase onto 101280753):

Check Result
Scope ✅ 1 files, +6 −11
Public tree ✅
Python tests ✅ 481 passed
rustfmt ✅
clippy ✅
tests: horizon-client ✅ 1087 passed
doc tests ✅

The change is a reordering in crates/horizon-client/src/lan/hub.rs; the host's own join line still comes from game/lan.rs on HostEvent::Joined, so the host is not sent the guest's line twice. Not run end to end: this checkout has no prepared vanilla resources in .local/, so tools/lan_e2e.py cannot start a game here. CI's parity job runs the LAN checks for lan/hub.rs.

Screenshots

No capture available locally; the joining player's chat should start with "X joined the game".


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4634 **Author:** [@cryingtoilet](https://github.com/cryingtoilet) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/4536-own-join-message` --- ### 📝 Commits (1) - [`23bceb7`](https://github.com/horizon-rust/horizon/commit/23bceb746d32a1a9b53d2048309b3d09492a8988) Send a joining player its own join message ### 📊 Changes **1 file changed** (+6 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/lan/hub.rs` (+6 -11) </details> ### 📄 Description > 🤖 Opened by cryingtoilet's AI agent (OpenCode, DeepSeek V4.1 Flash), not by cryingtoilet personally. ## What and why A player joining a Horizon server did not see its own "X joined the game" line. `Hub::place_new_player` sent the line with `broadcast_except(conn, ...)`, which excludes exactly the player that joined, and it did so before marking the player as placed. Vanilla's `PlayerList.placeNewPlayer` adds the player to the list and then calls `broadcastSystemMessage`, which includes the newcomer. This change places the player first, sends the initial packets, and then broadcasts the line to every placed guest, so the joining player reads it too. Other players see the same line as before. Fixes #4536. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference - `PlayerList.placeNewPlayer`: `this.players.add(player)` before `this.broadcastSystemMessage(Component.translatable("multiplayer.player.joined", ...))`. - `PlayerList.broadcastSystemMessage`: iterates every listed player, the newcomer included. Rebased onto `101280753`; the only conflict was the neighbouring recipe-book and teleport calls in `hub.rs`, which the patch keeps. `cargo fmt --check` and `cargo check -p horizon-client --lib` pass at the new head. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` against origin/main at 6e8e088c2, before the rebase onto 101280753): | Check | Result | | --- | --- | | Scope | ✅ 1 files, +6 −11 | | Public tree | ✅ | | Python tests | ✅ 481 passed | | rustfmt | ✅ | | clippy | ✅ | | tests: horizon-client | ✅ 1087 passed | | doc tests | ✅ | The change is a reordering in `crates/horizon-client/src/lan/hub.rs`; the host's own join line still comes from `game/lan.rs` on `HostEvent::Joined`, so the host is not sent the guest's line twice. Not run end to end: this checkout has no prepared vanilla resources in `.local/`, so `tools/lan_e2e.py` cannot start a game here. CI's parity job runs the LAN checks for `lan/hub.rs`. ## Screenshots No capture available locally; the joining player's chat should start with "X joined the game". --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:41 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5741
No description provided.