AmmoniumX / AdminShop

Admin Shop Minecraft Mod
GNU Lesser General Public License v2.1
4 stars 4 forks source link

Invalid account data in client.json files causes unexpected behavior #25

Closed AmmoniumX closed 4 months ago

AmmoniumX commented 11 months ago

Describe the bug Having a *_client.json file with an invalid default account can cause crashes and invalid accounts to be shown in shops To Reproduce Steps to reproduce the behavior:

  1. Go to /config/adminshop/
  2. Replace the content in any of the *_client.json files to an invalid account, such as one the player does not have access to.
  3. This will make the client "think" it has access to this account, and can crash when placing buyers/sellers

Expected behavior The client should recognize this as an invalid account and reset it to the player's personal account

Minecraft Version: 1.19.2/1.19.4 Mod Version: 1.16

adamico commented 11 months ago

I think you should save the *_client.json file in the World folder, it would prevent shipping the file with modpacks, because to do that you would have to expressely move it in the defaultconfigs folder (to be copied into the world folder). I hope I'm clear, feel free to tell me if you don't get my blabla 😄

adamico commented 11 months ago

as we discussed, a config/adminshop/client/world name_client.json could be a good solution. And also, the adminshop-common.toml lines:

#Display configurations. Options for changing client view
[display_config]
    #Displays your current balance and gained balance per second in the top left corner
    "Balance Display" = true
    #If monetary values should be formatted as M/B/T/etc (Short) instead of Million/Billion/Trillion/etc (Full)
    "Short mode " = true

should be moved to a separate client config to allow pack developers removing it from the overrides folder

AmmoniumX commented 4 months ago

Fixed in newest version