diff options
| author | 2007-05-28 15:22:31 +0000 | |
|---|---|---|
| committer | 2007-05-28 15:22:31 +0000 | |
| commit | cdbf2526f79f0ec4e90395158011062b7a198bcf (patch) | |
| tree | e487276a24baa1d9229a063d28f3885fab322638 /src/cmd_stats.cpp | |
| parent | Show IPs that a port is bound to in /stats p, don't remove duplicate ports an... (diff) | |
Remove code for clientcount/servercount from /stats p. At the moment it was slow, hacky and doesn't totally work properly (bind 2 same ports on diff. ips and watch it get confused ;p). It may be added back in a few versions once we have the infrastructure in place to tie a list of clients to a port.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7174 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_stats.cpp')
| -rw-r--r-- | src/cmd_stats.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/cmd_stats.cpp b/src/cmd_stats.cpp index 5c047f89b..5a22a2b4c 100644 --- a/src/cmd_stats.cpp +++ b/src/cmd_stats.cpp @@ -61,24 +61,14 @@ DllExport void DoStats(InspIRCd* ServerInstance, char statschar, userrec* user, /* stats p (show listening ports and registered clients on each) */ case 'p': { - std::map<int,int> pc; - for (std::vector<userrec*>::const_iterator i = ServerInstance->local_users.begin(); i != ServerInstance->local_users.end(); i++) - { - userrec* t = (userrec*)(*i); - if (t->registered == REG_ALL) - pc[t->GetPort()]++; - } for (size_t i = 0; i < ServerInstance->Config->ports.size(); i++) { - if (pc[ServerInstance->Config->ports[i]->GetPort()] >= 0) - { - 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()); - } + 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())+" (client, " + + ServerInstance->Config->ports[i]->GetDescription() + ")"); } } break; |
