]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Merge.
authorChris Porter <redacted>
Thu, 16 Feb 2012 03:15:53 +0000 (03:15 +0000)
committerChris Porter <redacted>
Thu, 16 Feb 2012 03:15:53 +0000 (03:15 +0000)
chandump/chandump.c
localuser/localuserstats.c

index 743f3e4e5f81393cc20d70905b8434b2af587725..6f37fd434016009783c9b4289ad6f3df9b2098d0 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <string.h>
 
 #include "../core/schedule.h"
 #include "../channel/channel.h"
@@ -11,15 +12,23 @@ void *dumpsched;
 void dodump(void *arg) {
   chanindex *c;
   int i;
+  nick *n;
+  char buf[512];
 
   FILE *fp = fopen("chandump/chandump.txt.1", "w");
   if(!fp)
     return;
 
+  fprintf(fp, "M T %lld\n", (unsigned long long)time(NULL));
+
   for(i=0;i<CHANNELHASHSIZE;i++)
     for(c=chantable[i];c;c=c->next)
       if(c->channel && !IsSecret(c->channel))
-        fprintf(fp, "%s %d%s%s\n", c->name->content, c->channel->users->totalusers, (c->channel->topic&&c->channel->topic->content)?" ":"", (c->channel->topic&&c->channel->topic->content)?c->channel->topic->content:"");
+        fprintf(fp, "C %s %d%s%s\n", c->name->content, c->channel->users->totalusers, (c->channel->topic&&c->channel->topic->content)?" ":"", (c->channel->topic&&c->channel->topic->content)?c->channel->topic->content:"");
+
+  for(i=0;i<NICKHASHSIZE;i++)
+    for(n=nicktable[i];n;n=n->next)
+      fprintf(fp, "N %s %s %s %s %s\n", n->nick, n->ident, strchr(visibleuserhost(n, buf), '@') + 1, (IsAccount(n) && n->authname) ? n->authname : "0", n->realname->name->content);
 
   fclose(fp);
 
@@ -27,7 +36,7 @@ void dodump(void *arg) {
 } 
 
 void _init() {
-  dumpsched = (void *)schedulerecurring(time(NULL), 0, 300, &dodump, NULL);
+  dumpsched = (void *)schedulerecurring(time(NULL), 0, 60, &dodump, NULL);
 }
 
 void _fini() {
index 734ecc4593dad62611d30a5fcc488c8fc92ca2e3..15adb787362bda00bc95492e258131e77c66f80d 100644 (file)
@@ -38,6 +38,7 @@ int handleserverstatsend(void *source, int cargc, char **cargv);
 #define RPL_STATSTLINE       246        /* Undernet extension */
 #define RPL_STATSGLINE       247        /* Undernet extension */
 #define RPL_STATSULINE       248        /* Undernet extension */
+#define RPL_STATSDEBUG       249        /* Extension to RFC1459 */
 #define RPL_STATSCONN        250        /* Undernet extension */
 #define RPL_STATSDLINE       275        /* Undernet extension */
 #define RPL_STATSRLINE       276        /* Undernet extension */
@@ -48,7 +49,7 @@ int handleserverstatsend(void *source, int cargc, char **cargv);
 const int numerics[] = { RPL_STATSLINKINFO, RPL_STATSCOMMANDS, RPL_STATSCLINE, RPL_STATSNLINE, RPL_STATSILINE, RPL_STATSKLINE, 
                          RPL_STATSPLINE, RPL_STATSYLINE, RPL_STATSJLINE, RPL_STATSALINE, RPL_STATSQLINE, RPL_STATSVERBOSE, 
                          RPL_STATSENGINE, RPL_STATSFLINE, RPL_STATSLLINE, RPL_STATSUPTIME, RPL_STATSOLINE, RPL_STATSHLINE,
-                         RPL_STATSTLINE, RPL_STATSGLINE,RPL_STATSULINE, RPL_STATSCONN, RPL_STATSDLINE, RPL_STATSRLINE, 
+                         RPL_STATSTLINE, RPL_STATSGLINE, RPL_STATSULINE, RPL_STATSDEBUG, RPL_STATSCONN, RPL_STATSDLINE, RPL_STATSRLINE, 
                          RPL_STATSSLINE, 0 };
 
 void _init() {