Repository navigation
Keep bank gold in the gold component - #2969
Merged
Merged
Conversation
The account's bank balance was a bundle property reading and writing AccountDto directly. It now sits in GoldComponent beside the character's gold, and the save and the trade copy it into the account row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014gSmkTzR51DzhJwrXVqDmS
|
Warning Review limit reachedYou'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 10 minutes. View limit details
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. |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Requested by Erwan · project thread
Follow-up to #2967: the last mutable state the player bundle read and wrote straight through a DTO.
What changed
BankGoldwas a hand-written bundle property overAccount.BankMoney. It is now a field ofGoldComponentnext toGold, so the bundle property is generated and no call site changes.CreatePlayertakes the bank balance from the account when the character enters the world.SaveServiceand the trade'sTransferServicecopy it into the account row before writing it, the same way they already copyGoldinto the character row. The trade's rollback restores it too.No behaviour change is intended.
Verification
SaveServiceTests.SavingCharacterPersistsTheAccountsBankGold.TransferServiceTests(bank gold traded, stored and rolled back) still pass.dotnet test NosCore.sln: all green exceptNosCore.Parser.Tests EveryDeclaredEffectIsNamed, which fails the same way on master locally.$SetBankGold 456000, quits, and logs in again. The account row reads 456000 on both, and the bank window then shows 456,000.Each image shows, left to right: the bank at 123,000, after
$SetBankGold 456000, and the bank after relogging.Master:
Branch:
Manual test plan checks still worth a human pass
From
documentation/manual-test-plan.md: deposit and withdraw at the banker with the fee; trade bank gold between two players and relog both.Generated by Claude Code