]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modmanager_dynamic.cpp
Merge tag 'v2.0.25' into master.
[user/henk/code/inspircd.git] / src / modmanager_dynamic.cpp
index 0d0042cabac0c9e93b6a2a53e9df07caa1f4c3f0..644d2140f614435dbc9e51f286fc34fb22ded050 100644 (file)
 
 
 #include "inspircd.h"
-#include "xline.h"
-#include "socket.h"
-#include "socketengine.h"
-#include "command_parse.h"
 #include "exitcodes.h"
 #include <iostream>
 
 #include <dirent.h>
 #endif
 
-#ifndef PURE_STATIC
+#ifndef INSPIRCD_STATIC
 
-bool ModuleManager::Load(const std::string& filename, bool defer)
+bool ModuleManager::Load(const std::string& modname, bool defer)
 {
        /* Don't allow people to specify paths for modules, it doesn't work as expected */
-       if (filename.find('/') != std::string::npos)
+       if (modname.find('/') != std::string::npos)
+       {
+               LastModuleError = "You can't load modules with a path: " + modname;
                return false;
+       }
 
+       const std::string filename = ExpandModName(modname);
        const std::string moduleFile = ServerInstance->Config->Paths.PrependModule(filename);
 
        if (!FileSystem::FileExists(moduleFile))
@@ -71,6 +71,8 @@ bool ModuleManager::Load(const std::string& filename, bool defer)
                        newmod->dying = false;
                        Modules[filename] = newmod;
                        std::string version = newhandle->GetVersion();
+                       if (version.empty())
+                               version.assign("unknown");
                        if (defer)
                        {
                                ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "New module introduced: %s (Module version %s)",
@@ -136,7 +138,7 @@ void ModuleManager::LoadCoreModules(std::map<std::string, ServiceList>& servicem
                dirent* entry = NULL;
                while (0 != (entry = readdir(library)))
                {
-                       if (InspIRCd::Match(entry->d_name, "cmd_*.so", ascii_case_insensitive_map))
+                       if (InspIRCd::Match(entry->d_name, "core_*.so", ascii_case_insensitive_map))
                        {
                                std::cout << ".";
                                fflush(stdout);