X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodmanager_dynamic.cpp;h=644d2140f614435dbc9e51f286fc34fb22ded050;hb=48a400f2e068527b338ceecf8ed1dde2da971ca9;hp=de2593d7236e50946fdf87a93718debca05a438c;hpb=992674362c5f64bdb8e1942eeaa7612524529cd6;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modmanager_dynamic.cpp b/src/modmanager_dynamic.cpp index de2593d72..644d2140f 100644 --- a/src/modmanager_dynamic.cpp +++ b/src/modmanager_dynamic.cpp @@ -18,10 +18,6 @@ #include "inspircd.h" -#include "xline.h" -#include "socket.h" -#include "socketengine.h" -#include "command_parse.h" #include "exitcodes.h" #include @@ -29,17 +25,21 @@ #include #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 (!ServerConfig::FileExists(moduleFile.c_str())) + if (!FileSystem::FileExists(moduleFile)) { LastModuleError = "Module file could not be found: " + filename; ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, LastModuleError); @@ -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& 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);