Giter VIP home page Giter VIP logo

husksync's Introduction

HuskSync
Spigot Setup Docs Issues


HuskSync is a modern, cross-server player data synchronization system that enables the comprehensive synchronization of your user's data across multiple proxied servers. It does this by making use of Redis and a MySQL/Mongo/PostgreSQL to optimally cache data while players change servers.

Features

⭐ Seamless synchronization — Utilises optimised Redis caching when players change server to sync player data super quickly for a seamless experience.

⭐ Complete player synchronization — Sync inventories, Ender Chests, health, hunger, effects, advancements, statistics, locked maps & more—no data left behind!

⭐ Backup, restore & rotate — Something gone wrong? Restore players back to a previous data state. Rotate and manage data snapshots in-game!

⭐ Import existing data — Import your MySQLPlayerDataBridge data—or from your existing world data! No server reset needed!

⭐ Works great with Plan — Stay in touch with your community through HuskSync analytics on your Plan web panel.

⭐ Extensible API & open-source — Need more? Extend the plugin with the Developer API. Or, submit a pull request through our code bounty system!

Ready? It's syncing time!

Setup

Requires a MySQL/Mongo/PostgreSQL database, a Redis (v5.0+) server and any number of Spigot-based 1.17.1+ Minecraft servers, running Java 17+.

  1. Place the plugin jar file in the /plugins/ directory of each Spigot server. You do not need to install HuskSync as a proxy plugin.
  2. Start, then stop every server to let HuskSync generate the config file.
  3. Navigate to the HuskSync config file on each server (~/plugins/HuskSync/config.yml) and fill in both your database and Redis server credentials.
  4. Start every server again and synchronization will begin.

Development

To build HuskSync, simply run the following in the root of the repository:

./gradlew clean build

License

HuskSync is licensed under the Apache 2.0 license.

Contributions to the project are welcome—feel free to open a pull request with new features, improvements and/or fixes!

Support

Due to its complexity, official binaries and customer support for HuskSync is provided through a paid model. This means that support is only available to users who have purchased a license to the plugin from Spigot, Polymart, Craftaro, or BuiltByBit and have provided proof of purchase. Please join our Discord server if you have done so and need help!

Translations

Translations of the plugin locales are welcome to help make the plugin more accessible. Please submit a pull request with your translations as a .yml file.

Links


© William278, 2023. Licensed under the Apache-2.0 License.

husksync's People

Contributors

arnokeesman avatar ceddix avatar davgo0103 avatar dependabot[bot] avatar eindev avatar emmanuelvlad avatar gabrielecabrini avatar ghost-chu avatar gstio86 avatar harvelsx avatar hookwoods avatar ibanetchep avatar ivillager avatar jhqwqmc avatar joo200 avatar kforbro avatar mateusneresrb avatar namiuni avatar nartsisss avatar nhanledev avatar prodpreva1l avatar q2297045667 avatar rafaelflromao avatar romanalexander avatar rubenicos avatar snowcutieowo avatar thourgard avatar wiiiiam278 avatar wintone01 avatar wirayuda5620 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

husksync's Issues

Server crash presumably HuskSync

Build: https://github.com/HarvelsX/HuskSync/tree/reformat (HuskSync 1.2.2)
Core: git-Paper-134 (MC: 1.18.1)
Crashlog:

