From 351690f2404d930f2ab004f0c73ae0264c893f27 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 28 May 2007 12:38:20 +0000 Subject: - 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 --- src/modules/m_spanningtree/main.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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; } -- cgit v1.2.3