weihao / EnchantmentsEnhance

✨ EE is a game progression mechanism plugin for spigot.
GNU General Public License v3.0
32 stars 19 forks source link

MySQL data sync error #188

Closed Soldier233 closed 4 years ago

Soldier233 commented 4 years ago

Before reporting an issue make sure you are running the latest build of the plugin and checked for duplicate issues!

What behaviour is observed:

the plugin using mysql mode will lose data when changing server

Steps to reproduce:

Connect two servers of EE to one mysql table change server, data lose sometime.

Plugin list:

[23:25:49 INFO]: Plugins (32): AdvancedCleaner, Citizens, CMI, CommandNPC, Craftconomy3, DiamondLand, DiamondWorld, EnchantmentsEnhance, LockettePro, mcMMO, MiaoBoard, Multiverse-Core, Multiverse-NetherPortals, MyPet, PermissionsEx, PlaceholderAPI, PlayerPoints, PlayerSQL, PlugMan, ProtocolLib, QuickShop, RandomParachute, Residence, SimpleORM, SQLibrary, TAB, TrChat, TrMenu, Vault, ViaVersion, VipSystem, WorldEdit

Environment description

Enchantments Enhance build number:

[23:26:48 INFO]: EnchantmentsEnhance version 7.9.7
[23:26:48 INFO]: This is a Black Desert Online Style of Enchantment enhancing
[23:26:48 INFO]: Website: https://github.com/25
[23:26:48 INFO]: Authors: HealPot, HealPot and lgou2w

Error Log:

None

Advice to fix

Add a interval before getting data from the server when joining the server.

weihao commented 4 years ago

Maybe you should add a cooldown when switching servers? The problem could be caused by the latency of writing to the database.

Even adding a repeatable task will sometimes cause data loss if there is a delay.

Soldier233 commented 4 years ago

yes. But I found plugin Mypet solved this problem by adding a delay in fetching data from db.

Soldier233 commented 4 years ago

btw. Is there a api to get the level of player's weapon and armour. I want to enhance the monster of the players nearby according to their levels.

weihao commented 4 years ago

yes. But I found plugin Mypet solved this problem by adding a delay in fetching data from db.

What do you mean by that? Do you mean adding a delay when a player joins the server?

Soldier233 commented 4 years ago

use runTaskLater(instance,20l) to get the data from mysql when joining the server