iSach / UltraCosmetics

Lightweight, Fun and Easy-to-Use Spigot Cosmetics plugin. (Gadgets, etc)
https://www.spigotmc.org/resources/ultra-cosmetics-halloween-update.10905/
GNU Affero General Public License v3.0
166 stars 153 forks source link

MySQL Player data (keys, ammo, etc) is not loaded on join #589

Closed JAHMCR closed 2 years ago

JAHMCR commented 2 years ago

Check if the issue is fixed in dev builds

What steps will reproduce the issue?

  1. Purchase 3 keys
  2. Purchase 20 ammo of any gadget
  3. Disconnect
  4. Join again
  5. Check the available keys, it's displayed as 0 even there is still 3 on the database
  6. Check the available ammo, it's displayed as 0 even there is still 20 on the database

If the player purchase another key, it replaces the current available keys on the database, setting it to 1 instead of 4 (does not add)

If the player purchase more ammo, it replaces the current available ammo on the database, setting it to 20 instead of 24 (does not add)

What was supposed to happen?

The player should see the available keys and ammo after rejoining

What happened instead?

The player have 0 available keys and ammo on rejoin

What version of UltraCosmetics are you using? Do not say 'latest'.

UltraCosmetics 2.6.1 DEV b11

What server distribution (Spigot, Paper, etc.) and what version are you using? Do not say 'latest'.

Paper build 216

What plugins do you have installed?

Plugins (19): CMILib, CoreProtect, Essentials, EssentialsGeoIP, EssentialsSpawn, GriefPrevention, Jobs, mcMMO, Multiverse-Core, PlaceholderAPI, ResourceWorld, Shops, SkinsRestorer, UltraCosmetics, Vault, ViaBackwards, ViaRewind, ViaVersion, WorldEdit

Are there any errors in the console or in logs?

No errors

Additional information that could be helpful in fixing the problem

This issue only happen after the first player join on each server start

datatags commented 2 years ago

I can't seem to reproduce this, ammo and treasure keys are still shown for me after restarting the server. Could you add a key to the config under the MySQL section called debug and set it to true? If MySQL is loading correctly it should output the command it's sending to the MySQL server when the player joins

JAHMCR commented 2 years ago

Yep, they do appear after restarting the server, but just on the first join of the player, I mean, if the player disconnects after the first login and then login again, it doesn't load the data correctly. Will try to add that debug flag and let you know

JAHMCR commented 2 years ago

I dropped the table, changed the table name to 'data' and it seems to be working now

datatags commented 2 years ago

hmm ok, still would have been interesting to know what caused it