[PR #5387] [MERGED] lan_bot: Hub::tick drains the players' packets; one S::Attack arm (main's clippy) #6252

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

📋 Pull Request Information

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

Base: main ← Head: fix/lan-bot-drain-packets


📝 Commits (2)

  • 77c1778 lan_bot: Hub::tick drains the players' packets; one S::Attack arm
  • 7e6dea3 Merge main into #5387: main's 825a6bbcf already has the one S::Attack arm

📊 Changes

2 files changed (+4 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/lan/hub.rs (+1 -0)
📝 crates/horizon-client/tests/lan_bot.rs (+3 -0)

📄 Description

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

Fixes #5364. On main (d6e8bd67a), clippy -D warnings fails on horizon-client and cargo test -p horizon-client --test lan_bot fails 9 of 14 tests.

  • Hub::tick drains the players' packets again. #4787 moved them into Hub::drain_packets, which the game calls between poll and tick_level. Hub::tick, the whole-tick helper the lan_bot server uses, still ran only poll and tick_level, so the tests' packets were never handled (status_and_join, sprint commands, recipe settings, respawn immunity, the prediction record ...). The game itself doesn't call Hub::tick: no gameplay change.
  • The lan_bot bots end their ticks. In guests_see_each_other_and_the_world_entities, the bots now send ClientTickEnd after each move, as a client does. Without it, a second move in one client tick is kicked (invalid_player_movement), the rule since the known-movement change.
  • One S::Attack arm. hub.rs's packet loop had two: the anticheat's, then #5123's, which keeps the moves queued behind an attack for the next tick. The second was unreachable: clippy fails on main, and a_move_behind_an_attack_and_its_swing_waits_for_the_next_tick fails, because #4524's fix never ran. One arm now does both: the anticheat drops a cheating attack, and a move behind an attack waits for the next tick. #5365 carries the identical hunk, so the two merge cleanly in either order.

Tests

  • cargo test -p horizon-client --test lan_bot: 14 passed (main: 5 passed, 9 failed), 3 runs in a row.
  • cargo clippy -p horizon-client --all-targets -- -D warnings: clean (main: unreachable pattern).

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at d6e8bd67a, 17 min 53 s, on this branch before the S::Attack hunk was added: the clippy and lan_bot failures below are the ones that hunk fixes, rerun clean since)

Check Result
Scope ✅ 2 files, +4 −0 (now 2 files, +8 −6)
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 499 passed (3 min 18 s)
rustfmt ✅ (14 s)
clippy ❌ failed (33 s): main's unreachable pattern, fixed by the S::Attack hunk; clean since
tests: horizon-client ❌ 1409 passed, 1 failed (12 min 11 s): a_move_behind_an_attack_and_its_swing_waits_for_the_next_tick, fixed by the same hunk; lan_bot 14/14 since
doc tests ✅ 0 passed (3 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 ➖ 37 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, held_item_stack, lan_auth and 25 more

🤖 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/5387 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/lan-bot-drain-packets` --- ### 📝 Commits (2) - [`77c1778`](https://github.com/horizon-rust/horizon/commit/77c1778b1565f754ae7bf909165b13edb265470d) lan_bot: Hub::tick drains the players' packets; one S::Attack arm - [`7e6dea3`](https://github.com/horizon-rust/horizon/commit/7e6dea370764b28bab6a9b7d6489a81fdf0c5066) Merge main into #5387: main's 825a6bbcf already has the one S::Attack arm ### 📊 Changes **2 files changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/lan/hub.rs` (+1 -0) 📝 `crates/horizon-client/tests/lan_bot.rs` (+3 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #5364. On main (d6e8bd67a), `clippy -D warnings` fails on `horizon-client` and `cargo test -p horizon-client --test lan_bot` fails 9 of 14 tests. - **`Hub::tick` drains the players' packets again.** #4787 moved them into `Hub::drain_packets`, which the game calls between `poll` and `tick_level`. `Hub::tick`, the whole-tick helper the lan_bot server uses, still ran only `poll` and `tick_level`, so the tests' packets were never handled (status_and_join, sprint commands, recipe settings, respawn immunity, the prediction record ...). The game itself doesn't call `Hub::tick`: no gameplay change. - **The lan_bot bots end their ticks.** In `guests_see_each_other_and_the_world_entities`, the bots now send `ClientTickEnd` after each move, as a client does. Without it, a second move in one client tick is kicked (`invalid_player_movement`), the rule since the known-movement change. - **One `S::Attack` arm.** `hub.rs`'s packet loop had two: the anticheat's, then #5123's, which keeps the moves queued behind an attack for the next tick. The second was unreachable: clippy fails on main, and `a_move_behind_an_attack_and_its_swing_waits_for_the_next_tick` fails, because #4524's fix never ran. One arm now does both: the anticheat drops a cheating attack, and a move behind an attack waits for the next tick. #5365 carries the identical hunk, so the two merge cleanly in either order. ## Tests - `cargo test -p horizon-client --test lan_bot`: 14 passed (main: 5 passed, 9 failed), 3 runs in a row. - `cargo clippy -p horizon-client --all-targets -- -D warnings`: clean (main: `unreachable pattern`). **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at d6e8bd67a, 17 min 53 s, on this branch before the `S::Attack` hunk was added: the clippy and lan_bot failures below are the ones that hunk fixes, rerun clean since) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +4 −0 (now 2 files, +8 −6) | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 499 passed (3 min 18 s) | | rustfmt | ✅ (14 s) | | clippy | ❌ failed (33 s): main's `unreachable pattern`, fixed by the `S::Attack` hunk; clean since | | tests: horizon-client | ❌ 1409 passed, 1 failed (12 min 11 s): `a_move_behind_an_attack_and_its_swing_waits_for_the_next_tick`, fixed by the same hunk; lan_bot 14/14 since | | doc tests | ✅ 0 passed (3 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 | ➖ 37 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, held_item_stack, lan_auth and 25 more | 🤖 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:16: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#6252
No description provided.