]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/main.cpp
Clean up svn:keywords
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / main.cpp
index 1bc3dfe3925b9f7fed8c62b400ea438f0f337316..31d0ec449e1bc9fde06e726c800bafe21e7c9447 100644 (file)
 
 /* $ModDep: m_spanningtree/cachetimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h m_spanningtree/protocolinterface.h */
 
-ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
-       : Module(Me), max_local(0), max_global(0)
+ModuleSpanningTree::ModuleSpanningTree()
+       : max_local(0), max_global(0)
 {
        ServerInstance->Modules->UseInterface("BufferedSocketHook");
-       Utils = new SpanningTreeUtilities(ServerInstance, this);
+       Utils = new SpanningTreeUtilities(this);
        command_rconnect = new CommandRConnect(this, Utils);
        ServerInstance->AddCommand(command_rconnect);
        command_rsquit = new CommandRSQuit(this, Utils);
        ServerInstance->AddCommand(command_rsquit);
-       RefreshTimer = new CacheRefreshTimer(ServerInstance, Utils);
+       RefreshTimer = new CacheRefreshTimer(Utils);
        ServerInstance->Timers->AddTimer(RefreshTimer);
 
        Implementation eventlist[] =
@@ -55,7 +55,7 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
        ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
 
        delete ServerInstance->PI;
-       ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils, ServerInstance);
+       ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils);
        loopCall = false;
 
        // update our local user count
@@ -275,7 +275,7 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y)
                /* Gave a hook, but it wasnt one we know */
                if ((!x->Hook.empty()) && (Utils->hooks.find(x->Hook.c_str()) == Utils->hooks.end()))
                        return;
-               TreeSocket* newsocket = new TreeSocket(Utils, ServerInstance, x->IPAddr,x->Port, x->Timeout ? x->Timeout : 10,x->Name.c_str(), x->Bind, y, x->Hook.empty() ? NULL : Utils->hooks[x->Hook.c_str()]);
+               TreeSocket* newsocket = new TreeSocket(Utils, x->IPAddr,x->Port, x->Timeout ? x->Timeout : 10,x->Name.c_str(), x->Bind, y, x->Hook.empty() ? NULL : Utils->hooks[x->Hook.c_str()]);
                if (newsocket->GetFd() > -1)
                {
                        /* Handled automatically on success */
@@ -283,8 +283,7 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y)
                else
                {
                        ServerInstance->SNO->WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: %s.",x->Name.c_str(),strerror(errno));
-                       if (ServerInstance->SocketCull.find(newsocket) == ServerInstance->SocketCull.end())
-                               ServerInstance->SocketCull[newsocket] = newsocket;
+                       ServerInstance->GlobalCulls.AddItem(newsocket);
                        Utils->DoFailOver(y);
                }
        }
@@ -293,7 +292,7 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y)
                try
                {
                        bool cached;
-                       ServernameResolver* snr = new ServernameResolver((Module*)this, Utils, ServerInstance,x->IPAddr, *x, cached, start_type, y);
+                       ServernameResolver* snr = new ServernameResolver((Module*)this, Utils, x->IPAddr, *x, cached, start_type, y);
                        ServerInstance->AddResolver(snr, cached);
                }
                catch (ModuleException& e)
@@ -943,7 +942,7 @@ void ModuleSpanningTree::OnEvent(Event* event)
 ModuleSpanningTree::~ModuleSpanningTree()
 {
        delete ServerInstance->PI;
-       ServerInstance->PI = new ProtocolInterface(ServerInstance);
+       ServerInstance->PI = new ProtocolInterface;
 
        /* This will also free the listeners */
        delete Utils;
@@ -958,7 +957,7 @@ ModuleSpanningTree::~ModuleSpanningTree()
 
 Version ModuleSpanningTree::GetVersion()
 {
-       return Version("$Id$", VF_VENDOR, API_VERSION);
+       return Version("Allows servers to be linked", VF_VENDOR);
 }
 
 /* It is IMPORTANT that m_spanningtree is the last module in the chain