X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodmanager_static.cpp;h=cea40c7a32364e75a807866f7979e6730c88a40c;hb=68211809ee3111bdc9609fbd46dc3c875fbb5ea6;hp=b105eea924a23ff478a30e9bfcb7520c96469e11;hpb=78a6d62732f2f0c2752d9de8729a745413ebe64a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modmanager_static.cpp b/src/modmanager_static.cpp index b105eea92..cea40c7a3 100644 --- a/src/modmanager_static.cpp +++ b/src/modmanager_static.cpp @@ -93,6 +93,7 @@ bool ModuleManager::Load(const std::string& name, bool defer) mod = (*it->second->init)(); mod->ModuleSourceFile = name; mod->ModuleDLLManager = NULL; + mod->dying = false; Modules[name] = mod; if (defer) { @@ -157,7 +158,8 @@ namespace { ServerInstance->Modules->DoSafeUnload(mod); ServerInstance->GlobalCulls.Apply(); bool rv = ServerInstance->Modules->Load(name.c_str()); - callback->Call(rv); + if (callback) + callback->Call(rv); ServerInstance->GlobalCulls.AddItem(this); } }; @@ -175,7 +177,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); } @@ -183,6 +185,7 @@ void ModuleManager::LoadAll() { Load("cmd_all", true); Load("cmd_whowas.so", true); + Load("cmd_lusers.so", true); ConfigTagList tags = ServerInstance->Config->ConfTags("module"); for(ConfigIter i = tags.first; i != tags.second; ++i) @@ -194,7 +197,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); } } @@ -210,7 +213,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); } }