[PR #604] [MERGED] Integrated server: control socket and chat read the server's side #2669

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

📋 Pull Request Information

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

Base: main ← Head: perf/sp-server-state


📝 Commits (6)

  • dc42425 Integrated server: Open to LAN
  • f03990f Integrated server: control socket and chat read the server's side
  • bbed107 Merge main into perf/sp-open-to-lan
  • 803aee8 Merge perf/sp-open-to-lan (with main) into perf/sp-server-state
  • c2f2e15 Merge main into perf/sp-open-to-lan
  • 5ad2d80 Merge perf/sp-open-to-lan into perf/sp-server-state

📊 Changes

18 files changed (+616 additions, -132 deletions)

View changed files

📝 crates/horizon-client/examples/lan_flat.rs (+1 -0)
📝 crates/horizon-client/src/game.rs (+4 -1)
📝 crates/horizon-client/src/game/agent.rs (+4 -1)
📝 crates/horizon-client/src/game/chat.rs (+6 -0)
📝 crates/horizon-client/src/game/commands/extra.rs (+20 -6)
📝 crates/horizon-client/src/game/control.rs (+26 -12)
📝 crates/horizon-client/src/game/debug_keys.rs (+1 -1)
📝 crates/horizon-client/src/game/dedicated.rs (+1 -0)
📝 crates/horizon-client/src/game/integrated.rs (+268 -17)
📝 crates/horizon-client/src/game/lan.rs (+88 -34)
📝 crates/horizon-client/src/game/lan_actions.rs (+25 -0)
📝 crates/horizon-client/src/game/lan_screen.rs (+68 -18)
📝 crates/horizon-client/src/game/remote.rs (+9 -1)
📝 crates/horizon-client/src/lan/conn.rs (+2 -1)
📝 crates/horizon-client/src/lan/hub.rs (+13 -2)
📝 crates/horizon-client/src/lan/mod.rs (+75 -38)
📝 crates/horizon-client/tests/lan_bot.rs (+1 -0)
📝 crates/horizon-protocol/src/connection.rs (+4 -0)

📄 Description

What and why

With single player on its server thread, the window is the server's client. Some of the things it answered came from its own, empty side. This is gap 3 of the server-thread default (#494/#495).

  • horizon-ctl save and save-all returned ok without saving, because the window's save skips worlds it is connected to. They now save on the server thread, through Integrated::call. Checked: region files and level.dat are rewritten.
  • horizon-ctl chat-log read the window's local chat, which never shows what the server says (command feedback, joins). It now reads the connection's chat, as the agent's chat query already did.
  • The game's own messages (Open to LAN, screenshots, …) went to that local chat, which is not drawn while connected. They now join the connection's chat, so they show on screen.
  • state names the world: the server thread's LevelName, instead of an empty string.
  • Permission level: the client follows it (EntityEvent 24..28, LocalPlayer.setPermissionLevel). The commands the chat offers and checks depend on it. This is a first step of gap 2. The client still uses its own command tree, not the one the server sends (ClientboundCommandsPacket).

Checks

  • cargo fmt --all --check: ok
  • cargo clippy -p horizon-client --all-targets -- -D warnings: ok
  • cargo test -p horizon-client --lib: 772 passed, 0 failed
  • By hand (--server-thread): command "time query gametime" shows its feedback in chat-log, save rewrites the region files, and state.world is lanA.
  • Local parity, run once on the stack top: 83 passed, 1 failed in 77.6 min. The failure is world_spawn, on 2 of its 60 seeds (-9075835740570717616, -2080727421395798566), where vanilla itself gives several spawns: it varies between 125 and 129, and between 64, 66 and 72. Rerun on those seeds: Horizon spawns where one of vanilla's runs does, so both pass. The stack below (#596) was 84/84.

Stacked on #603. skip-release until single player uses the server thread by default.

🤖 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/604 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/sp-server-state` --- ### 📝 Commits (6) - [`dc42425`](https://github.com/horizon-rust/horizon/commit/dc42425c0197c5918ba3739d5aa20b8678af6199) Integrated server: Open to LAN - [`f03990f`](https://github.com/horizon-rust/horizon/commit/f03990f663e658379dd51790342205a57b263871) Integrated server: control socket and chat read the server's side - [`bbed107`](https://github.com/horizon-rust/horizon/commit/bbed107a6a4bad766117cab388449e77aab931de) Merge main into perf/sp-open-to-lan - [`803aee8`](https://github.com/horizon-rust/horizon/commit/803aee8bebc39e2d27ea3debc2c9f1da775c96ce) Merge perf/sp-open-to-lan (with main) into perf/sp-server-state - [`c2f2e15`](https://github.com/horizon-rust/horizon/commit/c2f2e15643e4dae251dc1f75bdfd10f7218fbd78) Merge main into perf/sp-open-to-lan - [`5ad2d80`](https://github.com/horizon-rust/horizon/commit/5ad2d80908729d1b70f39dab87e209d7657b2e4c) Merge perf/sp-open-to-lan into perf/sp-server-state ### 📊 Changes **18 files changed** (+616 additions, -132 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/lan_flat.rs` (+1 -0) 📝 `crates/horizon-client/src/game.rs` (+4 -1) 📝 `crates/horizon-client/src/game/agent.rs` (+4 -1) 📝 `crates/horizon-client/src/game/chat.rs` (+6 -0) 📝 `crates/horizon-client/src/game/commands/extra.rs` (+20 -6) 📝 `crates/horizon-client/src/game/control.rs` (+26 -12) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+1 -1) 📝 `crates/horizon-client/src/game/dedicated.rs` (+1 -0) 📝 `crates/horizon-client/src/game/integrated.rs` (+268 -17) 📝 `crates/horizon-client/src/game/lan.rs` (+88 -34) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+25 -0) 📝 `crates/horizon-client/src/game/lan_screen.rs` (+68 -18) 📝 `crates/horizon-client/src/game/remote.rs` (+9 -1) 📝 `crates/horizon-client/src/lan/conn.rs` (+2 -1) 📝 `crates/horizon-client/src/lan/hub.rs` (+13 -2) 📝 `crates/horizon-client/src/lan/mod.rs` (+75 -38) 📝 `crates/horizon-client/tests/lan_bot.rs` (+1 -0) 📝 `crates/horizon-protocol/src/connection.rs` (+4 -0) </details> ### 📄 Description ## What and why With single player on its server thread, the window is the server's client. Some of the things it answered came from its own, empty side. This is gap 3 of the server-thread default (#494/#495). - **`horizon-ctl save` and `save-all`** returned ok without saving, because the window's save skips worlds it is connected to. They now save on the server thread, through `Integrated::call`. Checked: region files and `level.dat` are rewritten. - **`horizon-ctl chat-log`** read the window's local chat, which never shows what the server says (command feedback, joins). It now reads the connection's chat, as the agent's chat query already did. - **The game's own messages** (Open to LAN, screenshots, …) went to that local chat, which is not drawn while connected. They now join the connection's chat, so they show on screen. - **`state`** names the world: the server thread's `LevelName`, instead of an empty string. - **Permission level**: the client follows it (`EntityEvent` 24..28, `LocalPlayer.setPermissionLevel`). The commands the chat offers and checks depend on it. This is a first step of gap 2. The client still uses its own command tree, not the one the server sends (`ClientboundCommandsPacket`). ## Checks - `cargo fmt --all --check`: ok - `cargo clippy -p horizon-client --all-targets -- -D warnings`: ok - `cargo test -p horizon-client --lib`: 772 passed, 0 failed - By hand (`--server-thread`): `command "time query gametime"` shows its feedback in `chat-log`, `save` rewrites the region files, and `state.world` is `lanA`. - Local parity, run once on the stack top: 83 passed, 1 failed in 77.6 min. The failure is `world_spawn`, on 2 of its 60 seeds (-9075835740570717616, -2080727421395798566), where vanilla itself gives several spawns: it varies between 125 and 129, and between 64, 66 and 72. Rerun on those seeds: Horizon spawns where one of vanilla's runs does, so both pass. The stack below (#596) was 84/84. Stacked on #603. `skip-release` until single player uses the server thread by default. 🤖 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:05 +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#2669
No description provided.