Is it possible for Sponge to have /reload?

Typically on spigot there was a /reload command that reloaded every plugin without restarting the whole server. This is a whole lot easy because of how some of us have a player base and we don’t want them going though the trouble of them getting kicked out and re-logging in again.

The main question is…
Is this possible to have this command build into both SpongeForge/SpongeVanilla?

This would be useful if you do a tiny edit to any Sponge Plugin or edit the server.properties and let it take action real quick instead of having a whole server restart just to fix a tiny change.

Thanks for reading!

By all means plugins can add their own reload command (/some_plugin reload) but that’s up to plugins and is not a feasible possibility in Sponge itself.

It is actually more resource friendly and acceptable if only the adjusted plugin would be reloaded and not the whole server application. In Spigot, during a reload players would have to wait a few seconds for the server to reload, this is for a some of them quite frustrating.
When reloading individual plugins they might not even notice it.

And there aren’t many settings in the sponge configuration that should be adjusted.
Even to add the tiniest adjustment you could better wait till there is no one online.

I’ll just quote two replies from the linked thread:

So long story short: NOPE, this won’t happen on Sponge, sorry. Way to much issues/problems would arise from reloading whole plugins. However reloading a plugins config is possible.

Bukkit plugineer here, and I’m glad that /reload is becoming not a thing. It was a damn annoying contingency to work with in Bukkit. Though I wish there was a way to replace a plugin’s code without restarting the server.

1 Like

In development, you can use hot swapping.

Actually, adding a reload command might not actually be a bad idea.

Hear me out here.

A lot of plugins do include their own reload command, but either they go undocumented or have a weird name/syntax and don’t get used as often as they should.

What I think should be done is for sponge to have a reload command that fires a reload event, and plugins can listen to that event to reload themselves however they need to.

Just a thought.

2 Likes

The help text for such a command would be special…

This command asks plugins politely to reload. What they reload, if they even reload anything at all, is up to the plugin and not guaranteed to do anything.

1 Like

Though honestly its still something that i would like to see. Plugins may not be required to support it, but we could still push /reload as something that is recommended to support and say it should allow refreshing configuration and such.

/reload would only refresh the configuration. Everything else isn’t possible because Spoge requires plugins to register themselves to services upon server startup. This includes services provides by Sponge and services provided by plugins.

I don’t want to imagine what happens when for example PEX would reload itself and a ton of other plugins try to aquire permissions from it while it’s restarting :confused:

Actually sheduling a global configuration reload might be a good idea. However plugins shouldn’t be forced to do it but instead notified that they might reload if possible. This saves you some work. However you could just make yourself a little script plugin which schedules the commands in batches. Less effort, works too.

However you could just make yourself a little script plugin which schedules the commands in batches. Less effort, works too.

Though an official /reload command which plugins can detect should encourage far more plugins to support it, though.

1 Like

If you’re going to do this though, I’d suggest making it something that isn’t /reload. Us plugin devs and those who keep up with Sponge would know that /reload has a different function to the Bukkit equivelent, but those server owners who don’t keep up and think /reload does exactly what Bukkit does are going to be mightily confused and/or running straight to here to complain.

Besides, naming such a command /reload is not as descriptive as it perhaps should be - what are you reloading? I would suggest /reloadpluginconfigs if you’re going to do this - but the length of that command is bordering on daft. /reloadconfigs, maybe?

1 Like

/refresh?

+1. Or /reloadconfig. However i don’t think we’ll get such a command.

1 Like

I may also be useful to add some arguments to /reload or whatever you want to call it for instance /reload would notify all plugins of the reload event whereas /reload [pluginName] would notify only that specific plugin, that way you don’t need to reload all your plugins if you change the config of only one. Just a thought. We should probably create a github issue if one doesn’t exist already.

2 Likes

Idea. What if we had certain commands that were global, things like /reload, /help? /give, /summon, /setblock for plugins that provide custom mechanics, etc.? And then, you would say which ones you support with maybe an annotation or method, with a catalog type? Sponge does the magic behind the scenes, and our plugins work perfectly without the users being annoyed.

I was about to ask the very same question. Maybe a /reloadconfig command is not that bad after all?

1 Like

5 Likes