[PR #5856] [MERGED] Anticheat prediction: a client still loading the level isn't flagged for not falling #6523

Closed
opened 2026-11-03 06:22:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5856
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/prediction-join-freeze


📝 Commits (1)

  • 0626d6d Anticheat prediction: a client still loading the level isn't flagged for not falling

📊 Changes

5 files changed (+50 additions, -7 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_actions.rs (+1 -0)
📝 crates/horizon-client/src/game/prediction.rs (+5 -1)
📝 crates/horizon-client/src/lan/guest.rs (+5 -0)
📝 crates/horizon-client/src/lan/hub.rs (+2 -0)
📝 crates/horizon-client/src/lan/prediction.rs (+37 -6)

📄 Description

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

Fixes #5849.

On the official server, a player who joined just after the 09:00 UTC restart reached prediction VL 116 in one second: their client stood still for 7 ticks while the server's replay fell, then fell itself, 7 ticks behind. The client was still on its loading screen. The server stops waiting for ServerboundPlayerLoadedPacket after 60 ticks (load_timeout) and the replay runs, but the client doesn't move until it has loaded the level. With the thresholds the check gets once trusted (setback 5, kick 60), that kicks an honest player as soon as they join.

Change

  • Guest::loading: true at join and after a respawn, false when ServerboundPlayerLoadedPacket comes. loaded and load_timeout keep their vanilla meanings; mob targeting and the rest of the game don't change.
  • Over::moved: whether any tick of a catch-up that landed off came with a move.
  • guest_replay: if a guest is still loading and its off ticks came with no move, they are excused, as any other excuse is (the replay takes the client's velocity again). Its first move counts as usual, so a client that never sends the packet is still checked as soon as it moves.

Per-move cost: one bool OR per off tick and one test per catch-up. Nothing on the ticks that agree.

Tests

  • a_client_on_its_loading_screen_is_over_without_a_move: a client frozen in the air for 7 ticks while the replay falls. Those ticks are off with no move; every off tick after them has one.
  • The 16 other replay tests are unchanged and pass, including the strict cheat tests (step, spider, jesus, blink, speed).
  • tools/anticheat_e2e.py --check prediction: the honest client (20-120 ms jitter) was never flagged; the bot, which sends no PlayerLoaded but moves, was flagged 13 times and sent back 12 times.
Check Result
Scope ✅ 5 files, +50 −7
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 515 passed (2 min 8 s)
rustfmt ✅ (5 s)
clippy ✅ (1 min 39 s)
tests: horizon-client ✅ 1671 passed (4 min 2 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 34 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 22 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/5856 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/prediction-join-freeze` --- ### 📝 Commits (1) - [`0626d6d`](https://github.com/horizon-rust/horizon/commit/0626d6d505c6f99441e04ccca94d5bc6a30d83cb) Anticheat prediction: a client still loading the level isn't flagged for not falling ### 📊 Changes **5 files changed** (+50 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_actions.rs` (+1 -0) 📝 `crates/horizon-client/src/game/prediction.rs` (+5 -1) 📝 `crates/horizon-client/src/lan/guest.rs` (+5 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+2 -0) 📝 `crates/horizon-client/src/lan/prediction.rs` (+37 -6) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #5849. On the official server, a player who joined just after the 09:00 UTC restart reached prediction VL 116 in one second: their client stood still for 7 ticks while the server's replay fell, then fell itself, 7 ticks behind. The client was still on its loading screen. The server stops waiting for `ServerboundPlayerLoadedPacket` after 60 ticks (`load_timeout`) and the replay runs, but the client doesn't move until it has loaded the level. With the thresholds the check gets once trusted (setback 5, kick 60), that kicks an honest player as soon as they join. ## Change - `Guest::loading`: true at join and after a respawn, false when `ServerboundPlayerLoadedPacket` comes. `loaded` and `load_timeout` keep their vanilla meanings; mob targeting and the rest of the game don't change. - `Over::moved`: whether any tick of a catch-up that landed off came with a move. - `guest_replay`: if a guest is still loading and its off ticks came with no move, they are excused, as any other excuse is (the replay takes the client's velocity again). Its first move counts as usual, so a client that never sends the packet is still checked as soon as it moves. Per-move cost: one `bool` OR per off tick and one test per catch-up. Nothing on the ticks that agree. ## Tests - `a_client_on_its_loading_screen_is_over_without_a_move`: a client frozen in the air for 7 ticks while the replay falls. Those ticks are off with no move; every off tick after them has one. - The 16 other replay tests are unchanged and pass, including the strict cheat tests (step, spider, jesus, blink, speed). - `tools/anticheat_e2e.py --check prediction`: the honest client (20-120 ms jitter) was never flagged; the bot, which sends no `PlayerLoaded` but moves, was flagged 13 times and sent back 12 times. | Check | Result | | --- | --- | | Scope | ✅ 5 files, +50 −7 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 515 passed (2 min 8 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 39 s) | | tests: horizon-client | ✅ 1671 passed (4 min 2 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 34 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 22 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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-03 06:22:20 +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#6523
No description provided.