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"
19 #include "transport.h"
20 #include "socketengine.h"
22 #include "m_spanningtree/main.h"
23 #include "m_spanningtree/utils.h"
24 #include "m_spanningtree/treeserver.h"
25 #include "m_spanningtree/treesocket.h"
27 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
29 bool TreeSocket::LocalPing(const std::string &prefix, std::deque<std::string> ¶ms)
31 if (params.size() < 1)
33 if (params.size() == 1)
35 std::string stufftobounce = params[0];
36 this->WriteLine(std::string(":")+this->Instance->Config->GetSID()+" PONG "+stufftobounce);
41 std::string forwardto = params[1];
42 if (forwardto == this->Instance->Config->ServerName || forwardto == this->Instance->Config->GetSID())
44 // this is a ping for us, send back PONG to the requesting server
45 params[1] = params[0];
46 params[0] = forwardto;
47 Utils->DoOneToOne(forwardto,"PONG",params,params[1]);
51 // not for us, pass it on :)
52 Utils->DoOneToOne(prefix,"PING",params,forwardto);