added amb567, new OnAllPluginsLoaded forward
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401227
This commit is contained in:
parent
b0e107bdfb
commit
b0a96e69c1
@ -510,6 +510,9 @@ void SourceModBase::DoGlobalPluginLoads()
|
||||
|
||||
/* Re-mark any extensions as loaded */
|
||||
g_Extensions.MarkAllLoaded();
|
||||
|
||||
/* Call OnAllPluginsLoaded */
|
||||
g_PluginSys.AllPluginsLoaded();
|
||||
}
|
||||
|
||||
size_t SourceModBase::BuildPath(PathType type, char *buffer, size_t maxlength, char *format, ...)
|
||||
|
@ -340,6 +340,23 @@ void CPlugin::Call_OnPluginEnd()
|
||||
pFunction->Execute(&result);
|
||||
}
|
||||
|
||||
void CPlugin::Call_OnAllPluginsLoaded()
|
||||
{
|
||||
if (m_status > Plugin_Paused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
cell_t result;
|
||||
IPluginFunction *pFunction = m_ctx.base->GetFunctionByName("OnAllPluginsLoaded");
|
||||
if (!pFunction)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pFunction->Execute(&result);
|
||||
}
|
||||
|
||||
bool CPlugin::Call_AskPluginLoad(char *error, size_t maxlength)
|
||||
{
|
||||
if (m_status != Plugin_Created)
|
||||
@ -977,6 +994,7 @@ IPlugin *CPluginManager::LoadPlugin(const char *path, bool debug, PluginType typ
|
||||
UnloadPlugin(pl);
|
||||
return NULL;
|
||||
}
|
||||
pl->Call_OnAllPluginsLoaded();
|
||||
}
|
||||
|
||||
return pl;
|
||||
@ -2315,3 +2333,15 @@ bool CPluginManager::LibraryExists(const char *lib)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CPluginManager::AllPluginsLoaded()
|
||||
{
|
||||
List<CPlugin *>::iterator iter;
|
||||
CPlugin *pl;
|
||||
|
||||
for (iter=m_plugins.begin(); iter!=m_plugins.end(); iter++)
|
||||
{
|
||||
pl = (*iter);
|
||||
pl->Call_OnAllPluginsLoaded();
|
||||
}
|
||||
}
|
@ -201,6 +201,11 @@ public:
|
||||
*/
|
||||
void Call_OnPluginEnd();
|
||||
|
||||
/**
|
||||
* Calls the OnAllPluginsLoaded function.
|
||||
*/
|
||||
void Call_OnAllPluginsLoaded();
|
||||
|
||||
/**
|
||||
* Toggles debug mode in the plugin
|
||||
*/
|
||||
@ -395,6 +400,11 @@ public:
|
||||
*/
|
||||
void AddFunctionsToForward(const char *name, IChangeableForward *pForward);
|
||||
|
||||
/**
|
||||
* Iterates through plugins to call OnAllPluginsLoaded.
|
||||
*/
|
||||
void AllPluginsLoaded();
|
||||
|
||||
CPlugin *GetPluginFromIdentity(IdentityToken_t *pToken);
|
||||
|
||||
void Shutdown();
|
||||
|
@ -143,6 +143,11 @@ forward OnConfigsExecuted();
|
||||
*/
|
||||
forward OnServerCfg();
|
||||
|
||||
/**
|
||||
* Called after all plugins have been loaded.
|
||||
*/
|
||||
forward OnAllPluginsLoaded();
|
||||
|
||||
/**
|
||||
* Returns the calling plugin's Handle.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user