[08:43:29] [Paper Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH  - git-Paper-134 (MC: 1.18.1) ---
[08:43:30] [Paper Watchdog Thread/ERROR]: The server has not responded for 10 seconds! Creating thread dump
[08:43:30] [Paper Watchdog Thread/ERROR]: ------------------------------
[08:43:30] [Paper Watchdog Thread/ERROR]: Server thread dump (Look for plugins here before reporting to Paper!):
[08:43:30] [User Authenticator #359/INFO]: UUID of player MrOPimentoO is bcb51f0c-9383-3a45-a7b9-2527fdc8f1e9
[08:43:30] [Paper Watchdog Thread/ERROR]: Ticking entity: minecraft:item, entity class: net.minecraft.world.entity.item.EntityItem
[08:43:30] [Paper Watchdog Thread/ERROR]: Entity status: removed: false, valid: true, alive: true, is passenger: false
[08:43:30] [Paper Watchdog Thread/ERROR]: Entity UUID: c22a5b75-d971-4f87-a523-ee69f46cfa29
[08:43:30] [Paper Watchdog Thread/ERROR]: Position: world: 'world' at location (-849.166259765625, 62.418212890625, -2435.390625)
[08:43:30] [Server thread/INFO]: beviantsev lost connection: Disconnected
[08:43:30] [Paper Watchdog Thread/ERROR]: Velocity: (1.0569685396498082E-115, 0.004318609101522449, -3.349710590944361E-116) (in blocks per tick)
[08:43:30] [Paper Watchdog Thread/ERROR]: Entity AABB: AABB[-849.291259765625, 62.4228515625, -2435.515625] -> [-849.041259765625, 62.6728515625, -2435.265625]
[08:43:30] [Paper Watchdog Thread/ERROR]: ------------------------------
[08:43:30] [Paper Watchdog Thread/ERROR]: Current Thread: Server thread
[08:43:30] [Paper Watchdog Thread/ERROR]: 	PID: 38 | Suspended: false | Native: false | State: RUNNABLE
[08:43:30] [Paper Watchdog Thread/ERROR]: 	Stack:
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream$HandleTable.lookup(ObjectOutputStream.java:2315)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1129)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.util.HashMap.internalWriteEntries(HashMap.java:1943)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.util.HashMap.writeObject(HashMap.java:1497)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/jdk.internal.reflect.GeneratedMethodAccessor1107.invoke(Unknown Source)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.lang.reflect.Method.invoke(Method.java:568)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1201)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1526)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1448)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1191)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.util.HashMap.internalWriteEntries(HashMap.java:1944)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.util.HashMap.writeObject(HashMap.java:1497)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/jdk.internal.reflect.GeneratedMethodAccessor1107.invoke(Unknown Source)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.lang.reflect.Method.invoke(Method.java:568)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1201)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1526)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1448)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1191)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1582)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeRecordData(ObjectOutputStream.java:1500)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1191)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		HuskSync.jar//me.william278.husksync.redis.RedisMessage.serialize(RedisMessage.java:180)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		HuskSync.jar//me.william278.husksync.bukkit.data.DataSerializer.getSerializedStatisticData(DataSerializer.java:294)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		HuskSync.jar//me.william278.husksync.bukkit.util.PlayerSetter.getNewSerializedPlayerData(PlayerSetter.java:54)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		HuskSync.jar//me.william278.husksync.bukkit.util.PlayerSetter.updatePlayerData(PlayerSetter.java:103)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		HuskSync.jar//me.william278.husksync.bukkit.listener.BukkitEventListener.onPlayerQuit(BukkitEventListener.java:39)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor55.execute(Unknown Source)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		org.bukkit.plugin.EventExecutor$$Lambda$5529/0x0000000801b923d0.execute(Unknown Source)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.players.PlayerList.remove(PlayerList.java:606)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.players.PlayerList.remove(PlayerList.java:591)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:1990)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:1970)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.network.Connection.handleDisconnection(Connection.java:714)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:221)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1636)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:480)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1470)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1264)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer$$Lambda$3995/0x000000080143c740.run(Unknown Source)
[08:43:30] [Paper Watchdog Thread/ERROR]: 		[email protected]/java.lang.Thread.run(Thread.java:833)
[08:43:30] [Paper Watchdog Thread/ERROR]: ------------------------------
[08:43:30] [Paper Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH ---
[08:43:30] [Paper Watchdog Thread/ERROR]: ------------------------------

Player death data snapshot

Sometimes, dying in a server can cause issues with inventories if the player has bad connection, or the server is not running well.
Saving a snapshot when the player dies would offer a great tool to manage deaths due to bugs, bad connection or server errors/crashes (or plugin errors.)
It'd aditionally would allow me to delete a redundant, heavy plugin, that also saves data.

Not possible to take items out from the history inventory

Sometimes my players lost their items due to bugs or other reasons, when I review the history inventory (snapshot) of my players and try to restore only some specific items, I can only see the items but can't move any item from the history inventory to my inventory, the InventoryClick event is canceled all the time.

Foreign key constraint exception in certain database environments

Servers that run certain kinds of database stacks, particularly MariaDB ones, occasionally encounter the following exception being thrown in console. It doesn't cause any in-game issues, though and synchronisation seems to continue just fine.

See also #40 for more details.

Stack trace (consistent across all environments)
[09:50:16 ERROR]: [HuskSync] Failed to set user data in the database
java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`husksync_dev`.`husksync_user_data`, CONSTRAINT `husksync_user_data_ibfk_1` FOREIGN KEY (`player_uuid`) REFERENCES `husksync_users` (`uuid`) ON DELETE CASCADE)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:916) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1061) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1009) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1320) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:994) ~[mysql-connector-java-8.0.29.jar:8.0.29]
        at net.william278.husksync.libraries.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[HuskSync-Bukkit-2.1-97a02b7.jar:?]
        at net.william278.husksync.libraries.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HuskSync-Bukkit-2.1-97a02b7.jar:?]
        at net.william278.husksync.database.MySqlDatabase.lambda$setUserData$11(MySqlDatabase.java:364) ~[HuskSync-Bukkit-2.1-97a02b7.jar:?]
        at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?]
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
        at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
        at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]

