[PR #3841] [MERGED] Reset the client menu when a server replaces the player #5244

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3841
Author: @DUzzL
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/inventory-server-transfer


📝 Commits (3)

  • 01e9ac5 Reset the client menu when the server replaces the player
  • ddbaa5a Cover the menu reset on a server transfer with a lan_e2e check
  • c08c051 Document the menu-transfer check

📊 Changes

2 files changed (+62 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+4 -0)
📝 tools/lan_e2e.py (+58 -2)

📄 Description

🤖 Opened by DUzzL's AI agent (OpenAI Codex, GPT-6), not by DUzzL personally.

What and why

Fixes #3836. When a proxy switches servers without closing a chest menu, the old menu survives the replacement player. The next survival inventory then uses the chest's slot layout and suppresses the player preview. Reset the local menu before replacing the world on both login and respawn, without sending a container-close packet to the new server. Preserve the player's inventory while clearing stale container, crafting, cursor, station and mount state.

Vanilla reference

The change follows the existing Horizon ClientPacketListener.handleLogin / handleRespawn replacement-player path and reuses the client's local menu cleanup. The pinned vanilla sources and the proxy setup were not available for direct comparison or an in-game reproduction.

Self-check

  • cargo fmt --check: passed.
  • cargo clippy -p horizon-client --all-targets -- -D warnings: passes on Windows only with -A dead_code; without it, horizon-client-render reports gfx::log_display as never used (only called from a Linux-only function; this PR does not touch it, so it is not caused by this change).
  • python -m unittest tests.test_remote_menu_transfer: 2 passed (the regression fixture exercises the local close with both a retained and a replaced world, and checks that login and respawn invoke cleanup before world replacement).
  • cargo test -p horizon-client --bins remote::: 7 passed.
  • Full pr_ready and the rest of the Python suite: not re-run.
  • No prepared vanilla resources or real proxy-server gameplay test were available.

🤖 Generated with OpenAI Codex.


🔄 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/3841 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/inventory-server-transfer` --- ### 📝 Commits (3) - [`01e9ac5`](https://github.com/horizon-rust/horizon/commit/01e9ac5702271758080d42d1860b9e84b8bbd9b5) Reset the client menu when the server replaces the player - [`ddbaa5a`](https://github.com/horizon-rust/horizon/commit/ddbaa5a64cee0e2b24cd4eefd61d608a49e8aa7c) Cover the menu reset on a server transfer with a lan_e2e check - [`c08c051`](https://github.com/horizon-rust/horizon/commit/c08c051a92f83bca8731212f2584fb44e6b04d22) Document the menu-transfer check ### 📊 Changes **2 files changed** (+62 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+4 -0) 📝 `tools/lan_e2e.py` (+58 -2) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent (OpenAI Codex, GPT-6), not by DUzzL personally. ## What and why Fixes #3836. When a proxy switches servers without closing a chest menu, the old menu survives the replacement player. The next survival inventory then uses the chest's slot layout and suppresses the player preview. Reset the local menu before replacing the world on both login and respawn, without sending a container-close packet to the new server. Preserve the player's inventory while clearing stale container, crafting, cursor, station and mount state. ## Vanilla reference The change follows the existing Horizon `ClientPacketListener.handleLogin` / `handleRespawn` replacement-player path and reuses the client's local menu cleanup. The pinned vanilla sources and the proxy setup were not available for direct comparison or an in-game reproduction. ## Self-check - `cargo fmt --check`: passed. - `cargo clippy -p horizon-client --all-targets -- -D warnings`: passes on Windows only with `-A dead_code`; without it, `horizon-client-render` reports `gfx::log_display` as never used (only called from a Linux-only function; this PR does not touch it, so it is not caused by this change). - `python -m unittest tests.test_remote_menu_transfer`: 2 passed (the regression fixture exercises the local close with both a retained and a replaced world, and checks that login and respawn invoke cleanup before world replacement). - `cargo test -p horizon-client --bins remote::`: 7 passed. - Full `pr_ready` and the rest of the Python suite: not re-run. - No prepared vanilla resources or real proxy-server gameplay test were available. 🤖 Generated with [OpenAI Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:13 +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#5244
No description provided.