summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/protocolinterface.cpp16
-rw-r--r--src/modules/m_spanningtree/protocolinterface.h3
2 files changed, 18 insertions, 1 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);
diff --git a/src/modules/m_spanningtree/protocolinterface.h b/src/modules/m_spanningtree/protocolinterface.h
index 60f961a22..b43e88c67 100644
--- a/src/modules/m_spanningtree/protocolinterface.h
+++ b/src/modules/m_spanningtree/protocolinterface.h
@@ -4,7 +4,6 @@
class SpanningTreeUtilities;
class ModuleSpanningTree;
-
class SpanningTreeProtocolInterface : public ProtocolInterface
{
SpanningTreeUtilities* Utils;
@@ -25,6 +24,8 @@ class SpanningTreeProtocolInterface : public ProtocolInterface
virtual void SendChannelNotice(Channel* target, char status, const std::string &text);
virtual void SendUserPrivmsg(User* target, const std::string &text);
virtual void SendUserNotice(User* target, const std::string &text);
+ virtual void GetServerList(ProtoServerList &sl);
};
#endif
+