#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 (!ServerConfig::FileExists(moduleFile.c_str()))
+ if (!FileSystem::FileExists(moduleFile))
{
LastModuleError = "Module file could not be found: " + filename;
ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, LastModuleError);
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);