]> jfr.im git - irc/quakenet/newserv.git/commitdiff
add missing help
authorPaul <redacted>
Mon, 25 Aug 2008 10:01:00 +0000 (11:01 +0100)
committerPaul <redacted>
Mon, 25 Aug 2008 10:01:00 +0000 (11:01 +0100)
chanfix/chanfix.c
chanstats/chanstats.c
patricia/patricia_commands.c

index 31b7c12aac772c645d7bd62cf2e7885443990570..79cace4566c6b034bf2b0b725239ec2cc78b22ed 100644 (file)
@@ -69,23 +69,23 @@ void _init() {
     schedulerecurring(time(NULL), 0, CFEXPIREINTERVAL, &cfsched_doexpire, NULL);
     schedulerecurring(time(NULL), 0, CFAUTOSAVEINTERVAL, &cfsched_dosave, NULL);
 
-    registercontrolcmd("cfdebug", 10, 1, &cfcmd_debug);
-    registercontrolcmd("cfhistogram", 10, 1, &cfcmd_debughistogram);
+    registercontrolhelpcmd("cfdebug", NO_DEVELOPER, 1, &cfcmd_debug, "Display Debug Information on chanfix data for channel");
+    registercontrolhelpcmd("cfhistogram", NO_DEVELOPER, 1, &cfcmd_debughistogram, "Display Debug Histogram of chanfix data for channel");
 #if CFDEBUG
-    registercontrolcmd("cfsample", 10, 1, &cfcmd_debugsample);
-    registercontrolcmd("cfexpire", 10, 1, &cfcmd_debugexpire);
+    registercontrolhelpcmd("cfsample", NO_DEVELOPER, &cfcmd_debugsample, "DEBUG Command - must not be loaded on live instances");
+    registercontrolhelpcmd("cfexpire", NO_DEVELOPER, 1, &cfcmd_debugexpire, "DEBUG Command - must not be loaded on live instances");
 #endif
-    registercontrolcmd("chanopstat", 10, 1, &cfcmd_chanopstat);
-    registercontrolcmd("chanoplist", 10, 1, &cfcmd_chanoplist);
+    registercontrolhelpcmd("chanopstat", NO_OPER, 1, &cfcmd_chanopstat, "Shows chanop statistics for a given channel");
+    registercontrolhelpcmd("chanoplist", NO_OPER, 1, &cfcmd_chanoplist, "Shows lists of known chanops, including scores");
 
-    registercontrolcmd("chanfix", 10, 1, &cfcmd_chanfix);
-    registercontrolcmd("showregs", 10, 1, &cfcmd_showregs);
+    registercontrolhelpcmd("chanfix", NO_OPER, 1, &cfcmd_chanfix, "Perform a chanfix on a channel to op known users only");
+    registercontrolhelpcmd("showregs", NO_OPER, 1, &cfcmd_showregs, "Show regular ops known on a channel (including services)");
 #if CFDEBUG
     /* should we disable this in the 'final' build? */
-//    registercontrolcmd("requestop", 0, 2, &cfcmd_requestop);
+    /* registercontrolcmd("requestop", 0, 2, &cfcmd_requestop); */
 #endif
-    registercontrolcmd("cfsave", 10, 0, &cfcmd_save);
-    registercontrolcmd("cfload", 10, 0, &cfcmd_load);
+    registercontrolhelpcmd("cfsave", NO_DEVELOPER, 0, &cfcmd_save, "Force save of chanfix data");
+    registercontrolhelpcmd("cfload", NO_DEVELOPER, 0, &cfcmd_load, "Force load of chanfix data");
 
 #if CFAUTOFIX
     registerhook(HOOK_CHANNEL_DEOPPED, &cfhook_autofix);
index fb4a80d1382af3f45f3722b21e7a422d3801494f..6f072878e68a856ec8c1778c4949b3a1d6ce3b08 100644 (file)
@@ -43,6 +43,8 @@ void dohist_today(int *data, float *bounds, int cats);
 void dohist_days(int *data, float *bounds, int cats, int days);
 void dohist_namelen(int *data, float *bounds, int cats);
 
+#define EXPIREMIN 4
+
 void _init() {
   time_t now,when;
 
@@ -78,10 +80,10 @@ void _init() {
     }
     
     lastsave=now;
-    registercontrolcmd("chanstats",10,1,&dochanstats);
-    registercontrolcmd("channelhistogram",10,13,&dochanhistogram);
-    registercontrolcmd("userhistogram",10,1,&douserhistogram);
-    registercontrolcmd("expirecheck",10,1,&doexpirecheck);
+    registercontrolhelpcmd("chanstats",NO_OPER,1,&dochanstats, "Show usage statistics for a channel");
+    registercontrolhelpcmd("channelhistogram",NO_OPER,13,&dochanhistogram, "Display a histogram of network channel sizes");
+    registercontrolhelpcmd("userhistogram",NO_OPER,1,&douserhistogram, "Display a user histogram of channel size");
+    registercontrolhelpcmd("expirecheck",NO_DEVELOPER,1,&doexpirecheck, "Check if channel has too few users for services");
     registercontrolhelpcmd("chanstatssave",NO_DEVELOPER,1, &dochanstatssave, "Usage: chanstatssave\nForce a save of chanstats data");
     schedulerecurring(when,0,SAMPLEINTERVAL,&doupdate,NULL);  
   }
@@ -425,8 +427,6 @@ int dochanstats(void *source, int cargc, char **cargv) {
   return CMD_OK;
 }
 
-#define EXPIREMIN 4
-
 int doexpirecheck(void *source, int cargc, char **cargv) {
   nick *sender=(nick *)source;
   chanindex *cip;
@@ -454,12 +454,14 @@ int doexpirecheck(void *source, int cargc, char **cargv) {
  
   /* Did they hit the minimum today? */
   if (csp->todaymax >= EXPIREMIN) {
+    controlreply(sender,"OK %s",cargv[0]);
     return CMD_OK;
   }
   
   /* Or recently? */
   for (i=0;i<HISTORYDAYS;i++) {
     if (csp->lastmax[i] >= EXPIREMIN) {
+      controlreply(sender,"OK %s",cargv[0]);
       return CMD_OK;
     }
   }
index a315dc3f545324cc1f852c51daa298477395ba94..c5bed78f55e3f55cc5076e01cdb518eb32dc5904 100644 (file)
@@ -21,8 +21,22 @@ int nc_cmd_nodecount(void *source, int cargc, char **cargv);
 void _init() {
   if (!(dumpip_logfp = fopen("log/iplist", "w")))
     Error("dumpip", ERR_ERROR, "Failed to open log file!");
-  registercontrolcmd("dumptree", 10, 2, &nc_cmd_dumptree);
-  registercontrolcmd("nodecount", 10, 1, &nc_cmd_nodecount);
+  registercontrolhelpcmd("dumptree", NO_DEVELOPER, 2, &nc_cmd_dumptree, 
+                                  "Dumps diaganostic information on the patricia trie structure\n"
+                                  "Usage: dumptree <ipv4|ipv6|cidr4|cidr6> [int]\n" 
+                                  "Nodes with prefixies Only:\n"
+                                  "No arguments - default prints: ptr, ip\n"
+                                  "1: ptr, prefixptr, bitlen, refcount, ip\n"
+                                  "2: ptr, bit, usercount, ip\n"
+                                  "3: ptr, leftptr, rightptr, parentptr\n"
+                                  "4: ptr, ext0, ext1, ext2, ext3, ext4\n"
+                                  "All Notes (inc no prefixies):\n"
+                                  "10: ptr, prefixptr, ip\n"
+                                  "11: ptr, prefixbitlen, refcount,ip\n"
+                                  "12: ptr, bitlen, usercount, ip\n"
+                                  "13: ptr, leftptr, rightptr, parentptr\n"
+                                  "14: ptr, ext0, ext1, ext2, ext3, ext4");
+  registercontrolhelpcmd("nodecount", NO_OPER, 1, &nc_cmd_nodecount, "Displays number of users on a given ipv4/6 or cidr4/6");
 }
 
 void _fini() {