Skip to content

[82] Preserve current health across relog like C++#85

Merged
alseif0x merged 5 commits into
3.4.3from
82-follow-up-preserve-current-health-across-relog-like-c++
Jul 1, 2026
Merged

[82] Preserve current health across relog like C++#85
alseif0x merged 5 commits into
3.4.3from
82-follow-up-preserve-current-health-across-relog-like-c++

Conversation

@alseif0x

@alseif0x alseif0x commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Closes #82

Summary

  • Load characters.health as current health and restore it after max-health recalculation, clamped like C++ Player::LoadFromDB.
  • Include current health in the logout/disconnect save snapshot and persist it before powers, matching C++ Player::SaveToDB.
  • Reconcile split session/canonical health for saves: canonical health wins for fresh live damage, session death wins over stale canonical health.
  • Sync resurrection, corpse reclaim, and lethal runtime damage into the canonical player health/death-state; corpse reclaim now restores 50% health like C++ outside battlegrounds.
  • Document the PR closeout gate requiring CI plus Codex reviewer verdict before merge/issue close.

C++ anchors

  • /home/server/woltk-trinity-legacy/src/server/game/Entities/Player/Player.cpp Player::LoadFromDB: saved health zero marks corpse, then SetHealth(min(savedHealth, GetMaxHealth())) after stat recalculation.
  • /home/server/woltk-trinity-legacy/src/server/game/Entities/Player/Player.cpp Player::SaveToDB: writes GetHealth() immediately before power fields.
  • /home/server/woltk-trinity-legacy/src/server/game/Entities/Player/Player.cpp Player::ResurrectPlayer and /home/server/woltk-trinity-legacy/src/server/game/Handlers/MiscHandler.cpp HandleReclaimCorpse: reclaim uses ResurrectPlayer(0.5f) outside battlegrounds.

Validation

  • cargo fmt --check
  • PROTOC=/home/cdmonio/.local/protoc/bin/protoc cargo test -p wow-world --lib (2630 passed)
  • PROTOC=/home/cdmonio/.local/protoc/bin/protoc cargo test -p wow-world logout_save_snapshot --lib
  • PROTOC=/home/cdmonio/.local/protoc/bin/protoc cargo test -p wow-world reclaim_corpse_dead_ghost_resurrects_and_clears_ghost_like_cpp --lib
  • PROTOC=/home/cdmonio/.local/protoc/bin/protoc cargo test -p wow-world runtime_damage_zero_health_marks_canonical_player_dead_like_cpp --lib
  • PROTOC=/home/cdmonio/.local/protoc/bin/protoc cargo check -p world-server
  • git diff --check
  • Live client validation on rustycore-world: Luqedos damaged from 6310 to 2978, logout/re-enter preserved 2978; DB confirmed characters.health = 2978.
  • GitHub checks green on current HEAD, including Codex reviewer verdict.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2a7b49d4a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/wow-world/src/session.rs Outdated
@alseif0x

alseif0x commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa4c8370a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/wow-world/src/session.rs Outdated
@alseif0x

alseif0x commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a42d4ee91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/wow-world/src/session.rs Outdated
Comment thread crates/wow-world/src/session.rs Outdated
Comment thread crates/wow-world/src/handlers/misc.rs Outdated
@alseif0x

alseif0x commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 2cdf548110

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@alseif0x alseif0x merged commit 33973d0 into 3.4.3 Jul 1, 2026
6 checks passed
@alseif0x alseif0x deleted the 82-follow-up-preserve-current-health-across-relog-like-c++ branch July 1, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[follow-up] Preserve current health across relog like C++

1 participant