From e247a0fcd9cca5820339da330aaff3d334229146 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 9 Dec 2006 20:07:31 +0000 Subject: Move around the initialization stuff so it gets called in the right order git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5895 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'src/modules/m_spanningtree.cpp') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index d1fbbb502..206b5c3a1 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -3833,6 +3833,25 @@ SpanningTreeUtilities::SpanningTreeUtilities(InspIRCd* Instance, ModuleSpanningT Bindings.clear(); this->ReadConfiguration(true); this->TreeRoot = new TreeServer(this, ServerInstance, ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc); + + modulelist* ml = ServerInstance->FindInterface("InspSocketHook"); + + /* Did we find any modules? */ + if (ml) + { + /* Yes, enumerate them all to find out the hook name */ + for (modulelist::iterator m = ml->begin(); m != ml->end(); m++) + { + /* Make a request to it for its name, its implementing + * InspSocketHook so we know its safe to do this + */ + std::string name = InspSocketNameRequest((Module*)Creator, *m).Send(); + /* Build a map of them */ + hooks[name.c_str()] = *m; + hooknames.push_back(name); + ServerInstance->Log(DEBUG, "Found InspSocketHook interface: '%s' -> '%08x'", name.c_str(), *m); + } + } } SpanningTreeUtilities::~SpanningTreeUtilities() @@ -4222,26 +4241,6 @@ class ModuleSpanningTree : public Module } else SyncTimer = NULL; - - modulelist* ml = ServerInstance->FindInterface("InspSocketHook"); - - /* Did we find any modules? */ - if (ml) - { - /* Yes, enumerate them all to find out the hook name */ - for (modulelist::iterator m = ml->begin(); m != ml->end(); m++) - { - /* Make a request to it for its name, its implementing - * InspSocketHook so we know its safe to do this - */ - std::string name = InspSocketNameRequest(this, *m).Send(); - /* Build a map of them */ - Utils->hooks[name.c_str()] = *m; - Utils->hooknames.push_back(name); - - ServerInstance->Log(DEBUG, "Found InspSocketHook interface: '%s' -> '%08x'", name.c_str(), *m); - } - } } void ShowLinks(TreeServer* Current, userrec* user, int hops) -- cgit v1.2.3