[PR #888] [MERGED] Server thread: horizon-ctl tp and fly make the server load the new chunks (#861) #2890

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

📋 Pull Request Information

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

Base: main ← Head: fix/integrated-owner-movement


📝 Commits (1)

  • 7a6a4d9 Server thread: horizon-ctl tp and fly make the server load the new chunks (#861)

📊 Changes

4 files changed (+30 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/bin/horizon-ctl/main.rs (+6 -1)
📝 crates/horizon-client/src/game/integrated.rs (+1 -0)
📝 crates/horizon-client/src/game/remote.rs (+14 -0)
📝 crates/horizon-client/src/lan/hub.rs (+9 -3)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Fixes #861.

What

With the world on its server thread (HORIZON_SERVER_THREAD=1 / --server-thread), a horizon-ctl tp or fly moved the window's player into chunks the server had never sent. The client skips its tick while its own chunk isn't loaded, so it never sent that move. The server kept streaming the old area, and the client stayed on "loading terrain..." for good.

  • The client sends a move made where nothing is loaded. Only horizon-ctl can put the player there: a player who walked there sent the move at the end of the previous tick. Once the server has it, it streams the chunks there. Before PlayerLoaded nothing is sent, as vanilla's server ignores those moves (handleMovePlayer: if (!hasClientLoaded())).
  • The integrated server doesn't check its owner's moves. This follows vanilla's shouldCheckPlayerMovement, which returns false for isSingleplayerOwner(). Without it, a long tp came back as "moved too quickly". Hub::singleplayer_owner is set only by the integrated server, so LAN guests and dedicated servers are checked as before.
  • wait-ready waits for the level around the player on a server. It now also requires server.loaded (PlayerLoaded sent), which status shows. Before, it returned with 6 chunks, before the client had loaded anything.

Normal play doesn't change. The new send only happens when the position differs from the last one sent while the chunk is unloaded, and walking never produces that.

How tested

Mac mini, server thread on, fresh world (seed 1234, creative). After wait-ready and 20 s more: tp 2000 120 0, wait 25 s, then fly 2000 120 0 2600 120 0 20.

after tp block 2000 60 0 after fly block 2600 60 0
main e508a5ce hangs at y 120 loaded: false hangs at y 120 loaded: false
this PR fell to y 61 water, loaded: true landed at y 67 stone, loaded: true

This unblocks profiling the server thread while exploring (perf-ticks-9).

Checks

  • cargo fmt --all --check and cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test -p horizon-client --lib: 868 passed.
  • Parity, local: lan, dedicated_server, server_entities, server_dimension_players: 4 of 4 pass on f2d1f960, the same change before the rebase onto 4f9df738.
  • CI parity covers the rest of --changed.

Needs Ludovic

Nothing.

🤖 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/888 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/integrated-owner-movement` --- ### 📝 Commits (1) - [`7a6a4d9`](https://github.com/horizon-rust/horizon/commit/7a6a4d92497ab3373f8f6f7178df8e2b3a37b464) Server thread: horizon-ctl tp and fly make the server load the new chunks (#861) ### 📊 Changes **4 files changed** (+30 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/bin/horizon-ctl/main.rs` (+6 -1) 📝 `crates/horizon-client/src/game/integrated.rs` (+1 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+14 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+9 -3) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #861. ## What With the world on its server thread (`HORIZON_SERVER_THREAD=1` / `--server-thread`), a `horizon-ctl tp` or `fly` moved the window's player into chunks the server had never sent. The client skips its tick while its own chunk isn't loaded, so it never sent that move. The server kept streaming the old area, and the client stayed on "loading terrain..." for good. - **The client sends a move made where nothing is loaded.** Only horizon-ctl can put the player there: a player who walked there sent the move at the end of the previous tick. Once the server has it, it streams the chunks there. Before `PlayerLoaded` nothing is sent, as vanilla's server ignores those moves (`handleMovePlayer`: `if (!hasClientLoaded())`). - **The integrated server doesn't check its owner's moves.** This follows vanilla's `shouldCheckPlayerMovement`, which returns false for `isSingleplayerOwner()`. Without it, a long `tp` came back as "moved too quickly". `Hub::singleplayer_owner` is set only by the integrated server, so LAN guests and dedicated servers are checked as before. - **`wait-ready` waits for the level around the player on a server.** It now also requires `server.loaded` (`PlayerLoaded` sent), which `status` shows. Before, it returned with 6 chunks, before the client had loaded anything. Normal play doesn't change. The new send only happens when the position differs from the last one sent while the chunk is unloaded, and walking never produces that. ## How tested Mac mini, server thread on, fresh world (seed 1234, creative). After `wait-ready` and 20 s more: `tp 2000 120 0`, wait 25 s, then `fly 2000 120 0 2600 120 0 20`. | | after `tp` | `block 2000 60 0` | after `fly` | `block 2600 60 0` | |---|---|---|---|---| | main e508a5ce | hangs at y 120 | `loaded: false` | hangs at y 120 | `loaded: false` | | this PR | fell to y 61 | water, `loaded: true` | landed at y 67 | stone, `loaded: true` | This unblocks profiling the server thread while exploring (perf-ticks-9). ## Checks - `cargo fmt --all --check` and `cargo clippy --workspace --all-targets -- -D warnings`: clean. - `cargo test -p horizon-client --lib`: 868 passed. - Parity, local: `lan`, `dedicated_server`, `server_entities`, `server_dimension_players`: 4 of 4 pass on f2d1f960, the same change before the rebase onto 4f9df738. - CI parity covers the rest of `--changed`. ## Needs Ludovic Nothing. 🤖 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:59:52 +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#2890
No description provided.