Can anyone tell me why when server is starting Oxide firstly calls OnPluginLoaded() and then OnServerInitialized(), but... but if server is already initialized and I'm reloading (for example) any plugin firstly calls OnServerInitialized() function and then OnPluginLoaded()?
Because I think firstly Oxide should call OnPluginLoaded() and then OnPluginInitialized() independently of the situation. Maybe I'm wrong.
Solved Order of function calls
Discussion in 'Rust Discussion' started by deer_SWAG, Jul 23, 2015.
-
When the server starts plugins finish loading before the server has actually started and when reloading a plugin OnServerInitialized() is manually triggered by the core from OnPluginLoaded().
-
And no matter what OnServerInitialized() runs code before code from OnPluginLoaded(). Is that right?
-
When starting:
Loaded() -> OnPluginLoaded() -> OnServerInitialized()
When reloading:
Loaded() -> OnServerInitialized() -> OnPluginLoaded()
Also keep in mind that OnPluginLoaded captures every plugin being loaded so if plugin A uses the hook and plugin B is reloaded, the hook OnPluginLoaded in plugin A will be called. Usually 'Loaded()' does the trick for what most want to achieve. -
Oh, man. Thank you so much!