Make realname Kill blocks more predictable, and add username="x" field.
[ircu2.10.12-pk.git] / ircd / s_stats.c
index 190e8dbbbf36ced95679ad09f01afcd82a1129cc..9714157616944cec13960e3df27ca664e79f2bb7 100644 (file)
@@ -41,6 +41,7 @@
 #include "msgq.h"
 #include "numeric.h"
 #include "numnicks.h"
+#include "querycmds.h"
 #include "res.h"
 #include "s_bsd.h"
 #include "s_conf.h"
@@ -193,8 +194,11 @@ report_deny_list(struct Client* to)
 {
   const struct DenyConf* p = conf_get_deny_list();
   for ( ; p; p = p->next)
-    send_reply(to, RPL_STATSKLINE, (p->flags & DENY_FLAGS_IP) ? 'k' : 'K',
-               p->hostmask, p->message, p->usermask);
+    send_reply(to, RPL_STATSKLINE, p->bits > 0 ? 'k' : 'K',
+               p->usermask ? p->usermask : "*",
+               p->hostmask ? p->hostmask : "*",
+               p->message ? p->message : "(none)",
+               p->realmask ? p->realmask : "*");
 }
 
 /** Report K/k-lines to a user.
@@ -245,9 +249,11 @@ stats_klines(struct Client *sptr, const struct StatDesc *sd, char *mask)
         (wilds && !mmatch(host, conf->hostmask) &&
          (!user || !mmatch(user, conf->usermask))))
     {
-      send_reply(sptr, RPL_STATSKLINE,
-                 (conf->flags & DENY_FLAGS_IP) ? 'k' : 'K',
-                 conf->hostmask, conf->message, conf->usermask);
+      send_reply(sptr, RPL_STATSKLINE, conf->bits > 0 ? 'k' : 'K',
+                 conf->usermask ? conf->usermask : "*",
+                 conf->hostmask ? conf->hostmask : "*",
+                 conf->message ? conf->message : "(none)",
+                 conf->realmask ? conf->realmask : "*");
       if (--count == 0)
         return;
     }
@@ -457,7 +463,7 @@ stats_servers_verbose(struct Client* sptr, const struct StatDesc* sd,
                cli_serv(acptr)->asll_rtt,
                cli_serv(acptr)->asll_to,
                cli_serv(acptr)->asll_from,
-               cli_serv(acptr)->clients,
+               (acptr == &me ? UserStats.local_clients : cli_serv(acptr)->clients),
                cli_serv(acptr)->nn_mask,
                cli_serv(acptr)->prot,
                cli_serv(acptr)->timestamp,