#include "module.h" #define AUTHOR "DrStein" #define MYNAME "bs_disablefantasy" #define VERSION "1.0.0" /* -------------------------------------------- * MODULE AUTHOR AND RELEASE DATE * -------------------------------------------- * Name: bs_disablefantasy * Author: DrStein * Date: 10-26-2004 * * -------------------------------------------- * MODULE DESCRIPTION * -------------------------------------------- * This module will disable all the fantasy * commands for all the channels. * * -------------------------------------------- * COMMANDS LIST * -------------------------------------------- * * -------------------------------------------- * MODULE SUPPORT * -------------------------------------------- * IRCd: Tested on Unreal 3.2.1, but supports * all IRCds which Anope support. * Anope version: Tested on 1.7.6 (SVN), but * should support all versions. * * -------------------------------------------- * CHANGELOG * -------------------------------------------- * v1.0.0 - Initial release. * * -------------------------------------------- * GRATEFULNESS * -------------------------------------------- * * -------------------------------------------- * RELEASE NOTES * -------------------------------------------- * Dunno why I made this module. Perhaps I'm * too bored. Anyway, DeMiNe0 requested it. * * Enjoy bs_disablefantasy * * -------------------------------------------- * START OF CONFIGURATION BLOCK - please read * the comments. * -------------------------------------------- */ /* --------------------------------------------- * Please don't edit anything below here. * --------------------------------------------- */ /* Function for get the channel messages */ int msg_handler(char *source, int ac, char **av); /* Global var to contain the module buffer */ char *mod_current_buffer = NULL; /* Global var to contain the PRIVMSG */ char *text = NULL; int AnopeInit(void) { Command *c; Message *msg = NULL; int status = 0; #ifdef IRC_UNREAL32 msg = createMessage("PRIVMSG", msg_handler); if (UseTokens) { msg = createMessage("!", msg_handler); } #else msg = createMessage("PRIVMSG", msg_handler); #endif status += moduleAddMessage(msg, MOD_HEAD); if (status == 0) { alog("[%s.so] Loaded successfully", MYNAME); } else { alog("[%s.so] FAILED to load - result %d", MYNAME, status); return MOD_STOP; } moduleAddAuthor(AUTHOR); moduleAddVersion(VERSION); return MOD_CONT; } void AnopeFini(void) { alog("[%s.so] module unloaded", MYNAME); } int msg_handler(char *source, int ac, char **av) { User *u; ChannelInfo *ci; if (ac != 2) return MOD_CONT; if (!(u = finduser(source))) return MOD_CONT; if (*av[0] == '#') { if (s_BotServ && (ci = cs_findchan(av[0]))) if (!(ci->flags & CI_VERBOTEN) && ci->c && ci->bi) if (mod_current_buffer) { text = mod_current_buffer; if (text[0] == '!') { return MOD_STOP; } else return MOD_CONT; } } return MOD_CONT; }