Forums » General

reloadinterface

Sep 11, 2007 blacknet link
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
Sep 11, 2007 raybondo link
There currently is no way.
I am adding UNLOAD_INTERFACE to the process.
UNLOAD_INTERFACE will be the first thing ReloadInterface() sends.
Sep 12, 2007 nh link
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.
Sep 12, 2007 raybondo link
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.
Sep 13, 2007 blacknet link
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