mobarena / MobArenaStats

An extension plugin for MobArena that collects arena session stats.
GNU General Public License v3.0
3 stars 2 forks source link

Add reload support #11

Closed garbagemule closed 2 years ago

garbagemule commented 3 years ago

Once the plugin has been configured properly with the right store, there isn't really much need for reloads. However, in the process of setting up the store, the lack of reloads makes for a big source of frustration, since you have to "get it right the first time" to avoid restarts. Additionally, unless reloads are implemented, it will never be possible to reasonably change data stores, since the procedure requires exporting, switching store type, restarting, and then importing. There is no reasonable way around a server restart to make config changes take effect, so server owners have to either restart until they "get it right", use the /reload server command, or worse, resort to the dark side of unfortunate "plugin managers" and all their downsides.

MobArena has an open issue about allowing plugin extensions to "tag along" on its /ma reload command. MobArenaStats probably won't have to reload as often as MobArena itself does, so it's worth taking a look at how stuff like JDBI connections are handled in terms of garbage collection and such before we jump on that wagon here.

An alternative solution could be to just register /ma reload-stats, or, if the MobArena event can take arguments, require that it contains stats, so e.g. /ma reload will only reload MobArena, but /ma reload stats will reload MobArenaStats.

garbagemule commented 3 years ago

The new events have been added in MobArena, but I'm leaving the issue open until we have a new named version of MobArena (either 0.106.1 or 0.107).

Edit: This is now available on the dev branch and will be merged into master when a MobArena 0.107 is released.