Maximum health value fails to synchronize properly

[18:39:37 WARN]: [HuskSync] Task #41 for HuskSync v1.0.2 generated an exception
java.lang.IllegalArgumentException: Health must be between 0 and 20.0, but was 49.75. (attribute base value: 20.0, player: [redacted])
        at org.bukkit.craftbukkit.v1_17_R1.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:110) ~[patched_1.17.1.jar:git-Purpur-1260]
        at me.william278.husksync.bukkit.util.PlayerSetter.lambda$setPlayerFrom$0(PlayerSetter.java:154) ~[?:?]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.17.1.jar:git-Purpur-1260]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.17.1.jar:git-Purpur-1260]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1565) ~[patched_1.17.1.jar:git-Purpur-1260]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:492) ~[patched_1.17.1.jar:git-Purpur-1260]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1480) ~[patched_1.17.1.jar:git-Purpur-1260]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1270) ~[patched_1.17.1.jar:git-Purpur-1260]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Purpur-1260]
        at java.lang.Thread.run(Thread.java:831) [?:?]

Support RedisBungee?

I'm deciding whether to buy this plugin.
The README mentioned that multiple proxies are not supported. Is there any plan to support it in a month?

Improve synchronization system stability on environments with fluctuating tick rates

Currently, the network_latency_milliseconds is used to account for the expected lag in handling player disconnects to allow the plugin to serialize and save UserData to Redis. However, on environments where the tick rate fluctuates significantly or those that are prone to sharp lag spikes the predetermined wait can not be enough to account for how much the PlayerQuitEvent is getting delayed from the source server.

Reworking parts of how the synchronization system works to accommodate such environments and prevent user data versions from going out of sync is needed here, which requires a fairly significant adjustment to the approach to track when players join and leave the network versus changing servers, using Redis PubSub messages to query the current set of connected players and "locking" players when changing server.

This issue is a follow-up to a discussion on the Discord, cc. noahiversen et al. (who provided the below diagrams to illustrate how an updated approach may be formed.)

Updated implementation diagram

image
image

(Locked) Map synchronization

The ability for map items to synchronize cross-server. Would require some NMS and probably only be able to work with "locked" maps (i.e uneditable ones). Would need to serialize the map canvas as an image essentially when the map is "locked" and probably put it inside a PersistentDataContainer tag and add that to the map item which would then be loaded from when the player pulls it out.

Error when sync players

Got this error when I log in, and I can't interact with anything.

