From 9955724ef9b4865bc165e2c95ce7542d5f2d60c7 Mon Sep 17 00:00:00 2001 From: stskeeps Date: Fri, 1 Dec 2000 11:19:11 +0000 Subject: [PATCH] +- Added infofield in /stats L for clients/listeners --- Changes | 1 + src/s_serv.c | 42 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 658a19f0e..0812b3883 100644 --- a/Changes +++ b/Changes @@ -215,3 +215,4 @@ - Added some credits - Fixed a real bad /whois bug, reported by BiGi - Fixed a problem with /sajoin .. atleast possible +- Added infofield in /stats L for clients/listeners \ No newline at end of file diff --git a/src/s_serv.c b/src/s_serv.c index 0abc2b869..f3b91f13f 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -2276,6 +2276,39 @@ static void report_configured_links(sptr, mask) } +char *get_cptr_status(aClient *acptr) +{ + static char buf[10]; + char *p = buf; + + *p = '\0'; + *p++ = '['; + if (acptr->flags & FLAGS_LISTEN) + { + if (acptr->umodes & LISTENER_NORMAL) + *p++ = '*'; + if (acptr->umodes & LISTENER_SERVERSONLY) + *p++ = 'S'; + if (acptr->umodes & LISTENER_CLIENTSONLY) + *p++ = 'C'; +#ifdef USE_SSL + if (acptr->umodes & LISTENER_SSL) + *p++ = 's'; +#endif + if (acptr->umodes & LISTENER_REMOTEADMIN) + *p++ = 'R'; + if (acptr->umodes & LISTENER_JAVACLIENT) + *p++ = 'J'; + } + else + { + if (acptr->flags & FLAGS_SSL) + *p++ = 's'; + } + *p++ = ']'; + *p++ = '\0'; + return (buf); +} /* Used to blank out ports -- Barubary */ char *get_client_name2(aClient *acptr, int showports) @@ -2301,11 +2334,11 @@ int m_stats(cptr, sptr, parc, parv) #ifndef DEBUGMODE static char Sformat[] = ":%s %d %s SendQ SendM SendBytes RcveM RcveBytes Open_since :Idle"; - static char Lformat[] = ":%s %d %s %s %u %u %u %u %u %u :%u"; + static char Lformat[] = ":%s %d %s %s%s %u %u %u %u %u %u :%u"; #else static char Sformat[] = ":%s %d %s SendQ SendM SendBytes RcveM RcveBytes Open_since CPU :Idle"; - static char Lformat[] = ":%s %d %s %s %u %u %u %u %u %u %s"; + static char Lformat[] = ":%s %d %s %s%s %u %u %u %u %u %u %s"; char pbuf[96]; /* Should be enough for to ints */ #endif struct Message *mptr; @@ -2388,9 +2421,10 @@ int m_stats(cptr, sptr, parc, parv) continue; if (!doall && wilds && match(name, acptr->name)) continue; - if (!(parc == 2 && IsServer(acptr)) && +/* if (!(parc == 2 && IsServer(acptr)) && !(doall || wilds) && mycmp(name, acptr->name)) continue; +*/ #ifdef DEBUGMODE ircsprintf(pbuf, "%d :%d", acptr->cputime, (acptr->user && MyConnect(acptr)) ? @@ -2403,6 +2437,7 @@ int m_stats(cptr, sptr, parc, parv) (isupper(stat)) ? get_client_name2(acptr, showports) : get_client_name(acptr, FALSE), + get_cptr_status(acptr), (int)DBufLength(&acptr->sendQ), (int)acptr->sendM, (int)acptr->sendK, (int)acptr->receiveM, @@ -2426,6 +2461,7 @@ int m_stats(cptr, sptr, parc, parv) (isupper(stat)) ? /* Potvin - PreZ */ get_client_name2(acptr, showports) : get_client_name(acptr, FALSE), + get_cptr_status(acptr), (int)DBufLength(&acptr->sendQ), (int)acptr->sendM, (int)acptr->sendK, (int)acptr->receiveM,