diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-01-17 16:00:14 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-01-17 16:00:14 +0000 |
commit | 4b6bdeccb537b6f8030172c37afa7dc324e26765 (patch) | |
tree | 9c165894ba0a62072f81630fbba789770f2b63ba /src/modules/m_services_account.cpp | |
parent | 92974819e3bf1c3a97b83f6f4ccc612283120794 (diff) |
Add Module::init() for correct exception handling during hook registration
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12278 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_services_account.cpp')
-rw-r--r-- | src/modules/m_services_account.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 7073d58b0..069bcc837 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -109,13 +109,16 @@ class ModuleServicesAccount : public Module ModuleServicesAccount() : m1(this), m2(this), m3(this), m4(this), m5(this), accountname("accountname", this) { + } - if (!ServerInstance->Modes->AddMode(&m1) || !ServerInstance->Modes->AddMode(&m2) || - !ServerInstance->Modes->AddMode(&m3) || !ServerInstance->Modes->AddMode(&m4) || - !ServerInstance->Modes->AddMode(&m5)) - throw ModuleException("Some other module has claimed our modes!"); - - ServerInstance->Extensions.Register(&accountname); + void init() + { + ServerInstance->Modules->AddService(m1); + ServerInstance->Modules->AddService(m2); + ServerInstance->Modules->AddService(m3); + ServerInstance->Modules->AddService(m4); + ServerInstance->Modules->AddService(m5); + ServerInstance->Modules->AddService(accountname); Implementation eventlist[] = { I_OnWhois, I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserPreJoin, I_OnCheckBan, I_OnDecodeMetaData, I_On005Numeric, I_OnUserPostNick }; |