[12:27:54 ERROR]: [HuskSync] Failed to set data for player BiShop_Ma (java.lang.IllegalArgumentException: Health must be between 0 and 20.899999618530273, but was 22.899999618530273. (attribute base value: 22.9, player: BiShop_Ma))
[12:27:54 WARN]: java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Health must be between 0 and 20.899999618530273, but was 22.899999618530273. (attribute base value: 22.9, player: BiShop_Ma)
[12:27:54 WARN]:        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
[12:27:54 WARN]:        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
[12:27:54 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
[12:27:54 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
[12:27:54 WARN]:        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
[12:27:54 WARN]:        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
[12:27:54 WARN]:        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
[12:27:54 WARN]:        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
[12:27:54 WARN]:        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
[12:27:54 WARN]: Caused by: java.lang.IllegalArgumentException: Health must be between 0 and 20.899999618530273, but was 22.899999618530273. (attribute base value: 22.9, player: BiShop_Ma)
[12:27:54 WARN]:        at org.bukkit.craftbukkit.v1_18_R2.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:110)
[12:27:54 WARN]:        at HuskSync-2.0.1.jar//net.william278.husksync.player.BukkitPlayer.lambda$setStatus$4(BukkitPlayer.java:90)
[12:27:54 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
[12:27:54 WARN]:        ... 6 more

Error occurs when reading player's persistent data map

Sometimes, I can get this kind of error but sometimes I won't.

[04:48:20 WARN]: [HuskSync] Could not read bishop's persistent data map, skipping!
[04:48:20 WARN]: java.util.concurrent.CompletionException: java.lang.NoClassDefFoundError: net/william278/husksync/libraries/commons/lang/ArrayUtils
[04:48:20 WARN]:        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
[04:48:20 WARN]:        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
[04:48:20 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
[04:48:20 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
[04:48:20 WARN]:        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
[04:48:20 WARN]:        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
[04:48:20 WARN]:        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
[04:48:20 WARN]:        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
[04:48:20 WARN]:        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
[04:48:20 WARN]: Caused by: java.lang.NoClassDefFoundError: net/william278/husksync/libraries/commons/lang/ArrayUtils
[04:48:20 WARN]:        at HuskSync-2.0.1.jar//net.william278.husksync.player.BukkitPlayer.lambda$getPersistentDataContainer$40(BukkitPlayer.java:409)
[04:48:20 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
[04:48:20 WARN]:        ... 6 more
[04:48:20 WARN]: Caused by: java.lang.ClassNotFoundException: net.william278.husksync.libraries.commons.lang.ArrayUtils
[04:48:20 WARN]:        ... 8 more

ConcurrentModificationException when reading player persistent data maps in some cases

Stack trace below

[03:25:09 WARN]: [HuskSync] Could not read KrugerRJ's persistent data map, skipping!
[03:25:09 WARN]: java.util.concurrent.CompletionException: java.util.ConcurrentModificationException
[03:25:09 WARN]:        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
[03:25:09 WARN]:        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
[03:25:09 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
[03:25:09 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
[03:25:09 WARN]:        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
[03:25:09 WARN]:        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.helpAsyncBlocker(ForkJoinPool.java:1253)
[03:25:09 WARN]:        at java.base/java.util.concurrent.ForkJoinPool.helpAsyncBlocker(ForkJoinPool.java:2237)
[03:25:09 WARN]:        at java.base/java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1887)
[03:25:09 WARN]:        at java.base/java.util.concurrent.CompletableFuture.join(CompletableFuture.java:2117)
[03:25:09 WARN]:        at HuskSync-2.2.2.jar//net.william278.husksync.player.OnlineUser.lambda$getUserData$3(OnlineUser.java:358)
[03:25:09 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
[03:25:09 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
[03:25:09 WARN]:        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
[03:25:09 WARN]:        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
[03:25:09 WARN]:        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
[03:25:09 WARN]:        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
[03:25:09 WARN]:        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
[03:25:09 WARN]: Caused by: java.util.ConcurrentModificationException
[03:25:09 WARN]:        at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1221)
[03:25:09 WARN]:        at org.bukkit.craftbukkit.v1_19_R2.persistence.CraftPersistentDataTypeRegistry.isInstanceOf(CraftPersistentDataTypeRegistry.java:231)
[03:25:09 WARN]:        at org.bukkit.craftbukkit.v1_19_R2.persistence.CraftPersistentDataContainer.has(CraftPersistentDataContainer.java:54)
[03:25:09 WARN]:        at HuskSync-2.2.2.jar//net.william278.husksync.player.BukkitPlayer.lambda$getPersistentDataContainer$40(BukkitPlayer.java:462)
[03:25:09 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
[03:25:09 WARN]:        ... 14 more```

redis add so_keepalive or automatic reconnection function

My VPS hosting company has a policy on their firewall. When a TCP connection is inactive for 2 minutes, it is killed.

Just like MySQL HikariCP keepalive_time (tcp_keepalive_time) can solve this problem

But I didn't find a similar setting on redis in the configuration file, he won't even reconnect.

Add support for Slimefun items (via dough CustomItemStack API)

When using Slimefun and HuskSync on the subserver, the guide book that comes with Slimefun cannot be opened
This problem also occurs on ItemJoin, and the menu bound with the menu command cannot be opened.
If you don’t call the chest inventory like ChestCommands, the item can be used normally
After the cross-server has not been tested

Proxy: FlameCord 0.6.8
Backend servers: Patina 1.17.1 (a paper fork)
MariaDB 10.5.6 | Data is stored in UTF-8 format
Redis 6.2.6
all working normally
HuskSync: 1.2.2

Wiki Section on this Repo

Due to abundant questions on setup and how features of HuskSync works it'd seem only fair to allow for a Wiki section of this Repo to be added including such areas as:

  • Basic Guide to installing and setting up Redis
  • A FAQ section
  • A Roadmap
  • Details on the Events API
    and more...

Saving players with keepInventory enabled on death saves a state where a player has an empty inventory as #getDrops returns an empty list

Issue:

When a player dies with keepInventory enabled (event.getKeepInventory), it saves an empty inventory because #getDrops is empty.

Usecase:

Using a dynamic keepInventory in certain worlds/regions and need to save players inventory on death if keepInventory is disabled

Proposed solutions:

  1. Do not save on death if the player has keepInventory enabled.
    | This is a quick fix but will not support custom half-keepinv where only some items drop
  2. Save player's inventory and drops only if drops are not empty
    | Supports custom half-keepinv and saves only if there are drops, else do not create useless snapshot

Possible to drop items after save on disconnect

Some environments have found that this can mean players can drop already saved items before they disconnect.
Literally removing this line should fix it?

.thenRun(() -> lockedPlayers.remove(user.uuid))

This line is kind of pointless anyway; it’s only really there for posterity’s sake of keeping the locked players list not too long, which is really a non issue.

Players Inventory Item NBT datas are lost.

When shutting down a Paper server normally, HuskSync will lose some data like custom enchantments when storing items NBT in the players' inventory but vanilla enchantments are not lost. Sometimes all the items in inventory of the players will be lost! (I am not good at English, so I used Google Translator)

Using MMOItems which change the player's health attribute base value causes an IllegalArgumentException

When using an MMOItem that changes the user's health, it can cause an IllegalArgumentException. This may be incorrect, but I believe it may have to do with how MMOItems sets the health. It does not seem to set the health based on the MAX_HEALTH attribute (which would be a value between 0.0 and 1.0) but rather sets it directly (as seen below being 235.0).

Here is an example:

java.lang.IllegalArgumentException: Health must be between 0 and 1.0, but was 235.0. (attribute base value: 235.0, player: Alzter_)
        at org.bukkit.craftbukkit.v1_16_R3.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:127) ~[patched_1.16.5.jar:git-Paper-788]
        at me.william278.husksync.bukkit.util.PlayerSetter.lambda$setPlayerFrom$0(PlayerSetter.java:152) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.16.5.jar:git-Paper-788]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:485) ~[patched_1.16.5.jar:git-Paper-788]
        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1427) ~[patched_1.16.5.jar:git-Paper-788]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-788]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1342) ~[patched_1.16.5.jar:git-Paper-788]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1130) ~[patched_1.16.5.jar:git-Paper-788]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-788]
        at java.lang.Thread.run(Thread.java:831) [?:?]

Health synchronization causes incompatibility with Combatlogx

There's an incompatibility with Combatlogx caused by the way health is synced (seems to result in Combatlogx killing the player again), that should be addressed by only setting health if the value has changed.

double hp = player.getHealth();
        if(health != hp) player.setHealth(hp > maxHealth ? maxHealth : health);

Will need to be tested to make sure this doesn't break other stuff.

V2.1 database access issue

After I updated to new version and restarted, husksync fails to access the database. As soon as I roll back to prev version config and connections work just fine.

16.10 13:47:02 [Server] INFO [HuskSync] Loading plugin configuration settings & locales... 16.10 13:47:02 [Server] INFO [HuskSync] Successfully loaded plugin configuration settings & locales 16.10 13:47:02 [Server] INFO [HuskSync] Attempting to establish connection to the database... 16.10 13:47:02 [Server] INFO [net.william278.husksync.libraries.hikari.HikariDataSource] HuskSyncHikariPool - Starting... 16.10 13:47:07 [Server] ERROR [net.william278.husksync.libraries.hikari.pool.HikariPool] HuskSyncHikariPool - Exception during pool initialization. 16.10 13:47:07 [Server] INFO java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. 16.10 13:47:07 [Server] INFO at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:898) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:823) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:448) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at net.william278.husksync.libraries.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HuskSync-2.1.jar:?] 16.10 13:47:07 [Server] INFO at net.william278.husksync.libraries.hikari.pool.PoolBase.newConnection(PoolBase.java:359) ~[HuskSync-2.1.jar:?] 16.10 13:47:07 [Server] INFO at net.william278.husksync.libraries.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[HuskSync-2.1.jar:?] 16.10 13:47:07 [Server] INFO at net.william278.husksync.libraries.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470) ~[HuskSync-2.1.jar:?] 16.10 13:47:07 [Server] INFO at net.william278.husksync.libraries.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HuskSync-2.1.jar:?] 16.10 13:47:07 [Server] INFO at net.william278.husksync.libraries.hikari.pool.HikariPool.<init>(HikariPool.java:100) ~[HuskSync-2.1.jar:?] 16.10 13:47:07 [Server] INFO at net.william278.husksync.libraries.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HuskSync-2.1.jar:?] 16.10 13:47:07 [Server] INFO at net.william278.husksync.database.MySqlDatabase.initialize(MySqlDatabase.java:104) ~[HuskSync-2.1.jar:?] 16.10 13:47:07 [Server] INFO at net.william278.husksync.BukkitHuskSync.onEnable(BukkitHuskSync.java:126) ~[HuskSync-2.1.jar:?] 16.10 13:47:07 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?] 16.10 13:47:07 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?] 16.10 13:47:07 [Server] INFO at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:542) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?] 16.10 13:47:07 [Server] INFO at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:565) ~[paper-1.19.2.jar:git-Paper-141] 16.10 13:47:07 [Server] INFO at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:479) ~[paper-1.19.2.jar:git-Paper-141] 16.10 13:47:07 [Server] INFO at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.19.2.jar:git-Paper-141] 16.10 13:47:07 [Server] INFO at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:422) ~[paper-1.19.2.jar:git-Paper-141] 16.10 13:47:07 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[paper-1.19.2.jar:git-Paper-141] 16.10 13:47:07 [Server] INFO at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1126) ~[paper-1.19.2.jar:git-Paper-141] 16.10 13:47:07 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-141] 16.10 13:47:07 [Server] INFO at java.lang.Thread.run(Thread.java:833) ~[?:?] 16.10 13:47:07 [Server] INFO Caused by: com.mysql.cj.exceptions.CJException: Access denied for user 'root'@'15.204.145.99' (using password: YES) 16.10 13:47:07 [Server] INFO at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] 16.10 13:47:07 [Server] INFO at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] 16.10 13:47:07 [Server] INFO at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] 16.10 13:47:07 [Server] INFO at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] 16.10 13:47:07 [Server] INFO at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] 16.10 13:47:07 [Server] INFO at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:129) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:848) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:770) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:738) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:155) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:472) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:212) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1433) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.NativeSession.connect(NativeSession.java:133) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:842) ~[mysql-connector-java-8.0.29.jar:8.0.29] 16.10 13:47:07 [Server] INFO ... 24 more 16.10 13:47:07 [Server] ERROR [HuskSync] Failed to perform database setup: Could not create connection to database server. Attempted reconnect 3 times. Giving up. 16.10 13:47:07 [Server] ERROR [HuskSync] *************************************************** 16.10 13:47:07 [Server] INFO Failed to initialize HuskSync! 16.10 13:47:07 [Server] INFO *************************************************** 16.10 13:47:07 [Server] INFO The plugin was disabled due to an error. Please check 16.10 13:47:07 [Server] INFO the logs below for details. 16.10 13:47:07 [Server] INFO No user data will be synchronised. 16.10 13:47:07 [Server] INFO *************************************************** 16.10 13:47:07 [Server] INFO Caused by: Failed to establish a connection to the database. Please check the supplied database credentials in the config file 16.10 13:47:07 [Server] ERROR [HuskSync] Failed to initialize HuskSync. The plugin will now be disabled 16.10 13:47:07 [Server] INFO [HuskSync] Disabling HuskSync v2.1 16.10 13:47:07 [Server] INFO [HuskSync] Successfully disabled HuskSync v2.1

Sync player's PersistentDataContainer

Hi, are there plans to make it possible to also sync the player's PersistentDataContainer?

The reason is that I thought that HuskSync aims to make "switching between servers" behave the same as "switching between worlds" in vanilla. In vanilla, that includes all NBT tags, including the "BukkitValues" tag (which contains the PDC data).

(Reason why this would be nice is because many plugins, including mine, store player data in the PDC)

inventory lose !!

Players have a chance to lose their inventory!!

Players who exit the server have a chance to lose their inventory when entering

Issues with MariaDB caused by constraint violation exceptions

Certain MariaDB environments cause an exception to occur when setting players or data into the database, only on MariaDB environments, probably due to missing user data.

[06:07:14 ERROR]: [HuskSync] Failed to set user data in the database
java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`s1_main`.`husksync_user_data`, CONSTRAINT `husksync_user_data_ibfk_1` FOREIGN KEY (`player_uuid`) REFERENCES `husksync_users` (`uuid`) ON DELETE CASCADE)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117) ~[mysql-connector-java-8.0.27.jar:8.0.27]
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.27.jar:8.0.27]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) ~[mysql-connector-java-8.0.27.jar:8.0.27]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1098) ~[mysql-connector-java-8.0.27.jar:8.0.27]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1046) ~[mysql-connector-java-8.0.27.jar:8.0.27]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1371) ~[mysql-connector-java-8.0.27.jar:8.0.27]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1031) ~[mysql-connector-java-8.0.27.jar:8.0.27]
        at net.william278.husksync.libraries.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[HuskSync-2.0.jar:?]
        at net.william278.husksync.libraries.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HuskSync-2.0.jar:?]
        at net.william278.husksync.database.MySqlDatabase.lambda$setUserData$12(MySqlDatabase.java:364) ~[HuskSync-2.0.jar:?]
        at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?]
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
        at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
        at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]

HuskSync and EcoEnchants in will result in the loss of NBT

My English is poor, please forgive my machine translation
HuskSync 2.1.2
EcoEnchants 8.111.0
Server purpur 1.19.2
MySQL: 8.0.0
Redis:5.0.10

When the player jumps to the server, HuskSync will cause EcoEnchants to lose EnchantsNBT
For example, NBT:
Enchantments(List){"Stat":"ENCHANTS","OGStory":[{"MMOITEMS_ENCHANTS_ñstr":"["bolt 9","plasmic 10","razor 10","criticals 10","thor 10","parry 6","zap_artifact 1"]"}]}

My friend he is HuskSync 2.1 EcoEnchants 8.111.0 and did not have this problem

Hope the author can fix this BUG

Issues about sync

Plugin-Version: 2.1.2
Server: Purpur-1.19.2-build1794
Mysql: 8.0
Redis: 5.0.10
Sorry for my poor english,this is my issue about Husksync.
I made an Afk server for players, so that my survival server would have more space for other players, and i set all the settings to false except experience sync on the Afk server, so that my players can gain experience while they are afk .
But in this situation, i found that some items in inventory would be lost .
For example I teleport to Afk server on ResourceWorld server , some of my items would be gone except experience ,
cause i made that.
Then I teleport back to Hub server ,i found that some items that i gain in ResourceWorld is gone!
It's like the data return back to the old version when i leave the Hub server.
I think the reason is that i teleport back to the server , the Hub server, that is not the last server i leave ,and
Husksync on this server , the Hub server , didn't get the Afk server's inventory cause inventory sync has been
set to false on the Afk server,
so the server(the hub server)chose to get the old version of the inventory when the player i leave the hub server.
(The reason that i teleport back to Hub server is that i can't appoint the last server to teleport , cause the plugin
DeluxeHub can only appoint one server .)
I have some solutions
①Add a new command /husksync lastserver ,so that players can be teleported to the last server they leave.
②Change the logic of preserving data,so that there would be no problems.
Sorry for bothering you,Hope you can fix this.Have a nice day!
Thank you !

Visual warning for administrators

Hello WiIIIiam278, can you make some kind of huge notification in the game, in the console, or spam that the plugin did not conditionally connect to the radis? Or let the plugin block the server from turning on. Because one line in the .log is not enough to notice the error.
2022-08-19_23 05 16

Thanks in advance

Can't Sync Data

MySQL, Redis connection is normal, no error is reported in the background of the agent, but the player has not successfully synchronized data when transferred to another server, the prompt shows that it has been synchronized, but there is no change, and the downstream server has an error in the background
At the same time, ALL CHEST MENUS cannot be opened

Proxy: Velocity 3.1.1
Downstream Servers: Mirai (A Pufferfish fork)
MariaDB: 10.5.6
Redis: 5.0.14.1 (Windows fork)
HuskSync: 1.3.3+rev.46f791d-indev (latest github commits and build by myself)

image

EOFException caused by attempting to serialize zero-length PotionEffect array

java.io.EOFException: null
        at java.io.DataInputStream.readInt(DataInputStream.java:398) ~[?:?]
        at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:3381) ~[?:?]
        at java.io.ObjectInputStream.readInt(ObjectInputStream.java:1113) ~[?:?]
        at me.william278.husksync.bukkit.data.DataSerializer.deserializePotionEffects(DataSerializer.java:148) ~[?:?]
        at me.william278.husksync.bukkit.util.PlayerSetter.lambda$setPlayerFrom$0(PlayerSetter.java:166) ~[?:?]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.17.1.jar:git-Purpur-1260]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.17.1.jar:git-Purpur-1260]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1565) ~[patched_1.17.1.jar:git-Purpur-1260]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:492) ~[patched_1.17.1.jar:git-Purpur-1260]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1480) ~[patched_1.17.1.jar:git-Purpur-1260]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1270) ~[patched_1.17.1.jar:git-Purpur-1260]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Purpur-1260]
        at java.lang.Thread.run(Thread.java:831) [?:?]```

Graves support

does anyone know why the death chest is not created when a player goes pvp with another player? i use pvpmanager plugin, graves plugin and huskSync for inv

2022-08-05.16-14-03.mp4

IllegalPluginAccessException on Bukkit server closure caused by illegal registration of redis listener task

[06:04:12 WARN]: Exception in thread "Redis Subscriber" org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register task while disabled
[06:04:12 WARN]:        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.validate(CraftScheduler.java:537)
[06:04:12 WARN]:        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:212)
[06:04:12 WARN]:        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:197)
[06:04:12 WARN]:        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.runTaskLater(CraftScheduler.java:161)
[06:04:12 WARN]:        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.runTask(CraftScheduler.java:130)
[06:04:12 WARN]:        at me.william278.husksync.bukkit.util.PlayerSetter.setPlayerFrom(PlayerSetter.java:100)
[06:04:12 WARN]:        at me.william278.husksync.bukkit.listener.BukkitRedisListener.handleMessage(BukkitRedisListener.java:115)
[06:04:12 WARN]:        at me.william278.husksync.redis.RedisListener$1.onMessage(RedisListener.java:53)
[06:04:12 WARN]:        at me.William278.husksync.libraries.jedis.jedis.JedisPubSub.process(JedisPubSub.java:152)
[06:04:12 WARN]:        at me.William278.husksync.libraries.jedis.jedis.JedisPubSub.proceed(JedisPubSub.java:125)
[06:04:12 WARN]:        at me.William278.husksync.libraries.jedis.jedis.Jedis.subscribe(Jedis.java:3267)
[06:04:12 WARN]:        at me.william278.husksync.redis.RedisListener.lambda$listen$0(RedisListener.java:43)
[06:04:12 WARN]:        at java.base/java.lang.Thread.run(Thread.java:831)

HuskSync 1.2 doesn't work with MySQL databases on Velocity

Bug: Cannot use latest release with Velocity & MySQL database with exception "No suitable driver"

Steps to replicate: Try to use latest Spigot release on Velocity with MySQL database

Stacktrace:

[16:25:32] [Velocity Async Event Executor - #0/INFO]: HuskSyncHikariPool-test - Starting...
[16:25:32] [Velocity Async Event Executor - #0/ERROR]: Couldn't pass ProxyInitializeEvent to husksync
java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:mysql://IP:port/husksync?autoReconnect=true&useSSL=false
	at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:114) ~[?:?]
	at com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:326) ~[?:?]
	at com.zaxxer.hikari.pool.PoolBase.<init>(PoolBase.java:112) ~[?:?]
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:93) ~[?:?]
	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[?:?]
	at me.william278.husksync.proxy.data.sql.MySQL.createTables(MySQL.java:93) ~[?:?]
	at me.william278.husksync.proxy.data.DataManager.initializeDatabases(DataManager.java:56) ~[?:?]
	at me.william278.husksync.proxy.data.DataManager.<init>(DataManager.java:46) ~[?:?]
	at me.william278.husksync.HuskSyncVelocity.onProxyInitialization(HuskSyncVelocity.java:134) ~[?:?]
	at me.william278.husksync.Lmbda$1.execute(Unknown Source) ~[?:?]
	at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:47) ~[velocity.jar:3.1.1]
	at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598) ~[velocity.jar:3.1.1]
	at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479) ~[velocity.jar:3.1.1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[?:?]
	at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.sql.SQLException: No suitable driver
	at java.sql.DriverManager.getDriver(DriverManager.java:298) ~[java.sql:?]
	at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:106) ~[?:?]
	... 15 more```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.