X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/ae79842dd6d3f3ef6570cfacf2a047d77df2682f..21b22dceca9d89abfa607419c4289b9eacf84a2f:/usercount/usercount.c diff --git a/usercount/usercount.c b/usercount/usercount.c index f032b0fc..02cecb6a 100644 --- a/usercount/usercount.c +++ b/usercount/usercount.c @@ -1,7 +1,12 @@ +#include + #include "../nick/nick.h" #include "../core/hooks.h" +#include "../lib/version.h" #include "usercount.h" +MODULE_VERSION("") + int servercount[MAXSERVERS]; static void uc_newserver(int hook, void *arg); @@ -9,6 +14,15 @@ static void uc_newnick(int hook, void *arg); static void uc_lostnick(int hook, void *arg); void _init(void) { + nick *np; + int i; + + memset(servercount, 0, sizeof(servercount)); + + for(i=0;inext) + servercount[homeserver(np->numeric)]++; + registerhook(HOOK_SERVER_NEWSERVER, uc_newserver); registerhook(HOOK_NICK_NEWNICK, uc_newnick); registerhook(HOOK_NICK_LOSTNICK, uc_lostnick);