Skip to content

fix: reopen guild house tables after a restart - #41

Merged
Drefvelin merged 1 commit into
mainfrom
fix/house-tables-reopen-after-restart
Oct 12, 2026
Merged

Drefvelin merged 1 commit into
mainfrom
fix/house-tables-reopen-after-restart

Conversation

@Drefvelin

Copy link
Copy Markdown
Contributor

Problem

Guild-owned auto-dealer blackjack tables (RA&T at FIG casino, The_Bog) come back closed after every restart and do not say OPEN until someone interacts with them.

On TFMCMain, Games enables before SimpleFactions (06:10:29 vs 06:10:30 in today's log). SimpleFactions and RPCharacters soft depend on each other, so Paper's load order is not guaranteed. When loadAll readies each table, GuildTables.cap reads 0 because SimpleFactions is not enabled yet, so every guild table counts as over its cap (frozen) and prepareIdle closes it. Nothing readied them again afterwards.

Fix

TableManager readies every idle table again on ServerLoadEvent, and again on PluginEnableEvent for SimpleFactions in case it enables late. This reuses the existing refreshGuildAutoIdle loop, now generalised into refreshIdle.

Testing

  • CI build and unit tests
  • Deployed the PR jar to TFMCDev and restarted it, then checked the guild auto table reopens

🤖 Generated with Claude Code

SimpleFactions and RPCharacters soft depend on each other, so Paper can
enable Games before SimpleFactions. Tables loaded then read every guild
cap as zero, count as over cap, and stay closed until someone touches
them. Ready every idle table again once the server has loaded, and again
if SimpleFactions enables late.

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 →

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: c58c5292-a2cb-4bdf-a628-525811d73548

📥 Commits

Reviewing files that changed from the base of the PR and between 4a039af and fe52a55.


📒 Files selected for processing (1)
  • src/main/java/net/tfminecraft/games/table/TableManager.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
    • Idle tables are refreshed after the server loads and when SimpleFactions is enabled, while active tables remain unaffected.
    • Refreshing tables without a guild ID now safely updates all idle tables.

Walkthrough

TableManager now refreshes idle tables after server load and when SimpleFactions enables. Refreshes can target all idle tables when the guild ID is null. Live tables remain excluded.

Changes

Idle table refresh

Layer / File(s) Summary
Refresh triggers and table selection
src/main/java/net/tfminecraft/games/table/TableManager.java
TableManager refreshes idle tables on server load and when SimpleFactions enables. A null guild ID selects all idle tables; a non-null ID selects matching guild-owned tables. Live tables remain excluded. The guild-specific call now runs only when the guild ID is not null or blank.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: xxfran10xx


Merge Risk: ⚪ Minimal · up to fe52a

The change adds refreshes at server load and SimpleFactions enable. A missed guild lookup could leave a table closed, but that startup condition is unconfirmed and no actionable failure is established.

  • 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.

@Drefvelin
Drefvelin merged commit ea883a5 into main Oct 12, 2026
3 checks passed
@Drefvelin
Drefvelin deleted the fix/house-tables-reopen-after-restart branch October 12, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant