X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodmanager_dynamic.cpp;h=050f41c758379e7581fea0054287a3532d885c7e;hb=748b3a0d89e7ecc9a766471b79fb78f63a5ca2bb;hp=5406cfd33e2b69a55ea8daaeefbcebfa95cd64c9;hpb=8095fb6079c3416cf2aa0147154f440466a6e11d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modmanager_dynamic.cpp b/src/modmanager_dynamic.cpp index 5406cfd33..050f41c75 100644 --- a/src/modmanager_dynamic.cpp +++ b/src/modmanager_dynamic.cpp @@ -36,7 +36,10 @@ bool ModuleManager::Load(const std::string& filename, bool defer) { /* Don't allow people to specify paths for modules, it doesn't work as expected */ if (filename.find('/') != std::string::npos) + { + LastModuleError = "You can't load modules with a path: " + filename; return false; + } char modfile[MAXBUF]; snprintf(modfile,MAXBUF,"%s/%s",ServerInstance->Config->ModPath.c_str(),filename.c_str()); @@ -66,6 +69,7 @@ bool ModuleManager::Load(const std::string& filename, bool defer) { newmod->ModuleSourceFile = filename; newmod->ModuleDLLManager = newhandle; + newmod->dying = false; Modules[filename] = newmod; std::string version = newhandle->GetVersion(); if (defer) @@ -178,7 +182,7 @@ void ModuleManager::Reload(Module* mod, HandlerBase1* callback) { if (CanUnload(mod)) ServerInstance->AtomicActions.AddAction(new ReloadAction(mod, callback)); - else + else if (callback) callback->Call(false); } @@ -204,7 +208,7 @@ void ModuleManager::LoadAll() if (!Load(entry->d_name, true)) { ServerInstance->Logs->Log("MODULE", DEFAULT, this->LastError()); - std::cout << std::endl << "[" << con_red << "*" << con_reset << "]" << this->LastError() << std::endl << std::endl; + std::cout << std::endl << "[" << con_red << "*" << con_reset << "] " << this->LastError() << std::endl << std::endl; ServerInstance->Exit(EXIT_STATUS_MODULE); } } @@ -223,7 +227,7 @@ void ModuleManager::LoadAll() if (!this->Load(name, true)) { ServerInstance->Logs->Log("MODULE", DEFAULT, this->LastError()); - std::cout << std::endl << "[" << con_red << "*" << con_reset << "]" << this->LastError() << std::endl << std::endl; + std::cout << std::endl << "[" << con_red << "*" << con_reset << "] " << this->LastError() << std::endl << std::endl; ServerInstance->Exit(EXIT_STATUS_MODULE); } } @@ -240,7 +244,7 @@ void ModuleManager::LoadAll() { LastModuleError = "Unable to initialize " + mod->ModuleSourceFile + ": " + modexcept.GetReason(); ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError); - std::cout << std::endl << "[" << con_red << "*" << con_reset << "]" << LastModuleError << std::endl << std::endl; + std::cout << std::endl << "[" << con_red << "*" << con_reset << "] " << LastModuleError << std::endl << std::endl; ServerInstance->Exit(EXIT_STATUS_MODULE); } }