[PR #807] [MERGED] Server: a dead guest is sent its health of 0, as ServerPlayer.doTick does #2825

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

📋 Pull Request Information

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

Base: main ← Head: fix/guest-death-health


📝 Commits (1)

  • 65d5a35 Server: a dead guest is sent its health of 0, as ServerPlayer.doTick does

📊 Changes

3 files changed (+14 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/lan/guest.rs (+2 -1)
📝 crates/horizon-client/src/lan/hub.rs (+8 -10)
📝 tools/lan_e2e.py (+4 -1)

📄 Description

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

What

When a guest dies, its client is now sent health 0, as vanilla does. One of the server-thread gaps listed in #731; it affects LAN guests and the dedicated server today.

  • Vanilla 26.3 (ServerPlayer.doTick): ClientboundSetHealthPacket goes out on every tick where any of these changed since the last one sent, whether the player is alive or dead:
    • the health;
    • the food level;
    • whether the saturation is zero (lastSentHealth, lastSentFood, lastFoodSaturationZero).
  • Horizon before:
    • The hub stopped sending health once the guest was dead, so the guest's client kept its last positive health under the death screen (#731 had to make lan_e2e tolerate it).
    • It sent the packet on every change of saturation, not only when the saturation reached or left zero.
  • Now: the hub keeps vanilla's three values in Guest::sent_health and sends the packet when one of them changes, dead or alive.

Proof

tools/lan_e2e.py hazards now checks the guest right after /kill: its death screen is open and the health it was sent is 0.

build hazards
main FAIL: the guest was killed: {'screen': 'dead', 'health': 20.0}
this branch pass: died: {'screen': 'dead', 'health': 0.0}, then hunger and the four hazards as before

Checks

Run on an integration of this PR with #793 and the other perf-ticks-6 branches (chunk ticket levels, guest death health, server titles, ask_server suggestions, dedicated no-mesh), on main ce571f78:

  • cargo fmt --check and cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test -p horizon-client --lib: 851 passed.
  • tools/lan_e2e.py on the integration build: titles, hazards, feedback and commands pass. With --server-thread, titles passes. hazards fails at "no hunger from moving", and it fails the same way on plain main, so this branch did not cause it.
  • tools/parity.py --changed origin/main on the first three branches together, then based on 9b97ba09: 89 passed, 0 failed. chunk_stage and chunk_generation were run on their own as well and passed. The rebase onto ce571f78 had conflicts only in remote.rs and lan_e2e.py, where both sides were kept.

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/807 **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/guest-death-health` --- ### 📝 Commits (1) - [`65d5a35`](https://github.com/horizon-rust/horizon/commit/65d5a35cd22aa723695b0885a5ecd7d5e3a4b710) Server: a dead guest is sent its health of 0, as ServerPlayer.doTick does ### 📊 Changes **3 files changed** (+14 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/lan/guest.rs` (+2 -1) 📝 `crates/horizon-client/src/lan/hub.rs` (+8 -10) 📝 `tools/lan_e2e.py` (+4 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What When a guest dies, its client is now sent health 0, as vanilla does. One of the server-thread gaps listed in #731; it affects LAN guests and the dedicated server today. - **Vanilla 26.3** (`ServerPlayer.doTick`): `ClientboundSetHealthPacket` goes out on every tick where any of these changed since the last one sent, whether the player is alive or dead: - the health; - the food level; - whether the saturation is zero (`lastSentHealth`, `lastSentFood`, `lastFoodSaturationZero`). - **Horizon before:** - The hub stopped sending health once the guest was dead, so the guest's client kept its last positive health under the death screen (#731 had to make `lan_e2e` tolerate it). - It sent the packet on every change of saturation, not only when the saturation reached or left zero. - **Now:** the hub keeps vanilla's three values in `Guest::sent_health` and sends the packet when one of them changes, dead or alive. ## Proof `tools/lan_e2e.py` `hazards` now checks the guest right after `/kill`: its death screen is open and the health it was sent is 0. | build | `hazards` | |---|---| | main | FAIL: `the guest was killed: {'screen': 'dead', 'health': 20.0}` | | this branch | pass: `died: {'screen': 'dead', 'health': 0.0}`, then hunger and the four hazards as before | ## Checks Run on an integration of this PR with #793 and the other perf-ticks-6 branches (chunk ticket levels, guest death health, server titles, ask_server suggestions, dedicated no-mesh), on main ce571f78: - `cargo fmt --check` and `cargo clippy --workspace --all-targets -- -D warnings`: clean. - `cargo test -p horizon-client --lib`: 851 passed. - `tools/lan_e2e.py` on the integration build: `titles`, `hazards`, `feedback` and `commands` pass. With `--server-thread`, `titles` passes. `hazards` fails at "no hunger from moving", and it fails the same way on plain main, so this branch did not cause it. - `tools/parity.py --changed origin/main` on the first three branches together, then based on 9b97ba09: 89 passed, 0 failed. `chunk_stage` and `chunk_generation` were run on their own as well and passed. The rebase onto ce571f78 had conflicts only in `remote.rs` and `lan_e2e.py`, where both sides were kept. ## 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: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#2825
No description provided.