[SP SUGGESTION] Plugins Hot Reloading

All other Source.Python topics and issues.
SkinN
Junior Member
Posts: 25
Joined: Fri Jul 19, 2013 7:29 am

[SP SUGGESTION] Plugins Hot Reloading

Postby SkinN » Sat Nov 14, 2015 2:01 am

Hi,

I am not sure if this is the right place to make a suggestion, but here it goes,
I am a plugin developer for the game Rust, using a framework called Oxide Mod which supports various languages to mod the game. Oxide features Plugins Hot Reloading:
Plugin hot-reloading - in addition to the oxide.reload/unload/load commands, plugins are automatically loaded/unloaded when added/removed from the plugins directory, and are reloaded when a change has been made.


This is a great feature not only for user side, so you don't have to go to the console to load/unload/reload every time you wanna do that to a plugin, or even to save a command in a file to it on server init, as it also is a great feature to help developers reloading their plugins while writing the plugins, as any change to the file will reload the plugin.
I was hoping you could consider something like this for SP?

Thanks in advance.
User avatar
Doldol
Senior Member
Posts: 200
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Postby Doldol » Sat Nov 14, 2015 5:12 am

I wouldn't like this unless I could disable it, sometimes I update/move files without immediately wanting them to be reloaded.

Especially on a non-development server I don't suddenly want my threads interrupted which are communicating with my database, lose items in memory that the server needs to ensure proper gameplay, etc. It's good enough that it will load the updated version when the server restarts, or when I explicitly order it to do that with a command.
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Sat Nov 14, 2015 10:51 am

Hey,

thank you for your suggestion! But I think I agree with Doldol. I know a similar mechanism from the Django framework. At first I though: "Oh, that's cool!", but then I realized that it doesn't always recognize the changes and I had to make another change again. Sometimes I ended up restarting the webserver, because it simply didn't recognize my change. That might be only Django bug, but if that happens with our implementation as well, it would be really annoying.

Moreover, it's actually quite easy to reload a plugin, because all entered server commands are cached, so you just need to use your arrows to display the previous entered commands.

I also disagree with automatically loading plugins from a specific directory where the only way to disable that is moving plugins on the files system. Stopping a plugin from being loaded is as simple as putting a double slash (//) in front of the load command in your autoexec.cfg. Moreover, some plugins might need to be delay-loaded, so the require a different load command (e.g. "sp delay 5 sp load my_delay_loaded_plugin") or they need to be loaded in a specific order.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 33 guests