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/link.h"
27 #include "m_spanningtree/treesocket.h"
28 #include "m_spanningtree/resolvers.h"
29 #include "m_spanningtree/handshaketimer.h"
31 /* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */
33 bool TreeSocket::Stats(const std::string &prefix, std::deque<std::string> ¶ms)
35 /* Get the reply to a STATS query if it matches this servername,
36 * and send it back as a load of PUSH queries
38 if (params.size() > 1)
40 if (this->Instance->MatchText(this->Instance->Config->ServerName, params[1]))
42 /* It's for our server */
44 User* source = this->Instance->FindNick(prefix);
47 std::deque<std::string> par;
48 par.push_back(prefix);
50 DoStats(this->Instance, *(params[0].c_str()), source, results);
51 for (size_t i = 0; i < results.size(); i++)
53 par[1] = "::" + results[i];
54 Utils->DoOneToOne(this->Instance->Config->GetSID(), "PUSH",par, source->server);
61 User* source = this->Instance->FindNick(prefix);
63 Utils->DoOneToOne(source->uuid, "STATS", params, params[1]);