diff options
Diffstat (limited to 'src/base.cpp')
-rw-r--r-- | src/base.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/base.cpp b/src/base.cpp index 496b23ef5..0ff3fbe4c 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -95,6 +95,10 @@ ServiceProvider::~ServiceProvider() { } +void ServiceProvider::RegisterService() +{ +} + ExtensionItem::ExtensionItem(const std::string& Key, ExtensibleType exttype, Module* mod) : ServiceProvider(mod, Key, SERVICE_METADATA) , type(exttype) @@ -140,6 +144,12 @@ void* ExtensionItem::unset_raw(Extensible* container) return rv; } +void ExtensionItem::RegisterService() +{ + if (!ServerInstance->Extensions.Register(this)) + throw ModuleException("Extension already exists: " + name); +} + bool ExtensionManager::Register(ExtensionItem* item) { return types.insert(std::make_pair(item->name, item)).second; |