Skip to content

Currency refactor - #10

Merged
KoertLichtendonk merged 1 commit into
mainfrom
currencies-refactor
Nov 4, 2026
Merged

KoertLichtendonk merged 1 commit into
mainfrom
currencies-refactor

Conversation

@KoertLichtendonk

Copy link
Copy Markdown
Member

Port Currencies from the gamemode to the Framework, built on the component inventories.

  • Currencies feature: CurrencyService (balance, give, take with change, exact bills), PaymentService and PendingPayment for /pay and /acceptpay, cash HUD updates on OnPlayerCashUpdate and OnCharacterSelected. Payments are cancelled when a player disconnects.
  • /givemoney (Admin): takes a currency code, gives to the target player and reports when the bills can't make up the amount.
  • Inventories: fix GetItemInventory (wallet contents were never found), AddItem always returning false (duplicated items on Transfer), inverted stacking and amount checks in FindItem, and ItemAdditionalData.Equals comparing one side only. Add wallet and skin helpers, and implement "Set As Default" and "Wear" in the dialog.
  • Character.GetWallet falls back to the first wallet, then the inventory.
  • BaseManager/ItemManager: compare sync times in UTC so database changes are loaded again, skip self-created rows, reload components in place without losing unsaved changes or child items, and log errors.
  • Permissions: /givepermissiongroup reloads the target's permissions instead of clearing them.
  • /inventory no longer crashes while the inventory isn't loaded.

Port Currencies from the gamemode to the Framework, built on the
component inventories.

- Currencies feature: CurrencyService (balance, give, take with change,
  exact bills), PaymentService and PendingPayment for /pay and
  /acceptpay, cash HUD updates on OnPlayerCashUpdate and
  OnCharacterSelected. Payments are cancelled when a player disconnects.
- /givemoney (Admin): takes a currency code, gives to the target player
  and reports when the bills can't make up the amount.
- Inventories: fix GetItemInventory (wallet contents were never found),
  AddItem always returning false (duplicated items on Transfer),
  inverted stacking and amount checks in FindItem, and
  ItemAdditionalData.Equals comparing one side only. Add wallet and skin
  helpers, and implement "Set As Default" and "Wear" in the dialog.
- Character.GetWallet falls back to the first wallet, then the inventory.
- BaseManager/ItemManager: compare sync times in UTC so database changes
  are loaded again, skip self-created rows, reload components in place
  without losing unsaved changes or child items, and log errors.
- Permissions: /givepermissiongroup reloads the target's permissions
  instead of clearing them.
- /inventory no longer crashes while the inventory isn't loaded.
@KoertLichtendonk
KoertLichtendonk merged commit cc80a9f into main Nov 4, 2026
@KoertLichtendonk
KoertLichtendonk deleted the currencies-refactor branch November 4, 2026 18:52
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