Skip to content

Lures: a restart is harmless and only a saved death settles - #16

Merged
ryanbarlow97 merged 2 commits into
mainfrom
fix/restart-keeps-lure-harmless
Oct 12, 2026
Merged

ryanbarlow97 merged 2 commits into
mainfrom
fix/restart-keeps-lure-harmless

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Since #15, shutdown recorded every committed player as departing, and the SHUTDOWN session end did the same. Anyone not back with a ready character within logout-grace-seconds of the stop then owed a death on their next login, for a restart they didn't choose.

Shutdown now records nothing, and a SHUTDOWN session end is ignored. After the restart the empty lure fails without penalty, as it did before 0.3.0. Switching and quitting still start the grace.

The lure also settled on the DEATH session end, which RPCharacters fires before it saves the death. If that save failed, the character stayed alive but was already released from the lure. Lures now settle on the TLibs CharacterDeathEvent, which fires only after the death is saved. It settles only the commitment of the character that died (the departed character, or the current one when there was no departure), and only while TLibs still reports that character as dead, so a repeated event or a replay after a revival changes nothing. The DEATH end itself does nothing, so it starts no logout grace. An ordinary player death settles exactly as before.

character-required used &c where every other message uses #c45c5c, and its built-in fallback for older messages.yml files had no prefix. Both now match the other messages.

mvn clean verify passes: 170 tests, coverage gate met.

Docs: TF-Minecraft/Docs#171

🤖 Generated with Claude Code

Shutdown recorded every committed player as departing, so anyone not back
within logout-grace-seconds of the stop owed a death. A restart is now
ignored again: the empty lure fails without penalty, as before 0.3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the size:S 10-29 effective changed lines (tests excluded in mixed PRs). label Oct 12, 2026
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f790ad8d-1083-4c02-86f3-ab73928941bc

📥 Commits

Reviewing files that changed from the base of the PR and between 1097f93 and 6086602.


📒 Files selected for processing (6)
  • src/main/java/net/tfminecraft/infestations/Messages.java
  • src/main/java/net/tfminecraft/infestations/infestation/InfestationManager.java
  • src/main/java/net/tfminecraft/infestations/utils/Characters.java
  • src/main/resources/messages.yml
  • src/test/java/net/tfminecraft/infestations/InfestationsServicesTest.java
  • src/test/java/net/tfminecraft/infestations/infestation/InfestationManagerTest.java

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 14653721-6a45-4470-bd1e-ea3e2034047c


📥 Commits

Reviewing files that changed from the base of the PR and between d9f62b1 and 1097f93.



📒 Files selected for processing (3)
  • src/main/java/net/tfminecraft/infestations/infestation/InfestationManager.java
  • src/test/java/net/tfminecraft/infestations/InfestationsServicesTest.java
  • src/test/java/net/tfminecraft/infestations/infestation/InfestationManagerTest.java


Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.




📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Server shutdowns and restarts no longer count as player departures or trigger logout-related penalties. Players remain committed until normal offline checks resolve their status.
    • Leaving through other reasons, such as switching or quitting, continues to follow the existing departure handling.
📝 Summary

Walkthrough

The manager no longer records online character sessions as departures during shutdown. Session endings with reason SHUTDOWN skip departure handling and its subsequent save. Tests cover the retained commitment and the offline wipe behaviour.

Changes

Shutdown session handling

Layer / File(s) Summary
Skip departure handling on shutdown
src/main/java/net/tfminecraft/infestations/infestation/InfestationManager.java, src/test/java/net/tfminecraft/infestations/InfestationsServicesTest.java, src/test/java/net/tfminecraft/infestations/infestation/InfestationManagerTest.java
The manager skips departure handling for SHUTDOWN session endings. Tests verify that logout and death-on-login records remain empty, the infestation remains committed, and an offline player’s commitment and lure phase are cleared by checkWipe.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix



Merge Risk: ⚪ Minimal · up to 1097f

Restarts no longer record online players as departures, while shutdown still saves infestation state. No actionable merge risk is established by the reviewed changes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 12, 2026
The DEATH session end fires before RPCharacters saves the death, so a failed
save left a living character released from its lure. Lures now settle on the
TLibs CharacterDeathEvent, only for the character the commitment belongs to
and only while the provider still records that character as dead, so a
repeat or a replay after a revival changes nothing. The DEATH end still
starts no logout grace, and an ordinary death settles as before.

character-required now uses the same hex red as the other errors, and its
built-in fallback for older messages.yml files carries the prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ryanbarlow97 ryanbarlow97 changed the title A server restart no longer starts lure logout grace Lures: a restart is harmless and only a saved death settles Oct 12, 2026
@github-actions github-actions Bot added size:M 30-99 effective changed lines (tests excluded in mixed PRs). and removed size:S 10-29 effective changed lines (tests excluded in mixed PRs). labels Oct 12, 2026
@ryanbarlow97
ryanbarlow97 merged commit 642da12 into main Oct 12, 2026
3 checks passed
@ryanbarlow97
ryanbarlow97 deleted the fix/restart-keeps-lure-harmless branch October 12, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant