summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-04 14:47:35 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-04 14:47:35 +0000
commit9fd4410b28417f3f116f3a0a8b25bc0d8ea8ed5a (patch)
treeb045173966e106d062b0a75b66b91b21b9381669
parentb28baa00151ea60d3739bba9eba2fc8213fca3a3 (diff)
Implemented LUSERS
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2142 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_spanningtree.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 97e3e9916..a9315199a 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -1414,6 +1414,7 @@ class ModuleSpanningTree : public Module
{
std::vector<TreeSocket*> Bindings;
int line;
+ int NumServers;
public:
@@ -1443,6 +1444,27 @@ class ModuleSpanningTree : public Module
WriteServ(user->fd,"364 %s %s %s :%d %s",user->nick,Current->GetName().c_str(),Parent.c_str(),hops,Current->GetDesc().c_str());
}
+ int CountLocalServs()
+ {
+ return TreeRoot->ChildCount();
+ }
+
+ void CountServsRecursive(TreeServer* Current)
+ {
+ NumServs++;
+ for (unsigned int q = 0; q < Current->ChildCount(); q++)
+ {
+ CountServsRecursive(Current->GetChild(q));
+ }
+ }
+
+ int CountServs()
+ {
+ NumServs = 0;
+ CountServsRecursive(TreeRoot);
+ return NumServs;
+ }
+
void HandleLinks(char** parameters, int pcnt, userrec* user)
{
ShowLinks(TreeRoot,user,0);
@@ -1452,6 +1474,11 @@ class ModuleSpanningTree : public Module
void HandleLusers(char** parameters, int pcnt, userrec* user)
{
+ WriteServ(user->fd,"251 %s :There are %d users and %d invisible on %d servers",user->nick,usercnt()-usercount_invisible(),usercount_invisible(),this->CountServs());
+ WriteServ(user->fd,"252 %s %d :operator(s) online",user->nick,usercount_opers());
+ WriteServ(user->fd,"253 %s %d :unknown connections",user->nick,usercount_unknown());
+ WriteServ(user->fd,"254 %s %d :channels formed",user->nick,chancount());
+ WriteServ(user->fd,"254 %s :I have %d clients and %d servers",user->nick,local_count(),this->CountLocalServs());
return;
}