X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules.cpp;h=d77221c39f847b975f7c0af38c1c47ee635d3782;hb=81215de4f00d0044f1dbe0d1c81d1b7081e5405d;hp=3ff8aad145f3aec69cfb973617e6bd418822f95d;hpb=820f229a9efe2678d1e85578aa086a1efdd73a30;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules.cpp b/src/modules.cpp index 3ff8aad14..d77221c39 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -451,26 +451,6 @@ namespace ServerInstance->GlobalCulls.AddItem(this); } }; - - struct ReloadAction : public HandlerBase0 - { - Module* const mod; - HandlerBase1* const callback; - ReloadAction(Module* m, HandlerBase1* c) - : mod(m), callback(c) {} - void Call() - { - DLLManager* dll = mod->ModuleDLLManager; - std::string name = mod->ModuleSourceFile; - ServerInstance->Modules->DoSafeUnload(mod); - ServerInstance->GlobalCulls.Apply(); - delete dll; - bool rv = ServerInstance->Modules->Load(name); - if (callback) - callback->Call(rv); - ServerInstance->GlobalCulls.AddItem(this); - } - }; } bool ModuleManager::Unload(Module* mod) @@ -481,14 +461,6 @@ bool ModuleManager::Unload(Module* mod) return true; } -void ModuleManager::Reload(Module* mod, HandlerBase1* callback) -{ - if (CanUnload(mod)) - ServerInstance->AtomicActions.AddAction(new ReloadAction(mod, callback)); - else if (callback) - callback->Call(false); -} - void ModuleManager::LoadAll() { std::map servicemap; @@ -556,21 +528,6 @@ void ModuleManager::AddService(ServiceProvider& item) { switch (item.service) { - case SERVICE_COMMAND: - if (!ServerInstance->Parser.AddCommand(static_cast(&item))) - throw ModuleException("Command "+std::string(item.name)+" already exists."); - return; - case SERVICE_MODE: - { - ModeHandler* mh = static_cast(&item); - ServerInstance->Modes->AddMode(mh); - AddReferent((mh->GetModeType() == MODETYPE_CHANNEL ? "mode/" : "umode/") + item.name, &item); - return; - } - case SERVICE_METADATA: - if (!ServerInstance->Extensions.Register(static_cast(&item))) - throw ModuleException("Extension " + std::string(item.name) + " already exists."); - return; case SERVICE_DATA: case SERVICE_IOHOOK: {