]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modmanager_dynamic.cpp
m_spanningtree Remove duplicate code for sending channel messages from RouteCommand()
[user/henk/code/inspircd.git] / src / modmanager_dynamic.cpp
index b9c046a8e78e67959669147072881fc39a455a42..750a1c448002c8cc17b416cdf7618b8e8160ab22 100644 (file)
@@ -37,7 +37,7 @@ bool ModuleManager::Load(const std::string& filename, bool defer)
        if (filename.find('/') != std::string::npos)
                return false;
 
-       const std::string moduleFile = ServerInstance->Config->ModPath + "/" + filename;
+       const std::string moduleFile = ServerInstance->Config->Paths.PrependModule(filename);
 
        if (!ServerConfig::FileExists(moduleFile.c_str()))
        {
@@ -74,6 +74,7 @@ bool ModuleManager::Load(const std::string& filename, bool defer)
                        }
                        else
                        {
+                               AttachAll(newmod);
                                newmod->init();
 
                                Version v = newmod->GetVersion();
@@ -108,7 +109,7 @@ bool ModuleManager::Load(const std::string& filename, bool defer)
        if (defer)
                return true;
 
-       FOREACH_MOD(I_OnLoadModule,OnLoadModule(newmod));
+       FOREACH_MOD(OnLoadModule, (newmod));
        /* We give every module a chance to re-prioritize when we introduce a new one,
         * not just the one thats loading, as the new module could affect the preference
         * of others
@@ -189,7 +190,7 @@ void ModuleManager::LoadAll()
        std::cout << std::endl << "Loading core commands";
        fflush(stdout);
 
-       DIR* library = opendir(ServerInstance->Config->ModPath.c_str());
+       DIR* library = opendir(ServerInstance->Config->Paths.Module.c_str());
        if (library)
        {
                dirent* entry = NULL;
@@ -233,6 +234,7 @@ void ModuleManager::LoadAll()
                try
                {
                        ServerInstance->Logs->Log("MODULE", LOG_DEBUG, "Initializing %s", i->first.c_str());
+                       AttachAll(mod);
                        mod->init();
                }
                catch (CoreException& modexcept)