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

[BUG] Town/Nation Shops not working #794

Closed
spikehidden opened this issue Mar 4, 2023 · 11 comments
Closed

[BUG] Town/Nation Shops not working #794

spikehidden opened this issue Mar 4, 2023 · 11 comments
Assignees
Labels
enhancement New feature or request outside scope not a QuickShop issue.

Comments

@spikehidden
Copy link

Description

When Mayors or Kings create Nation or Town shops with QuickShop nothing can be bought or sold there and only an error message appears: [see screenshot]

Translated:

Sorry,but an internal Error happened while processing the transaction. The transaction was cancelled.
Please contact the Server Admin if this keeps happening.

Also the following Error appears in the console:

[15:56:40 ERROR]: [QuickShop-Hikari] EconomyTransaction Failed, last error: Failed to deposit 500.0 to player f9b4d706-b688-3636-ace1-af8f07dca545 account. LastError: Gringotts: FAILURE - Unbekannter Fehler.

Besides this when enabling taxes-to-town it does not work which I think is probably the same cause like #4, though I'm not sure.

Steps to reproduce

  1. Create a shop
  2. Use /qs town//qs nation to make it a town/nation shop
  3. Buy something
  4. Error appeares

Expected Behaviour

You should be able to buy something without causing any errors.

Screenshots

image

/qs paste URL

https://ghost-chu.github.io/quickshop-hikari-paste-viewer/?remote=https%3A%2F%2Fbytebin.lucko.me%2Fk3dZNA8FE8

Additional Context

I'm not sure if this is an issue with QuickShop or actually with the economy plugin i use so created there also an issue under nikosgram/gringotts-towny#5.

@Ghost-chu
Copy link
Collaborator

Please try to disable Essentials's workaround by turn off workaround-for-account-name in plugins/qscompat-towny/config.yml.

If it doesn't work, please wait Gringotts's developers reply.

I'll keep an eye on the two issues you opened both on this and Gringotts's repository, feel free to ping me on Github if I forget it.

@Ghost-chu
Copy link
Collaborator

Also, please try to provide information in English as much as possible, I cannot translate the text in the images.

@spikehidden
Copy link
Author

Also, please try to provide information in English as much as possible, I cannot translate the text in the images.

I did translate it in English at the beginning in my message.
But I will try to remind to set Minecraft to English to get English error messages next time.


Please try to disable Essentials's workaround by turn off workaround-for-account-name in plugins/qscompat-towny/config.yml.

I know you said I should wait just wanted to update you that this did not fix the issue and just caused lag when trying to buy something from a town or nation shop. It did not disturb the performance for the player shops though.

@Ghost-chu
Copy link
Collaborator

Also, please try to provide information in English as much as possible, I cannot translate the text in the images.

I did translate it in English at the beginning in my message. But I will try to remind to set Minecraft to English to get English error messages next time.

Please try to disable Essentials's workaround by turn off workaround-for-account-name in plugins/qscompat-towny/config.yml.

I know you said I should wait just wanted to update you that this did not fix the issue and just caused lag when trying to buy something from a town or nation shop. It did not disturb the performance for the player shops though.

Could you also provide gringotts-towny configuration?
I need check few settings in that file.

@Ghost-chu
Copy link
Collaborator

Please try this snapshot build: https://ci.codemc.io/job/Ghost-chu/job/QuickShop-Hikari-SNAPSHOT/1442/artifact/compatibility/towny/target/Compat-Towny-4.1.0.3.jar

You will need reset your qscompat-towny's configuration to let it regenerate with new config keys.

Then, set uuid-conversion to 2 for switch conversion workaround to gringotts-towny.

I haven't tested this yet, so I hope it works.

Note that the changes will only be applied to the new Town/Nation store, the existing store will still maintain the old behavior.

@spikehidden
Copy link
Author

Config

Could you also provide gringotts-towny configuration? I need check few settings in that file.

Here's the config you have asked for:

gringotts-towny/config.yml
# supported languages: "custom" (default, english), "de" (german), and "pt-BR" (brazilian portuguese).
language: de

# changes the required sign name for the creation of town/nation vaults
# Example: [town vault]
town_sign_vault_name: 'town'
nation_sign_vault_name: 'nation'

Snapshot

And I tested the snapshot and the Error does still appear:

- [01:43:23 ERROR]: [QuickShop-Hikari] EconomyTransaction Failed, last error: Failed to deposit 100.0 to player 5c943dfe-4823-456e-8d08-34b20336ed6b account. LastError: Gringotts: FAILURE - Unknown Error.

Also just in case I have added the towny module config as well.

qscompat-towny/config.yml
# Should allow Mayor grant the shop administrator permission on they town.
allow-mayor-permission-override: true

# Should allow Mayor grant the shop administrator permission on they town.
allow-king-permission-override: true

# Should allow override the owner name from town/nation vault name to town/nation display name.
allow-owner-name-override: true

# If QS should ignore disabled worlds.
ignore-disabled-worlds: true

# Should we also check flags and other stuff even target world not enabled in Towny
whitelist-mode: true

# Should we send the taxes to the town/nation vault account if shop inside a town or nation.
# NOTE: If shop belongs to a Town or Nation, taxes will still send to Server taxes account.
taxes-to-town: true

# Should we delete player's shops in town when they leaved the that town
delete-shop-on-resident-leave: false

# Should we remove the shops in plot when plot cleared
delete-shop-on-plot-clear: true

