[PR #656] [MERGED] Fix multiplayer pause menu and World Options permissions #2703

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

📋 Pull Request Information

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

Base: main ← Head: codex/fix-multiplayer-world-options


📝 Commits (1)

  • aeaccb0 Fix multiplayer pause menu and World Options permissions

📊 Changes

12 files changed (+599 additions, -49 deletions)

View changed files

➕ crates/horizon-client/examples/world_options_fixture.rs (+40 -0)
📝 crates/horizon-client/src/front.rs (+51 -3)
📝 crates/horizon-client/src/game/lan_actions.rs (+64 -0)
📝 crates/horizon-client/src/game/lan_screen.rs (+232 -37)
📝 crates/horizon-client/src/game/remote.rs (+10 -3)
📝 crates/horizon-client/src/game/screens.rs (+47 -6)
📝 crates/horizon-client/src/gamerules.rs (+25 -0)
📝 crates/horizon-protocol/src/packets/play.rs (+50 -0)
➕ docs/media/multiplayer-pause.png (+0 -0)
➕ docs/media/multiplayer-world-options.png (+0 -0)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaWorldOptionsOracle.java (+55 -0)
➕ tools/test_world_options_parity.py (+25 -0)

📄 Description

What and why

Fixes #568.

Multiplayer pause menus now say Disconnect and keep World Options accessible. The server screen follows vanilla 26.3: host-only game mode, commands and LAN controls are hidden; difficulty, locking and game rules respect operator permissions; Restrictions remains available. Changes go through the server, and losing operator access closes the settings screen.

Singleplayer retains Save and Quit and its host controls, including on current upstream's integrated-server connection. A delayed difficulty reply also updates the settings baseline, preventing a spurious pending change after reopening.

Vanilla reference

Followed the 26.3 sources on mcsrc.dev:

  • PauseScreen and CommonComponents: pause entry and disconnect label.
  • WorldOptionsScreen: generalOptions, difficultyButtons, updateButton, applyChanges and permission changes.
  • LocalPlayer.handleEntityEvent and ClientPacketListener: permission, difficulty and game-rule updates.
  • ServerGamePacketListenerImpl and the ChangeDifficulty, LockDifficulty, SetGameRule and GameRuleValues packet codecs: authoritative updates and permission checks.

Added tools/test_world_options_parity.py, a Java oracle using the real pinned packet StreamCodecs and a Rust probe. 18/18 payload cases match vanilla, covering all difficulties, both lock states, empty rules, booleans and integer boundaries. No game files or prepared resources are included.

Self-check

pr_ready (tools/pr_ready.py on Rick, against origin/main at 99d5ebea1, 3 min 37 s)

Check Result
Scope ⚠️ 12 files, +599 −49; 568 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ❌ 234 run, FAILED (failures=4, errors=1) (18 s)
rustfmt ✅ (5 s)
clippy ✅ (20 s)
tests: horizon-client, horizon-protocol ❌ 785 passed, 3 failed (2 min 53 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Windows runner notes: the self-check used an ignored local adapter for the bundled POSIX shell, os.uname, and batched rustfmt invocations to avoid Windows' command-line length limit. No check was skipped. The separately invoked vanilla harness used the locally owned artifacts outside this worktree.

The three Rust failures also reproduce on unmodified upstream 99d5ebea:

  • crash::tests::stacks_start_at_the_panicking_frame: Windows path normalization.
  • packs::cache::tests::directory_inputs_config_and_owned_output_recovery: access denied.
  • save::tests::session_lock_is_exclusive: Windows denies reading the locked file.

Python failures are in unchanged parity-runner tests: four path separator assertions and one symlink creation error (WinError 1314).

Additional checks passed:

  • Protocol: 50 tests.
  • Client binary: 61 tests, 2 ignored.
  • Real two-client LAN test: 8/8 scenarios, checking singleplayer host controls; non-operator access; operator difficulty edits and delayed replies; authoritative game-rule fetch/apply/reload; lock confirmation; permission revocation; and Classic/Horizon disconnect behavior. Both clients exited cleanly.
  • Public tree, including history.

The screen, protocol and server handling form one fix; splitting them would leave visible controls that cannot apply changes.

Screenshots

Before: server guests saw the singleplayer leave label and host-only World Options controls.

After, captured from the live LAN test:

Multiplayer pause menu with Disconnect

World Options for a non-operator guest


🔄 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/656 **Author:** [@LookImEcho-Rick](https://github.com/LookImEcho-Rick) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `codex/fix-multiplayer-world-options` --- ### 📝 Commits (1) - [`aeaccb0`](https://github.com/horizon-rust/horizon/commit/aeaccb04134c6ac8184621ad82a055beb48101f6) Fix multiplayer pause menu and World Options permissions ### 📊 Changes **12 files changed** (+599 additions, -49 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-client/examples/world_options_fixture.rs` (+40 -0) 📝 `crates/horizon-client/src/front.rs` (+51 -3) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+64 -0) 📝 `crates/horizon-client/src/game/lan_screen.rs` (+232 -37) 📝 `crates/horizon-client/src/game/remote.rs` (+10 -3) 📝 `crates/horizon-client/src/game/screens.rs` (+47 -6) 📝 `crates/horizon-client/src/gamerules.rs` (+25 -0) 📝 `crates/horizon-protocol/src/packets/play.rs` (+50 -0) ➕ `docs/media/multiplayer-pause.png` (+0 -0) ➕ `docs/media/multiplayer-world-options.png` (+0 -0) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaWorldOptionsOracle.java` (+55 -0) ➕ `tools/test_world_options_parity.py` (+25 -0) </details> ### 📄 Description ## What and why Fixes #568. Multiplayer pause menus now say **Disconnect** and keep **World Options** accessible. The server screen follows vanilla 26.3: host-only game mode, commands and LAN controls are hidden; difficulty, locking and game rules respect operator permissions; Restrictions remains available. Changes go through the server, and losing operator access closes the settings screen. Singleplayer retains **Save and Quit** and its host controls, including on current upstream's integrated-server connection. A delayed difficulty reply also updates the settings baseline, preventing a spurious pending change after reopening. ## Vanilla reference Followed the 26.3 sources on [mcsrc.dev](https://mcsrc.dev/): - [PauseScreen](https://mcsrc.dev/2/26.3/net/minecraft/client/gui/screens/PauseScreen) and [CommonComponents](https://mcsrc.dev/2/26.3/net/minecraft/network/chat/CommonComponents): pause entry and disconnect label. - [WorldOptionsScreen](https://mcsrc.dev/2/26.3/net/minecraft/client/gui/screens/WorldOptionsScreen): generalOptions, difficultyButtons, updateButton, applyChanges and permission changes. - LocalPlayer.handleEntityEvent and ClientPacketListener: permission, difficulty and game-rule updates. - ServerGamePacketListenerImpl and the ChangeDifficulty, LockDifficulty, SetGameRule and GameRuleValues packet codecs: authoritative updates and permission checks. Added `tools/test_world_options_parity.py`, a Java oracle using the real pinned packet StreamCodecs and a Rust probe. **18/18 payload cases match vanilla**, covering all difficulties, both lock states, empty rules, booleans and integer boundaries. No game files or prepared resources are included. ## Self-check **pr_ready** (`tools/pr_ready.py` on Rick, against origin/main at 99d5ebea1, 3 min 37 s) | Check | Result | | --- | --- | | Scope | ⚠️ 12 files, +599 −49; 568 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ❌ 234 run, FAILED (failures=4, errors=1) (18 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (20 s) | | tests: horizon-client, horizon-protocol | ❌ 785 passed, 3 failed (2 min 53 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Windows runner notes: the self-check used an ignored local adapter for the bundled POSIX shell, `os.uname`, and batched rustfmt invocations to avoid Windows' command-line length limit. No check was skipped. The separately invoked vanilla harness used the locally owned artifacts outside this worktree. The three Rust failures also reproduce on **unmodified upstream 99d5ebea**: - `crash::tests::stacks_start_at_the_panicking_frame`: Windows path normalization. - `packs::cache::tests::directory_inputs_config_and_owned_output_recovery`: access denied. - `save::tests::session_lock_is_exclusive`: Windows denies reading the locked file. Python failures are in unchanged parity-runner tests: four path separator assertions and one symlink creation error (WinError 1314). Additional checks passed: - Protocol: **50 tests**. - Client binary: **61 tests**, 2 ignored. - Real two-client LAN test: **8/8 scenarios**, checking singleplayer host controls; non-operator access; operator difficulty edits and delayed replies; authoritative game-rule fetch/apply/reload; lock confirmation; permission revocation; and Classic/Horizon disconnect behavior. Both clients exited cleanly. - Public tree, including history. The screen, protocol and server handling form one fix; splitting them would leave visible controls that cannot apply changes. ## Screenshots Before: server guests saw the singleplayer leave label and host-only World Options controls. After, captured from the live LAN test: ![Multiplayer pause menu with Disconnect](https://raw.githubusercontent.com/LookImEcho-Rick/horizon/aeaccb04134c6ac8184621ad82a055beb48101f6/docs/media/multiplayer-pause.png) ![World Options for a non-operator guest](https://raw.githubusercontent.com/LookImEcho-Rick/horizon/aeaccb04134c6ac8184621ad82a055beb48101f6/docs/media/multiplayer-world-options.png) --- <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:23 +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#2703
No description provided.