Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Save players before plugin disabling on server shutdown

Open DerEchtePilz opened this issue 2 years ago • 8 comments

For reference: https://discord.com/channels/289587909051416579/555462289851940864/1147468559887384586

If this behaviour is intended, feel free to close this PR, but as written in that message, I think /restart and /stop should follow the same order of operations when disabling plugins and saving players.

DerEchtePilz avatar Sep 02 '23 10:09 DerEchtePilz

I also wanted to say that this allows the PlayerKickEvent to work with the /stop command because players are kicked before plugins get disabled and therefore the PlayerKickEvent is called.

DerEchtePilz avatar Sep 03 '23 08:09 DerEchtePilz

Fixes #6911 Also see the comments in it

molor avatar Sep 03 '23 08:09 molor

This is 100% not something that can be done mid patch release, this is more a major change in behavior in which needs to be done on a major release with proper testing to ensure that we don't break anything;

This is how this logic has worked for a decade, and while you can maybe argue that it's weird, it is a side-effect of various dozen other choices in the codebase over a decade which has left us here

electronicboy avatar Sep 03 '23 16:09 electronicboy

So you say this could be added but this is more likely something for a new major MC version? Or did you mean something else with "major release"?

DerEchtePilz avatar Sep 03 '23 17:09 DerEchtePilz

Yea, this logic would be desirable in the long run imo, it just a) would best fit something like, 1.21 release b) might be best to wait for papers hardfork or be proposed to spigot.

Given that the quit/onDisable stuff has worked like this for years and most logic that relies on this logic deals with rather crucial parts of plugins (e.g. data saving) changing this mid version is rather terrible for plugin developers to update. Additionally, given that this breaks spigot compatibility, imo it is a rough PR even during a major release, as spigot plugins would just silently fail if they rely on spigots behaviour.

lynxplay avatar Sep 03 '23 17:09 lynxplay

b) might be best to wait for papers hardfork or be proposed to spigot.

#6911 suggests to add a config option. Would that, assuming this is getting merged at some point, be a feasable option until a hardfork? Or is this something that better waits until the hardfork?

DerEchtePilz avatar Sep 03 '23 17:09 DerEchtePilz

a config option was proposed for /stop to boot everybody, but there is no expectation that it would change event behavior, the server has stopped ticking and many things relied upon that in order to fire events, etc;

If we're going to change the behavior around this, it should just be changed without a config option, rather than having such a dangerous setting sitting around with massive side-effects

electronicboy avatar Sep 03 '23 17:09 electronicboy

I guess that would be an option. But probably only if it's disabled per default, logically.

On the other side if you enable it and have spigot plugins that rely on the old system it breaks again. So maybe an unsupported option until Hardfork?

Leguan16 avatar Sep 03 '23 17:09 Leguan16