From 11e45f2cb78c0667e2c7c7e2370944bf64b140b8 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 13 Mar 2010 01:28:54 +0000 Subject: Convert pgsql to SQLv3 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12626 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index a2e772ed5..9e5c84bff 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -437,6 +437,32 @@ void ModuleManager::AddService(ServiceProvider& item) } } +void ModuleManager::DelService(ServiceProvider& item) +{ + switch (item.service) + { + case SERVICE_MODE: + if (!ServerInstance->Modes->DelMode(static_cast(&item))) + throw ModuleException("Mode "+std::string(item.name)+" does not exist."); + return; + case SERVICE_DATA: + case SERVICE_IOHOOK: + { + for(std::multimap::iterator i = DataProviders.begin(); i != DataProviders.end(); ) + { + std::multimap::iterator curr = i++; + if (curr->second == &item) + DataProviders.erase(curr); + } + for(unsigned int i = 0; i < ServerInstance->Modules->ActiveDynrefs.size(); i++) + ServerInstance->Modules->ActiveDynrefs[i]->ClearCache(); + return; + } + default: + throw ModuleException("Cannot delete unknown service type"); + } +} + ServiceProvider* ModuleManager::FindService(ServiceType type, const std::string& name) { switch (type) -- cgit v1.2.3