diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-04 20:52:51 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-04 20:52:51 +0000 |
commit | ff50c6d788aea4a08d91b2b9653ace83cfd4d44b (patch) | |
tree | 210ca0a4b06483605b902410cb3d075cb9899432 /src/cmd_stats.cpp | |
parent | ad62fb493972ee0b21ca8be03757ba3ee439a489 (diff) |
Change /stats l to be more usable
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4719 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_stats.cpp')
-rw-r--r-- | src/cmd_stats.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/cmd_stats.cpp b/src/cmd_stats.cpp index 59e64d02b..f4db48538 100644 --- a/src/cmd_stats.cpp +++ b/src/cmd_stats.cpp @@ -50,6 +50,7 @@ extern FactoryList factory; extern time_t TIME; extern user_hash clientlist; extern chan_hash chanlist; +extern std::vector<userrec*> local_users; void cmd_stats::Handle (const char** parameters, int pcnt, userrec *user) { @@ -208,25 +209,21 @@ void DoStats(char statschar, userrec* user, string_list &results) results.push_back(sn+" 243 "+user->nick+" O "+HostName+" * "+LoginName+" "+OperType+" 0"); } } - + /* stats l (show user I/O stats) */ if (statschar == 'l') { - results.push_back(sn+" 211 "+user->nick+" :server:port nick bytes_in cmds_in bytes_out cmds_out"); - for (user_hash::iterator i = clientlist.begin(); i != clientlist.end(); i++) + results.push_back(sn+" 211 "+user->nick+" :nick[ident@host] sendq cmds_out bytes_out cmds_in bytes_in time_idle"); + for (std::vector<userrec*>::iterator n = local_users.begin(); n != local_users.end(); n++) { - if (isnick(i->second->nick)) - { - results.push_back(sn+" 211 "+user->nick+" :"+i->second->server+":"+ConvToStr(i->second->GetPort())+" "+i->second->nick+" "+ConvToStr(i->second->bytes_in)+" "+ConvToStr(i->second->cmds_in)+" "+ConvToStr(i->second->bytes_out)+" "+ConvToStr(i->second->cmds_out)); - } - else + userrec* i = *n; + if (isnick(i->nick)) { - results.push_back(sn+" 211 "+user->nick+" :"+i->second->server+":"+ConvToStr(i->second->GetPort())+" (unknown@"+ConvToStr(i->second->fd)+") "+ConvToStr(i->second->bytes_in)+" "+ConvToStr(i->second->cmds_in)+" "+ConvToStr(i->second->bytes_out)+" "+ConvToStr(i->second->cmds_out)); + results.push_back(sn+" 211 "+user->nick+" :"+i->nick+"["+i->ident+"@"+i->dhost+"] "+ConvToStr(i->sendq.length())+" "+ConvToStr(i->cmds_out)+" "+ConvToStr(i->bytes_out)+" "+ConvToStr(i->cmds_in)+" "+ConvToStr(i->bytes_in)+" "+ConvToStr(TIME - i->age)); } - } } - + /* stats u (show server uptime) */ if (statschar == 'u') { |