]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modmanager_dynamic.cpp
m_spanningtree Remove SpanningTreeUtilities* fields and parameters
[user/henk/code/inspircd.git] / src / modmanager_dynamic.cpp
index b586976793844028a3dc80a69d1cc31c9f6404f6..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()))
        {
@@ -69,15 +69,16 @@ bool ModuleManager::Load(const std::string& filename, bool defer)
                        std::string version = newhandle->GetVersion();
                        if (defer)
                        {
-                               ServerInstance->Logs->Log("MODULE", LOG_DEFAULT,"New module introduced: %s (Module version %s)",
+                               ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "New module introduced: %s (Module version %s)",
                                        filename.c_str(), version.c_str());
                        }
                        else
                        {
+                               AttachAll(newmod);
                                newmod->init();
 
                                Version v = newmod->GetVersion();
-                               ServerInstance->Logs->Log("MODULE", LOG_DEFAULT,"New module introduced: %s (Module version %s)%s",
+                               ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "New module introduced: %s (Module version %s)%s",
                                        filename.c_str(), version.c_str(), (!(v.Flags & VF_VENDOR) ? " [3rd Party]" : " [Vendor]"));
                        }
                }
@@ -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)