diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-28 15:03:52 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-28 15:03:52 +0000 |
commit | 04e35b16d86dd0115b3bcd0749398ec957cf0700 (patch) | |
tree | 09e852e9c828679108bd973a272accc5e7f0500d /src | |
parent | 0d3590442639decab91c9f58c7bd347abb7be2e3 (diff) |
Show IPs that a port is bound to in /stats p, don't remove duplicate ports anymore, since we know what IP a port belongs to.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7173 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd_stats.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/cmd_stats.cpp b/src/cmd_stats.cpp index 9f90f06c4..5c047f89b 100644 --- a/src/cmd_stats.cpp +++ b/src/cmd_stats.cpp @@ -72,10 +72,12 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, userrec* user, { if (pc[ServerInstance->Config->ports[i]->GetPort()] >= 0) { - results.push_back(sn+" 249 "+user->nick+" :p:"+ConvToStr(ServerInstance->Config->ports[i]->GetPort())+" (" + + std::string ip = ServerInstance->Config->ports[i]->GetIP(); + if (ip.empty()) + ip = "*"; + results.push_back(sn+" 249 "+user->nick+" :"+ ip + ":"+ConvToStr(ServerInstance->Config->ports[i]->GetPort())+" (" + ConvToStr(pc[ServerInstance->Config->ports[i]->GetPort()])+" client" + (pc[ServerInstance->Config->ports[i]->GetPort()] != 1 ? "s" : "") + "), "+ ServerInstance->Config->ports[i]->GetDescription()); - pc[ServerInstance->Config->ports[i]->GetPort()] = -1; } } } diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index c82fd8bdd..bebb69012 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -671,7 +671,10 @@ int ModuleSpanningTree::OnStats(char statschar, userrec* user, string_list &resu */ if (Utils->Bindings[i]->port) { - results.push_back(ConvToStr(ServerInstance->Config->ServerName) + " 249 "+user->nick+" :p:"+ConvToStr(Utils->Bindings[i]->port)+" (X servers) "+ + std::string ip = Utils->Bindings[i]->IP; + if (ip.empty()) + ip = "*"; + results.push_back(ConvToStr(ServerInstance->Config->ServerName) + " 249 "+user->nick+" :" + ip + ":" + ConvToStr(Utils->Bindings[i]->port)+" (X servers) "+ ServerInstance->Config->ports[i]->GetDescription()); } } |