utarwyn / EnderContainers

A modern and customizable Bukkit plugin to divide enderchest into multiple inventories.
https://spigotmc.org/resources/4750/
BSD 3-Clause "New" or "Revised" License
27 stars 14 forks source link

Mysql Multiserver Support #172

Open Rican14 opened 3 years ago

Rican14 commented 3 years ago

An very important update, for multi server sections

utarwyn commented 3 years ago

Yes indeed! Thank you for creating the issue here :+1:

hkkongou commented 1 year ago

this is a much needed function.

In my opinion can add another JDBC table for sync unlock, thats what mysql player data bridge and many mysql sync plugin doing.

Methods: when player enter a server, a lock is applied to a player indicating that they are in server, a boolean true in database.

Then if a player log off, the lock is removed,to null.

If the player is switching to another server, the server they switched to will have to wait for the lock to be removed by other server, then load the item/enderchest.

Plugin can check when player first login, then every 1 second for player to see is locked or not. (This prevent player login faster than JDBC query)

[additional feature] For server that crashes and caused dead locks, can add a setting so that if the server detected 10-50 wait of lock release has pass, automatically unlease the lock.

I am not a pro java programmer, sadly I can't help much