1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
15 #include "commands/cmd_whois.h"
16 #include "commands/cmd_stats.h"
20 #include "transport.h"
21 #include "socketengine.h"
23 #include "m_spanningtree/main.h"
24 #include "m_spanningtree/utils.h"
25 #include "m_spanningtree/treeserver.h"
26 #include "m_spanningtree/treesocket.h"
28 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
30 bool TreeSocket::LocalPing(const std::string &prefix, std::deque<std::string> ¶ms)
32 if (params.size() < 1)
34 if (params.size() == 1)
36 std::string stufftobounce = params[0];
37 this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" PONG "+stufftobounce);
42 std::string forwardto = params[1];
43 if (forwardto == this->Instance->Config->ServerName || forwardto == this->Instance->Config->GetSID())
45 // this is a ping for us, send back PONG to the requesting server
46 params[1] = params[0];
47 params[0] = forwardto;
48 Utils->DoOneToOne(forwardto,"PONG",params,params[1]);
52 // not for us, pass it on :)
53 Utils->DoOneToOne(prefix,"PING",params,forwardto);