]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/utils.cpp
Store id in TreeServer, use TreeServer::GetID() to get the id (NOTE: it is std::string)
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / utils.cpp
index 9d4fbf41a3c19c4d2c7555d2fbccc30e4abf9e3a..b8a634797b8acf691374986caaabf1ead0b48495 100644 (file)
@@ -202,6 +202,7 @@ SpanningTreeUtilities::~SpanningTreeUtilities()
                }
        }
        delete TreeRoot;
+       ServerInstance->InspSocketCull();
 }
 
 void SpanningTreeUtilities::AddThisServer(TreeServer* server, TreeServerList &list)
@@ -497,8 +498,12 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
        ChallengeResponse = !Conf->ReadFlag("options", "disablehmac", 0);
        quiet_bursts = Conf->ReadFlag("options", "quietbursts", 0);
        PingWarnTime = Conf->ReadInteger("options", "pingwarning", 0, true);
+       PingFreq = Conf->ReadInteger("options", "serverpingfreq", 0, true);
 
-       if (PingWarnTime < 0 || PingWarnTime > 59)
+       if (PingFreq == 0)
+               PingFreq = 60;
+
+       if (PingWarnTime < 0 || PingWarnTime > PingFreq - 1)
                PingWarnTime = 0;
 
        LinkBlocks.clear();
@@ -616,18 +621,18 @@ void SpanningTreeUtilities::DoFailOver(Link* x)
        {
                if (x->FailOver == x->Name)
                {
-                       ServerInstance->SNO->WriteToSnoMask('l',"FAILOVER: Some muppet configured the failover for server \002%s\002 to point at itself. Not following it!", x->Name.c_str());
+                       Creator->RemoteMessage(NULL,"FAILOVER: Some muppet configured the failover for server \002%s\002 to point at itself. Not following it!", x->Name.c_str());
                        return;
                }
                Link* TryThisOne = this->FindLink(x->FailOver.c_str());
                if (TryThisOne)
                {
-                       ServerInstance->SNO->WriteToSnoMask('l',"FAILOVER: Trying failover link for \002%s\002: \002%s\002...", x->Name.c_str(), TryThisOne->Name.c_str());
+                       Creator->RemoteMessage(NULL,"FAILOVER: Trying failover link for \002%s\002: \002%s\002...", x->Name.c_str(), TryThisOne->Name.c_str());
                        Creator->ConnectServer(TryThisOne);
                }
                else
                {
-                       ServerInstance->SNO->WriteToSnoMask('l',"FAILOVER: Invalid failover server specified for server \002%s\002, will not follow!", x->Name.c_str());
+                       Creator->RemoteMessage(NULL,"FAILOVER: Invalid failover server specified for server \002%s\002, will not follow!", x->Name.c_str());
                }
        }
 }