[PR #664] [MERGED] Network client: show the server's advancements and statistics #2713

Closed
opened 2026-11-02 15:58:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/664
Author: @ludovic111
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @ludovic111

Base: main ← Head: feat/client-advancements


📝 Commits (5)

  • cfcf69f Network client: apply the block entity data, difficulty, spawn, chunk centre, tick rate, animations and server data the server sends
  • 56a4989 Network client: show the server's advancements and statistics
  • cc8249d Merge remote-tracking branch 'origin/main' into fix/client-server-packets
  • aea0dc4 Network client: keep #656's ChangeDifficulty handler
  • ee0f382 Merge branch 'fix/client-server-packets' into feat/client-advancements

📊 Changes

8 files changed (+676 additions, -15 deletions)

View changed files

📝 crates/horizon-client/src/clock.rs (+39 -1)
📝 crates/horizon-client/src/game/advancements.rs (+107 -0)
📝 crates/horizon-client/src/game/advancements_screen.rs (+18 -6)
📝 crates/horizon-client/src/game/remote.rs (+227 -8)
📝 crates/horizon-client/src/game/stats_screen.rs (+6 -0)
📝 crates/horizon-client/src/multiplayer.rs (+8 -0)
📝 crates/horizon-protocol/src/item.rs (+36 -0)
📝 crates/horizon-protocol/src/packets/play.rs (+235 -0)

📄 Description

Third step toward running single player on the server thread by default. Stacked on #655 (base fix/client-server-packets); independent of #662, which sends these packets to guests.

What changes

Until now a networked client (LAN guest, dedicated server, and the window when --server-thread is on) ignored UPDATE_ADVANCEMENTS and AWARD_STATS. The advancements screen showed the client's own empty tree, no "Advancement Made!" toasts appeared, and the statistics screen stayed at zero.

  • horizon-protocol: codecs for UpdateAdvancements (advancement, display with ItemStackTemplate icon, frame, flags, background, x/y; per-criterion progress) and AwardStats (stat type + value registry id + amount). Both are covered by round-trip tests.
  • Advancements (client): remote_advancements follows ClientAdvancements.update:
    • It rebuilds the tree from the server's entries (a reset clears it first) and keeps the server's layout positions.
    • It stores the progress.
    • It shows a toast when an advancement goes from not done to done and the display has show_toast set.
    • While positions come from the server, the screen shows everything the server sends, because the server already filtered what is visible.
  • Statistics (client):
    • When remote, opening the statistics screen sends ClientCommand { action: 1 } (REQUEST_STATS), as vanilla's StatsScreen does.
    • AwardStats values are mapped back to registry names and written into the screen's values.
    • Joining or leaving a server resets the advancement and statistics state.

Checks

  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo test -p horizon-client --lib: 793 passed. cargo test -p horizon-protocol: 49 passed.
  • Smoke test, --server-thread, built with #662 merged in locally so the server sends the packets:
    • Mining stone shows the "Advancement Made! Stone Age" toast.
    • The advancements screen shows the server's tree.
    • The statistics screen opens and fills from the server's reply.

Label: skip-release. The flip PR carries the release note.

🤖 Generated with Claude Code


🔄 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/664 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/client-advancements` --- ### 📝 Commits (5) - [`cfcf69f`](https://github.com/horizon-rust/horizon/commit/cfcf69f0b98c42a8fc41e336fd6d7ec1c9328b41) Network client: apply the block entity data, difficulty, spawn, chunk centre, tick rate, animations and server data the server sends - [`56a4989`](https://github.com/horizon-rust/horizon/commit/56a49895602d9bcdd5a7b57c4a82d2a4755bab1d) Network client: show the server's advancements and statistics - [`cc8249d`](https://github.com/horizon-rust/horizon/commit/cc8249d2ce37ebbea03bf80928c2505057922454) Merge remote-tracking branch 'origin/main' into fix/client-server-packets - [`aea0dc4`](https://github.com/horizon-rust/horizon/commit/aea0dc4c93216951ff793dc948d0a601ead2dd69) Network client: keep #656's ChangeDifficulty handler - [`ee0f382`](https://github.com/horizon-rust/horizon/commit/ee0f382bdf5f870d9ffe5deb6e2e891465623529) Merge branch 'fix/client-server-packets' into feat/client-advancements ### 📊 Changes **8 files changed** (+676 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/clock.rs` (+39 -1) 📝 `crates/horizon-client/src/game/advancements.rs` (+107 -0) 📝 `crates/horizon-client/src/game/advancements_screen.rs` (+18 -6) 📝 `crates/horizon-client/src/game/remote.rs` (+227 -8) 📝 `crates/horizon-client/src/game/stats_screen.rs` (+6 -0) 📝 `crates/horizon-client/src/multiplayer.rs` (+8 -0) 📝 `crates/horizon-protocol/src/item.rs` (+36 -0) 📝 `crates/horizon-protocol/src/packets/play.rs` (+235 -0) </details> ### 📄 Description Third step toward running single player on the server thread by default. Stacked on #655 (base `fix/client-server-packets`); independent of #662, which sends these packets to guests. ## What changes Until now a networked client (LAN guest, dedicated server, and the window when `--server-thread` is on) ignored `UPDATE_ADVANCEMENTS` and `AWARD_STATS`. The advancements screen showed the client's own empty tree, no "Advancement Made!" toasts appeared, and the statistics screen stayed at zero. - **horizon-protocol**: codecs for `UpdateAdvancements` (advancement, display with `ItemStackTemplate` icon, frame, flags, background, x/y; per-criterion progress) and `AwardStats` (stat type + value registry id + amount). Both are covered by round-trip tests. - **Advancements (client)**: `remote_advancements` follows `ClientAdvancements.update`: - It rebuilds the tree from the server's entries (a reset clears it first) and keeps the server's layout positions. - It stores the progress. - It shows a toast when an advancement goes from not done to done and the display has `show_toast` set. - While positions come from the server, the screen shows everything the server sends, because the server already filtered what is visible. - **Statistics (client)**: - When remote, opening the statistics screen sends `ClientCommand { action: 1 }` (REQUEST_STATS), as vanilla's `StatsScreen` does. - `AwardStats` values are mapped back to registry names and written into the screen's values. - Joining or leaving a server resets the advancement and statistics state. ## Checks - `cargo fmt --all --check`, `cargo clippy --workspace --all-targets -- -D warnings`: clean - `cargo test -p horizon-client --lib`: 793 passed. `cargo test -p horizon-protocol`: 49 passed. - Smoke test, `--server-thread`, built with #662 merged in locally so the server sends the packets: - Mining stone shows the "Advancement Made! Stone Age" toast. - The advancements screen shows the server's tree. - The statistics screen opens and fills from the server's reply. Label: `skip-release`. The flip PR carries the release note. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:58:28 +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#2713
No description provided.