]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treeserver.cpp
Allow support for multiple dns results per request. This is a significant change...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treeserver.cpp
index 8930a7188392d5530460c381e88dd1bc12ef7ee8..d13075f0f8d7aa11fc7d4e03198f4aefd4be3f23 100644 (file)
@@ -1,3 +1,17 @@
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#include "inspircd.h"
 #include "configreader.h"
 #include "users.h"
 #include "channels.h"
@@ -5,7 +19,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "inspircd.h"
 #include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance) : ServerInstance(Instance), Utils(Util)
 {
        Parent = NULL;
-       ServerName = "";
-       ServerDesc = "";
-       VersionString = "";
+       ServerName.clear();
+       ServerDesc.clear();
+       VersionString.clear();
        UserCount = OperCount = 0;
+       rtt = LastPing = 0;
+       Hidden = false;
        VersionString = ServerInstance->GetVersionString();
 }
 
@@ -32,12 +47,14 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance) : Server
 TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc) : ServerInstance(Instance), ServerName(Name.c_str()), ServerDesc(Desc), Utils(Util)
 {
        Parent = NULL;
-       VersionString = "";
+       VersionString.clear();
        UserCount = ServerInstance->UserCount();
        OperCount = ServerInstance->OperCount();
        VersionString = ServerInstance->GetVersionString();
        Route = NULL;
        Socket = NULL; /* Fix by brain */
+       rtt = LastPing = 0;
+       Hidden = false;
        AddHashEntry();
 }
 
@@ -45,13 +62,14 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::str
  * This constructor initializes the server's Route and Parent, and sets up
  * its ping counters so that it will be pinged one minute from now.
  */
-TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc, TreeServer* Above, TreeSocket* Sock)
-       : ServerInstance(Instance), Parent(Above), ServerName(Name.c_str()), ServerDesc(Desc), Socket(Sock), Utils(Util)
+TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::string Name, std::string Desc, TreeServer* Above, TreeSocket* Sock, bool Hide)
+       : ServerInstance(Instance), Parent(Above), ServerName(Name.c_str()), ServerDesc(Desc), Socket(Sock), Utils(Util), Hidden(Hide)
 {
-       VersionString = "";
+       VersionString.clear();
        UserCount = OperCount = 0;
-       this->SetNextPingTime(time(NULL) + 60);
+       this->SetNextPingTime(time(NULL) + Utils->PingFreq);
        this->SetPingFlag();
+       rtt = LastPing = 0;
        /* find the 'route' for this server (e.g. the one directly connected
         * to the local server, which we can use to reach it)
         *
@@ -126,6 +144,9 @@ int TreeServer::QuitUsers(const std::string &reason)
                                userrec::QuitUser(ServerInstance, a, "*.net *.split", reason_s);
                        else
                                userrec::QuitUser(ServerInstance, a, reason_s);
+
+                       if (this->Utils->quiet_bursts)
+                               ServerInstance->GlobalCulls.MakeSilent(a);
                }
        }
        return time_to_die.size();