# Should we remove the shops in plot when plot unclaimed
delete-shop-on-plot-unclaimed: true

# Workaround for username issue
workaround-for-account-name: false

# Workaround for uuid conversion issue
# 0=standard
# 1=essentials
# 2=gringotts-towny
uuid-conversion: 2

# Which checks does a player need to pass to create a shop?
# You can use multiple checks at the same time.
# Priority: UP > DOWN
#
# Available fields:
# OWN = The player must own the plot to create a shop.
# MODIFY = The player must have the ability to build on the target plot to create a shop.
# SHOPTYPE = The player must create the shop on a SHOP type plot.
create:
- SHOPTYPE
- MODIFY

# Which checks does a player need to pass to trade with a shop?
# You can use multiple checks at the same time.
# Priority: UP > DOWN
#
# Available fields:
# OWN = The player must own the plot to trade with a shop.
# MODIFY = The player must have the ability to build on the target plot to trade with a shop.
# SHOPTYPE = The player must trade with the shop on a SHOP type plot.
trade: []

# The shops under bank mode will only accept items from player but money goes to the town bank account.
# And all
bank-mode:
  # Only allow shop transform to bank mode when shop at bank plot
  bank-plot-only: true
  # Enforce the bank mode shops to use price that specified in the config.
  # The items not included will deny to be turned a bank mode shop
  enable: true
  # Extra percent of money they can make from the bank mode shop to bank account so bank can make money.
  extra-percent: 0.1 # 0.10 = 10%
  # Item list
  # Only allow the bank mode shops created if they trade those items.
  # To add a price for an item to lock the item price (if force-prices enabled)
  # Set -1 for price will disable price lock for this type of item even force-prices turned on.
  # MATERIAL: PRICE
  item-list:
    COPPER_ORE: 0.01
    IRON_ORE: 0.05
    COAL_ORE: 0.1
    LAPIS_ORE: 0.25
    REDSTONE_ORE: 1.0
    GOLD_ORE: 5.0
    DIAMOND_ORE: 20.0
    EMERALD_ORE: 500.0
    DEEPSLATE_COPPER_ORE: 0.01
    DEEPSLATE_IRON_ORE: 0.05
    DEEPSLATE_COAL_ORE: 0.1
    DEEPSLATE_LAPIS_ORE: 0.25
    DEEPSLATE_REDSTONE_ORE: 1.0
    DEEPSLATE_GOLD_ORE: 5.0
    DEEPSLATE_DIAMOND_ORE: 20.0
    DEEPSLATE_EMERALD_ORE: 500.0
    # NETHER_QUARTZ_ORE: 0.50
    # NETHER_GOLD_ORE: 1.25
    ANCIENT_DEBRIS: 250.0
config-version: 2
# HEART_OF_THE_SEA: 2500.00
# ENCHANTED_GOLDEN_APPLE: 25000.00

By the way when buying from town/nation shops the whole server freezes for several seconds. This doesn't happen for player shops. Which could also caused by the fact that Gringotts uses ebean.
See nikosgram/gringotts#108
Which also causes some lag when claiming new plots for a town but that's another not with your plugin related issue.

Possible Workaround

I maybe know a workaround.
Gringotts uses the moneyadm add/remove <[type:]name> command to add or remove money from or to player or towny accounts. So instead of trying to interact with the towny API to add or take money from town/nation accounts it could be possible to run for example moneyadm add town:my_town 9.99 as the console when something got bought and then check afterwards if the amount was added.

I know this way is kinda "hacky" but this would be the only approach I know as someone who does almost know nothing about Java or the Towny API.

@Ghost-chu
Copy link
Collaborator

Please try this snapshot build: https://ci.codemc.io/job/Ghost-chu/job/QuickShop-Hikari-SNAPSHOT/1442/artifact/compatibility/towny/target/Compat-Towny-4.1.0.3.jar

You will need reset your qscompat-towny's configuration to let it regenerate with new config keys.

Then, set uuid-conversion to 2 for switch conversion workaround to gringotts-towny.

I haven't tested this yet, so I hope it works.

Note that the changes will only be applied to the new Town/Nation store, the existing store will still maintain the old behavior.

command does not provide the required information, which can only be provided by the API call.
QuickShop uses UUID as an identifier, and it looks like there are still problems with UUID identification.
Thanks for the information, I will continue to check the code.

@Ghost-chu
Copy link
Collaborator

After my inspection, the plugin you requested handles player accounts and system accounts separately.
Unfortunately, QuickShop-Hikari is currently unable to handle this sorting.
I will keep this feature request open to support it in the future when appropriate.

@Ghost-chu Ghost-chu added enhancement New feature or request outside scope not a QuickShop issue. in-schedule This task has been put on the schedule labels Mar 11, 2023
@Ghost-chu
Copy link
Collaborator

Ghost-chu commented Mar 11, 2023

I have this issue on the schedule and will try to implement this feature in the next major release when I make internal code changes.

@Ghost-chu Ghost-chu self-assigned this Mar 11, 2023
@Ghost-chu Ghost-chu removed the in-schedule This task has been put on the schedule label Mar 15, 2023
@Ghost-chu
Copy link
Collaborator

Added new QUser API to allow username-based Accounts, will refactor Towny addon in due course.

@Ghost-chu
Copy link
Collaborator

QUser has been introduced into QuickShop-Hikari and system accounts will now correctly use username-based Vault calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request outside scope not a QuickShop issue.
Projects
None yet
Development

No branches or pull requests

2 participants