X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/27ce0548659b866469bb01b639aab0682a4ea667..1151d736b86e4405ed9e0266dc5227a2ab9a5d66:/chanfix/chanfix.c diff --git a/chanfix/chanfix.c b/chanfix/chanfix.c index e85ffce4..79cace45 100644 --- a/chanfix/chanfix.c +++ b/chanfix/chanfix.c @@ -20,7 +20,7 @@ extern nick *mynick; int cfext; int cfnext; -int failedinit; +int cffailedinit; /* user accessible commands */ int cfcmd_debug(void *source, int cargc, char **cargv); @@ -63,29 +63,29 @@ void _init() { if (cfext < 0 || cfnext < 0) { Error("chanfix", ERR_ERROR, "Couldn't register channel and/or nick extension"); - failedinit = 1; + cffailedinit = 1; } else { schedulerecurring(time(NULL), 0, CFSAMPLEINTERVAL, &cfsched_dosample, NULL); 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); @@ -100,7 +100,7 @@ void _init() { cf_loadchanfix(); - failedinit = 0; + cffailedinit = 0; } } @@ -108,7 +108,7 @@ void _fini() { int i; nick *nip; - if (failedinit == 0) { + if (cffailedinit == 0) { deleteschedule(NULL, &cfsched_dosample, NULL); deleteschedule(NULL, &cfsched_doexpire, NULL); deleteschedule(NULL, &cfsched_dosave, NULL); @@ -925,7 +925,7 @@ void cfhook_statsreport(int hook, void *arg) { nick *nip; chanfix *cf; - if ((int)arg > 2) { + if ((long)arg > 2) { memory = rc = mc = 0; for (i=0; i