summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/protocolinterface.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-08 22:40:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-08 22:40:11 +0000
commit99a1ea0892b575c6d66d9f4c0aab5042c261ce4a (patch)
tree42f369f72519bf4e13ac30d5851166de8b897073 /src/modules/m_spanningtree/protocolinterface.cpp
parent2425244549a45295168b1958b9d599e5e286e629 (diff)
Add call to protocol interface to get useful info on the server map. Return a std::list of classes each of which has a server name, parent server name, user and oper count, and latency in millisecs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9673 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/protocolinterface.cpp')
-rw-r--r--src/modules/m_spanningtree/protocolinterface.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp
index 7aed1ddfa..e586c7017 100644
--- a/src/modules/m_spanningtree/protocolinterface.cpp
+++ b/src/modules/m_spanningtree/protocolinterface.cpp
@@ -5,6 +5,22 @@
#include "m_spanningtree/treesocket.h"
#include "m_spanningtree/protocolinterface.h"
+void SpanningTreeProtocolInterface::GetServerList(ProtoServerList &sl)
+{
+ sl.clear();
+ for (server_hash::iterator i = Utils->serverlist.begin(); i != Utils->serverlist.end(); i++)
+ {
+ ProtoServer ps;
+ ps.servername = i->second->GetName();
+ TreeServer* s = i->second->GetParent();
+ ps.parentname = s ? s->GetName() : ServerInstance->Config->ServerName;
+ ps.usercount = i->second->GetUserCount();
+ ps.opercount = i->second->GetOperCount();
+ ps.latencyms = i->second->rtt;
+ sl.push_back(ps);
+ }
+}
+
void SpanningTreeProtocolInterface::SendEncapsulatedData(parameterlist &encap)
{
Utils->DoOneToMany(ServerInstance->Config->GetSID(), "ENCAP", encap);