Forums » General
reloadinterface
Quick question here, when reloadinterface is ran does it trigger/call any event/function that a plugin could monitor to tidy up itself? Say close connections, purge tables, reset pointers, etc..
Ed
Ed
There currently is no way.
I am adding UNLOAD_INTERFACE to the process.
UNLOAD_INTERFACE will be the first thing ReloadInterface() sends.
I am adding UNLOAD_INTERFACE to the process.
UNLOAD_INTERFACE will be the first thing ReloadInterface() sends.
Are you sure about that? I have previously been using START for just this purpose. I tested it again, and it still seems to work.
[edit:] To be precise, START only appears to be announced once all plugins are loaded.
[edit:] To be precise, START only appears to be announced once all plugins are loaded.
START happens after the reload, not before.
You can get the same effect by putting code outside of functions in your plugin. it will only get executed when the plugin loads.
But waiting for START would guarantee that all plugins are loaded.
Also, if you are logged in when ReloadInterface() is called, START isn't sent. PLAYER_ENTERED_GAME is instead, and that is also called whenever you log in.
You can get the same effect by putting code outside of functions in your plugin. it will only get executed when the plugin loads.
But waiting for START would guarantee that all plugins are loaded.
Also, if you are logged in when ReloadInterface() is called, START isn't sent. PLAYER_ENTERED_GAME is instead, and that is also called whenever you log in.
I think that UNLOAD_INTERFACE is what I am looking for, that would allow the plugins to close connection, tidy up variables/matrix, flush tables/matrix and terminate sockets.
Ed
Ed