open.mp forum
[Suggestion] Dynamically loading / unloading plugins - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: open.mp (https://forum.open.mp/forumdisplay.php?fid=40)
--- Forum: Questions and Suggestions (https://forum.open.mp/forumdisplay.php?fid=42)
--- Thread: [Suggestion] Dynamically loading / unloading plugins (/showthread.php?tid=602)



Dynamically loading / unloading plugins - XeroX - 2019-05-25

Hi,

not sure if this is already on your suggestion(s) list but would be nice to be able to (un)load plugins on the fly while the server is running.


RE: Dynamically loading / unloading plugins - JustMichael - 2019-05-25

This is possible, but might require a workaround for older plugns that are not written to be hot reloaded (some have memory leakes). Either that or they would need to be re-written/re-compiled with fixes.



It's really a question of whether older plugin should be supported for hot reload.


RE: Dynamically loading / unloading plugins - Josh - 2019-05-25

I see no point in this feature being a thing. Why would you even want to hot swap plugins?


RE: Dynamically loading / unloading plugins - JustMichael - 2019-05-25

Yeah I don't see a reason for this, other then for development of the plugin itself.


RE: Dynamically loading / unloading plugins - ohmios - 2019-05-25

Faster plugin development by not having to reload the whole server is already a great feature. Also big server will probably thank live security plugin updates, or even live open.mp server updates.


RE: Dynamically loading / unloading plugins - Gravityfalls - 2019-05-26

Hot loading can come handy in case you want to load a certain thing without restarting your serve - this might be more work but should be added, this can come handy in a way that you can load all your plugins depending on the includes you've in your script, you can just do a small define to check whether the library is included or not and then load the respective plugin for it. This is just an idea, because I really hate to set up SA-MP servers.


RE: Dynamically loading / unloading plugins - Josh - 2019-05-26

(2019-05-25, 11:56 PM)ohmios Wrote: Faster plugin development by not having to reload the whole server is already a great feature. Also big server will probably thank live security plugin updates, or even live open.mp server updates.



Plugin development would 90% of the time adding more natives. In which you would have to recompile your script and restart either way.

The other 10% are bug fixes, that would be useful to have for "hot swapping" but I don't think that's worth the time in my opinion.


RE: Dynamically loading / unloading plugins - JustMichael - 2019-05-26

(2019-05-26, 12:54 PM)Gravityfalls Wrote: Hot loading can come handy in case you want to load a certain thing without restarting your serve - this might be more work but should be added, this can come handy in a way that you can load all your plugins depending on the includes you've in your script, you can just do a small define to check whether the library is included or not and then load the respective plugin for it. This is just an idea, because I really hate to set up SA-MP servers.



The huge problem with this, is that a plugin could get updated and add/change natives and then your server wouldn't function correctly since it would be trying to call natives that no longer exists or have changed and give an unexpected output.



This would be seriously bad, and I don't recommend this approach at all.