From 5d474dc9fbd9bd36d0a0a8df93e1ec1e180864d7 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 17 Jan 2010 17:10:45 +0000 Subject: Move initialization that throws configuration exceptions to init() git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12279 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_ojoin.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/modules/m_ojoin.cpp') diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp index cacc206d6..176a0e613 100644 --- a/src/modules/m_ojoin.cpp +++ b/src/modules/m_ojoin.cpp @@ -211,6 +211,10 @@ class ModuleOjoin : public Module ModuleOjoin() : np(NULL), mycommand(this) + { + } + + void init() { /* Load config stuff */ OnRehash(NULL); @@ -218,13 +222,8 @@ class ModuleOjoin : public Module /* Initialise module variables */ np = new NetworkPrefix(this); - if (!ServerInstance->Modes->AddMode(np)) - { - delete np; - throw ModuleException("Could not add new mode!"); - } - - ServerInstance->AddCommand(&mycommand); + ServerInstance->Modules->AddService(*np); + ServerInstance->Modules->AddService(mycommand); Implementation eventlist[] = { I_OnUserPreJoin, I_OnUserPreKick, I_OnRehash }; ServerInstance->Modules->Attach(eventlist, this, 3); -- cgit v1.3.1-10-gc9f91