[PR #1145] [MERGED] Hurt and attack logs per player (control socket hurtlog), kept across a guest's respawn #3091

Closed
opened 2026-11-02 16:01:27 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/hurtlog-guest-respawn


📝 Commits (2)

  • 3318395 Hurt and attack logs per player, read with hurtlog on the control socket
  • 169be63 hurtlog keeps a LAN guest's hurts across a respawn

📊 Changes

7 files changed (+165 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+18 -1)
📝 crates/horizon-client/src/game/control.rs (+53 -0)
📝 crates/horizon-client/src/game/creatures.rs (+5 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+9 -1)
📝 crates/horizon-client/src/health.rs (+65 -0)
📝 crates/horizon-client/src/lan/guest.rs (+8 -0)
📝 crates/horizon-client/src/motion.rs (+7 -0)

📄 Description

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

What

Test tooling, nothing player-facing:

  • Every hurt a player takes (PlayerMotion::hurt_blocking, which all player damage goes through) is logged: damage type, amount before blocking and armour, what a raised shield stopped, health and absorption lost, armour and toughness met, fire ticks, health left and, for a mob's blow, the knockback. Every melee blow on a mob too: damage after attack strength, the strength, a critical hit, whether it landed and killed. The last 64 of each are kept.
  • hurtlog on the control socket hands them out per player (the host and each LAN guest) and clears them, so a harness can compare a fight with vanilla hit by hit.
  • A guest's logs pass to its new body when it respawns, so the hurts that killed it aren't lost.

Cherry-picked from the companion branch (fdfa9523, df9fa5f0, RESUME §2 9b). #1146 (guest worn armour) is stacked on this one.

Proof

Used by lan_e2e --check worn and --check deflect, which pass in-frame.

Self-check

All 18 B5 branches merged on one integration commit over origin/main b31cb422 (Mac mini):

cargo fmt --all --check                                                  ok
set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings   exit 0, no ^error
cargo test -p horizon-client                                             1087 passed, 0 failed
python3 tools/parity.py --changed origin/main                            102 passed, 0 failed (over b7390d78)
python3 tools/parity.py --changed-files <explosion.rs>                   22 passed, 0 failed (over b31cb422, after rebasing onto #1101)

tools/lan_e2e.py, full runs over b31cb422 (48 checks):

  • --server-thread: 47 passed; swings (the guest's hoe) failed after earlier checks and passes alone.
  • in-frame: 44 passed. cracks caught a guest's crack left behind when its own tick broke the block (fixed in the cracks PR; swings then cracks and a 3-break probe now pass in both modes). barter (piglin gone), swings and effects fail only after earlier checks and pass alone.
  • sign (not touched here) fails about 1 run in 4, on main too: place reports 2 ticks after the click, sometimes before the server's answer. Noted in FEATURES.md with the other flakes.

🤖 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/1145 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/hurtlog-guest-respawn` --- ### 📝 Commits (2) - [`3318395`](https://github.com/horizon-rust/horizon/commit/33183952d54524a91c7c2bcdae1639268bc20602) Hurt and attack logs per player, read with `hurtlog` on the control socket - [`169be63`](https://github.com/horizon-rust/horizon/commit/169be6374c43ede203f7b0eb97eeebc4b5f68fcc) hurtlog keeps a LAN guest's hurts across a respawn ### 📊 Changes **7 files changed** (+165 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+18 -1) 📝 `crates/horizon-client/src/game/control.rs` (+53 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+5 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+9 -1) 📝 `crates/horizon-client/src/health.rs` (+65 -0) 📝 `crates/horizon-client/src/lan/guest.rs` (+8 -0) 📝 `crates/horizon-client/src/motion.rs` (+7 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Test tooling, nothing player-facing: - Every hurt a player takes (`PlayerMotion::hurt_blocking`, which all player damage goes through) is logged: damage type, amount before blocking and armour, what a raised shield stopped, health and absorption lost, armour and toughness met, fire ticks, health left and, for a mob's blow, the knockback. Every melee blow on a mob too: damage after attack strength, the strength, a critical hit, whether it landed and killed. The last 64 of each are kept. - `hurtlog` on the control socket hands them out per player (the host and each LAN guest) and clears them, so a harness can compare a fight with vanilla hit by hit. - A guest's logs pass to its new body when it respawns, so the hurts that killed it aren't lost. Cherry-picked from the companion branch (`fdfa9523`, `df9fa5f0`, RESUME §2 9b). #1146 (guest worn armour) is stacked on this one. ## Proof Used by `lan_e2e --check worn` and `--check deflect`, which pass in-frame. ### Self-check All 18 B5 branches merged on one integration commit over origin/main `b31cb422` (Mac mini): ``` cargo fmt --all --check ok set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings exit 0, no ^error cargo test -p horizon-client 1087 passed, 0 failed python3 tools/parity.py --changed origin/main 102 passed, 0 failed (over b7390d78) python3 tools/parity.py --changed-files <explosion.rs> 22 passed, 0 failed (over b31cb422, after rebasing onto #1101) ``` `tools/lan_e2e.py`, full runs over `b31cb422` (48 checks): - `--server-thread`: 47 passed; `swings` (the guest's hoe) failed after earlier checks and passes alone. - in-frame: 44 passed. `cracks` caught a guest's crack left behind when its own tick broke the block (fixed in the cracks PR; `swings` then `cracks` and a 3-break probe now pass in both modes). `barter` (piglin gone), `swings` and `effects` fail only after earlier checks and pass alone. - `sign` (not touched here) fails about 1 run in 4, on main too: `place` reports 2 ticks after the click, sometimes before the server's answer. Noted in FEATURES.md with the other flakes. 🤖 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 16:01:27 +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#3091
No description provided.