Skip to content

fix: charge offline players through DenarEconomy - #31

Merged
Drefvelin merged 1 commit into
mainfrom
fix/offline-economy-charges
Sep 24, 2026
Merged

Drefvelin merged 1 commit into
mainfrom
fix/offline-economy-charges

Conversation

@Drefvelin

@Drefvelin Drefvelin commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Vehicle upkeep, dividends, wages, wealth, and citizen-income ledgers ask DenarEconomy to resolve the player. SimpleFactions no longer decides whether they are online.
  • An owner who cannot be resolved is left unpaid, so the charge is not written onto a stand-in account.
  • Depends on DenarEconomy 0.2.4.

Test plan

  • mvn test for the upkeep and payout suites against the new API
  • After the next TFMCMain restart, an offline vehicle owner with bank funds is charged from that bank, and a guild dividend reaches an offline member

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes
    • Improved how player accounts are matched when viewing balances, receiving payouts, and managing vehicle upkeep, including for offline players.
    • Vehicle upkeep is now recorded as unpaid when an owner’s account cannot be resolved or a charge fails. Online owners are notified when a charge fails.
    • Vehicle upkeep charges are applied to the resolved owner’s account rather than an unrelated account.

Vehicle upkeep, dividends, and wages were resolved with a stand-in id when the player was offline, so the saved account was never touched.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 5b58626e-d0f9-478f-97b3-52dbc9b0e4f8

📥 Commits

Reviewing files that changed from the base of the PR and between 2ab726d and b41bf50.

📒 Files selected for processing (11)
  • pom.xml
  • src/main/java/net/tfminecraft/simplefactions/managers/FactionManager.java
  • src/main/java/net/tfminecraft/simplefactions/managers/PlayerManager.java
  • src/main/java/net/tfminecraft/simplefactions/mercenary/contract/MercenaryEngagements.java
  • src/main/java/net/tfminecraft/simplefactions/player/PlayerEconomyManager.java
  • src/main/java/net/tfminecraft/simplefactions/utils/Wealth.java
  • src/main/java/net/tfminecraft/simplefactions/vehicles/maintenance/DenarEconomyPlayerBank.java
  • src/main/java/net/tfminecraft/simplefactions/vehicles/maintenance/VehicleUpkeepService.java
  • src/main/java/net/tfminecraft/simplefactions/vehicles/registry/VehicleOwnershipQueries.java
  • src/test/java/net/tfminecraft/simplefactions/utils/PostSettlementPayoutsTest.java
  • src/test/java/net/tfminecraft/simplefactions/vehicles/maintenance/VehicleUpkeepServiceTest.java
 _____________________________________________________________
< Tabs vs spaces? You somehow chose violence *and* confusion. >
 -------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@Drefvelin
Drefvelin merged commit 04b7f55 into main Sep 24, 2026
1 of 2 checks passed
@Drefvelin
Drefvelin deleted the fix/offline-economy-charges branch September 24, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant