2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2012, 2014, 2016 Attila Molnar <attilamolnar@hush.com>
5 * Copyright (C) 2012 Robby <robby@chatbelgie.be>
6 * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
7 * Copyright (C) 2007 Craig Edwards <brain@inspircd.org>
9 * This file is part of InspIRCd. InspIRCd is free software: you can
10 * redistribute it and/or modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation, version 2.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 ModResult ModuleSpanningTree::OnStats(Stats::Context& stats)
31 if ((stats.GetSymbol() == 'c') || (stats.GetSymbol() == 'n'))
33 for (std::vector<reference<Link> >::iterator i = Utils->LinkBlocks.begin(); i != Utils->LinkBlocks.end(); ++i)
36 std::string ipaddr = "*@";
37 if (L->HiddenFromStats)
38 ipaddr.append("<hidden>");
40 ipaddr.append(L->IPAddr);
42 const std::string hook = (L->Hook.empty() ? "plaintext" : L->Hook);
43 stats.AddRow(213, stats.GetSymbol(), ipaddr, '*', L->Name, L->Port, hook);
44 if (stats.GetSymbol() == 'c')
45 stats.AddRow(244, 'H', '*', '*', L->Name);
49 else if (stats.GetSymbol() == 'U')
51 ConfigTagList tags = ServerInstance->Config->ConfTags("uline");
52 for (ConfigIter i = tags.first; i != tags.second; ++i)
54 std::string name = i->second->getString("server");
56 stats.AddRow(248, 'U', name);
60 return MOD_RES_PASSTHRU;