]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket2.cpp
Added ability to send and receive a challenge, dont do anything with it yet
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket2.cpp
index 0008c269194b1298704ccb01d1db57a026f72c5b..da456603fa5c78a9a3ae6b1e8a89eb9383ca8d64 100644 (file)
@@ -1,3 +1,16 @@
+/*       +------------------------------------+
+ *       | 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 "configreader.h"
 #include "users.h"
 #include "channels.h"
@@ -400,6 +413,7 @@ bool TreeSocket::LocalPong(const std::string &prefix, std::deque<std::string> &p
                if (ServerSource)
                {
                        ServerSource->SetPingFlag();
+                       ServerSource->rtt = Instance->Time() - ServerSource->LastPing;
                }
        }
        else
@@ -542,7 +556,8 @@ bool TreeSocket::AddLine(const std::string &prefix, std::deque<std::string> &par
        {
                if (atoi(params[4].c_str()))
                {
-                       this->Instance->SNO->WriteToSnoMask('x',"%s Added %cLINE on %s to expire in %lu seconds (%s).",prefix.c_str(),*(params[0].c_str()),params[1].c_str(),atoi(params[4].c_str()),params[5].c_str());
+                       time_t c_requires_crap = ConvToInt(params[4]) + Instance->Time();
+                       this->Instance->SNO->WriteToSnoMask('x',"%s Added %cLINE on %s to expire on %s (%s).",prefix.c_str(),*(params[0].c_str()),params[1].c_str(),Instance->TimeString(c_requires_crap).c_str(),params[5].c_str());
                }
                else
                {
@@ -790,7 +805,8 @@ bool TreeSocket::RemoteServer(const std::string &prefix, std::deque<std::string>
                this->Instance->SNO->WriteToSnoMask('l',"Server \2"+servername+"\2 being introduced from \2" + prefix + "\2 denied, already exists. Closing link with " + prefix);
                return false;
        }
-       TreeServer* Node = new TreeServer(this->Utils,this->Instance,servername,description,ParentOfThis,NULL);
+       Link* lnk = Utils->FindLink(servername);
+       TreeServer* Node = new TreeServer(this->Utils,this->Instance,servername,description,ParentOfThis,NULL, lnk ? lnk->Hidden : false);
        ParentOfThis->AddChild(Node);
        params[3] = ":" + params[3];
        Utils->DoOneToAllButSender(prefix,"SERVER",params,prefix);
@@ -834,7 +850,7 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> &params)
                        // we should add the details of this server now
                        // to the servers tree, as a child of the root
                        // node.
-                       TreeServer* Node = new TreeServer(this->Utils,this->Instance,sname,description,Utils->TreeRoot,this);
+                       TreeServer* Node = new TreeServer(this->Utils,this->Instance,sname,description,Utils->TreeRoot,this,x->Hidden);
                        Utils->TreeRoot->AddChild(Node);
                        params[3] = ":" + params[3];
                        Utils->DoOneToAllButSender(Utils->TreeRoot->GetName(),"SERVER",params,sname);
@@ -902,7 +918,7 @@ void TreeSocket::Split(const std::string &line, std::deque<std::string> &n)
        n.clear();
        irc::tokenstream tokens(line);
        std::string param;
-       while ((param = tokens.GetToken()) != "")
+       while (tokens.GetToken(param))
                n.push_back(param);
        return;
 }
@@ -1013,7 +1029,8 @@ bool TreeSocket::ProcessLine(std::string &line)
                                        }
                                }
                                this->LinkState = CONNECTED;
-                               Node = new TreeServer(this->Utils,this->Instance,InboundServerName,InboundDescription,Utils->TreeRoot,this);
+                               Link* lnk = Utils->FindLink(InboundServerName);
+                               Node = new TreeServer(this->Utils,this->Instance, InboundServerName, InboundDescription, Utils->TreeRoot, this, lnk ? lnk->Hidden : false);
                                Utils->TreeRoot->AddChild(Node);
                                params.clear();
                                params.push_back(InboundServerName);