diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-13 01:28:54 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-13 01:28:54 +0000 |
commit | 11e45f2cb78c0667e2c7c7e2370944bf64b140b8 (patch) | |
tree | 54a9da96d4911112fa2d5b1669ee1d661e9a1bb4 /src/modules.cpp | |
parent | a115cb04b75b27c661551b6395e79b4d96d0fdef (diff) |
Convert pgsql to SQLv3
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12626 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules.cpp')
-rw-r--r-- | src/modules.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
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<ModeHandler*>(&item))) + throw ModuleException("Mode "+std::string(item.name)+" does not exist."); + return; + case SERVICE_DATA: + case SERVICE_IOHOOK: + { + for(std::multimap<std::string, ServiceProvider*>::iterator i = DataProviders.begin(); i != DataProviders.end(); ) + { + std::multimap<std::string, ServiceProvider*>::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) |