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
26 stars 14 forks source link

AutoSave + Prefix #130

Closed nivcoo closed 5 months ago

nivcoo commented 3 years ago

Hello, can you add a command or option to save into the file, because if server crash the data is rollback.

nivcoo commented 3 years ago

So I would like both maybe a command to save and an async automation system

nivcoo commented 3 years ago

Then you can put the prefix in the language? I have to compile the plugin each time to change it

utarwyn commented 3 years ago

Hello @nivcoo, thank you for these ideas!

Yes there is no command to force the data saving because of conflicts which can happen is certain cases. That is why I recommand the use of command /ecp reload which closes inventories, saves all enderchests and reloads the configuration in a proper order to avoid saving/loading problems.

As the plugin was designed to be as efficient as possible, the plugin saves player data only when it leaves the server. It works well 99.9% of the time! BUT indeed in case of a hard crash (but why does that occur?), a part of connected players data will be rollback. We can discuss a new option to be added in the configuration to force saving player data every time a chest is closed. (which will be disabled by default, I'm not a big fan of the idea) What do you think of that?

I have planned to remove entirely the prefix because it is useless, see more details here: #127

nivcoo commented 3 years ago

Hum, so /ecp reload saves actually all enderchest ?

nivcoo commented 3 years ago

My server does not "crash" but often it does not stop entirely without error or something that could prevent it from stopping during my automatic restart, so saving the enderchest before restarting the server would be good ^^

utarwyn commented 3 years ago

Yes the command /ecp reload saves all enderchests and reloads everything. It could be a nice idea for you to execute it before the server stops if you can? But not at a given interval of time because it also closes all inventories of the plugin, so your players would be surprised.

nivcoo commented 3 years ago

Yes i execute 3 commands before restart : ecp reload | save-all | stop (Because my script autorestart after that but sometimes the server stay blocked in the desactivation of one plugin (random) and idk why)

nivcoo commented 3 years ago

Besides, I don't know if there were any postponements of that but after a /ecp reload the essentials command is no longer ovewrite, so the / enderchest command no longer works

utarwyn commented 3 years ago

Ugh.. maybe a wrong behavior of the Essentials dependency, I will check that! So, your problem with data saving has been solved thanks to /ecp reload executed right before the server stop?

utarwyn commented 3 years ago

Any news @nivcoo ?

nivcoo commented 3 years ago

I think it works

utarwyn commented 3 years ago

Ok thank you for the fast feedback. I have done some tests with Essentials but on my test server the /enderchest command is still managed by EnderContainers even after a reload, but I will do more tests I hope to find the bug.. Which version of Essentials do you use?

nivcoo commented 3 years ago

The latest version of essentialsx on spigot

nivcoo commented 3 years ago

And i havent tried today but the command is /ec which not works

utarwyn commented 3 years ago

Hello @nivcoo! I have identified the bug and it should be fixed in my last commit :) You can download the latest build with the fix here: https://ci.utarwyn.fr/job/EnderContainers/ (current version jar)

Sorry for the delay and the inconvenience caused by this bug..

nivcoo commented 3 years ago

Thx i will try

nivcoo commented 3 years ago

Hello, can you add AutoSave when we close the chest or something else in async because if my server crashes there is a huge data rollback. Thx :p