1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 09:36:37 +02:00

Added os_modreload. Also allow unloading database and encryption modules since there isn't a reason we cant allow reloading them. Soon os_modreload will allow reloading the protocol modules.

This commit is contained in:
Adam
2010-10-02 21:09:11 -04:00
parent 0d684191e9
commit 90f0a7c92a
9 changed files with 173 additions and 49 deletions
+13 -3
View File
@@ -31,11 +31,21 @@ class CommandOSModLoad : public Command
return MOD_CONT;
}
int status = ModuleManager::LoadModule(mname, u);
if (status != MOD_ERR_OK)
ModuleReturn status = ModuleManager::LoadModule(mname, u);
if (status == MOD_ERR_OK)
{
u->SendMessage(OperServ, OPER_MODULE_LOAD_FAIL, mname.c_str());
ircdproto->SendGlobops(OperServ, "%s loaded module %s", u->nick.c_str(), mname.c_str());
u->SendMessage(OperServ, OPER_MODULE_LOADED, mname.c_str());
/* If a user is loading this module, then the core databases have already been loaded
* so trigger the event manually
*/
m = FindModule(mname);
if (m)
m->OnPostLoadDatabases();
}
else
u->SendMessage(OperServ, OPER_MODULE_LOAD_FAIL, mname.c_str());
return MOD_CONT;
}