summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-28 12:38:20 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-28 12:38:20 +0000
commit351690f2404d930f2ab004f0c73ae0264c893f27 (patch)
tree272f790c617e3147cc6eb507aa3d2b35e8bccf21
parent6a98cb1ccbf3f9f8092d18de85ec08cef7e5d62b (diff)
- Add server ports to /stats p. This doesn't work properly yet as something is not initialising port correctly in a constructor I'd guess. It also does not enumerate connected servers to see how many connected on a given listener yet.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7170 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_spanningtree/main.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index ea01bb2c5..c82fd8bdd 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -654,6 +654,28 @@ int ModuleSpanningTree::OnStats(char statschar, userrec* user, string_list &resu
ServerInstance->SNO->WriteToSnoMask('t',"%s '%c' requested by %s (%s@%s)",(!strcmp(user->server,ServerInstance->Config->ServerName) ? "Stats" : "Remote stats"),statschar,user->nick,user->ident,user->host);
return 1;
}
+
+ if (statschar == 'p')
+ {
+ /* show all server ports, after showing client ports. -- w00t */
+
+ for (unsigned int i = 0; i < Utils->Bindings.size(); i++)
+ {
+ /*
+ * XXX - todo:
+ * we need to remove duplicate ports from this list, and possibly also
+ * show the correct number of servers on the port.
+ *
+ * XXX also, this doesn't currently work, as something is not initialising ->port, so it's 0 all the time.
+ *
+ */
+ if (Utils->Bindings[i]->port)
+ {
+ results.push_back(ConvToStr(ServerInstance->Config->ServerName) + " 249 "+user->nick+" :p:"+ConvToStr(Utils->Bindings[i]->port)+" (X servers) "+
+ ServerInstance->Config->ports[i]->GetDescription());
+ }
+ }
+ }
return 0;
}