Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H2StorageHandler#registerCurrency does not respect locale arguments (unverified) #8

Closed
lokka30 opened this issue Jan 5, 2025 · 2 comments
Assignees
Labels
effort: medium This will require a normal amount of work relative to other issues platform: all Affects all platforms priority: high This should be resolved soon state: approved This issue will be resolved type: bug Reports or resolves a bug

Comments

@lokka30
Copy link
Member

lokka30 commented Jan 5, 2025

This might be caused by the DB reading the data wrong and maybe not writing it wrong via #registerCurrency. we'll need to diagnose.

Steps to reproduce:

  • Create a currency, tokens.

    • /eco currency register token 0 T 1000 en Token Tokens . "%amount% %display-name%"
  • Try give yourself some tokens.

    • /eco give lokka30 123 tokens
  • The command will report back that the currency tokens was used, but it doesn't format the balance correctly:

    • Deposited 123.00 Dollars into lokka30's account (currency: 'tokens').

    • i.e., it appears to be using the default 'dollars' formatting, not the one we defined at the start.
@lokka30 lokka30 added effort: medium This will require a normal amount of work relative to other issues priority: high This should be resolved soon state: approved This issue will be resolved type: bug Reports or resolves a bug platform: all Affects all platforms labels Jan 5, 2025
@lokka30 lokka30 self-assigned this Jan 5, 2025
@lokka30
Copy link
Member Author

lokka30 commented Jan 6, 2025

> eco currency register test 100 T 1000 en Testing Testings . "%amount% %display-name%"
[09:01:47 INFO]: Registering currency...
[09:01:47 INFO]: [Polyconomy] [DEBUG: STORAGE_MANAGER] Inserted locale en into DB for currency test - statement#toString: prep4: INSERT INTO CurrencyLocale (id, locale, display_name_singular, display_name_plural, decimal)
VALUES                     (?,  ?,      ?,                     ?,                   ?) {1: CAST(4 AS BIGINT), 2: 'en', 3: 'Testing', 4: 'Testings', 5: '.'}
[09:01:47 INFO]: Currency registered succesfully!

> bal lokka30 test
[09:02:08 INFO]: Player 'lokka30' has '100.00 Dollars' (currency: 'test').

insertion looks OK

Image

likely a read issue not write issue.

@lokka30
Copy link
Member Author

lokka30 commented Jan 6, 2025

nice, I forgot a WHERE clause on H2Statements.getDisplayNamesForCurrency

@lokka30 lokka30 closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: medium This will require a normal amount of work relative to other issues platform: all Affects all platforms priority: high This should be resolved soon state: approved This issue will be resolved type: bug Reports or resolves a bug
Projects
None yet
Development

No branches or pull requests

1 participant