#include "module.h" #define AUTHOR "SGR" #define VERSION "1.00" /* ----------------------------------------------------------- * Name : ircd_disablehostserv * Author: SGR * Date : 20/03/2004 * ----------------------------------------------------------- * Functions: deny_hostserv, hostserv_offline_notices * no_hs_privmsg * Limitations: None Known. * Tested: Unreal(3.2), Ultimate [all], Viagra. * ----------------------------------------------------------- * This version has been only tested on about 4 ircds. Use on * your own risk. etc.. * * This modules has 12 configurable options, please read * The comments * * Netstat - give me some fucking credit instead od stealing * my work next time. Not to mention, you didn't even do it * proprly -- like WTF has memoservAlias got to do with * this? - there is memoserv references all over the fucking * place - at lesast have the fucking decency to do it * properly. * Next time you *RIP* another users work, add some credit * and do it properly you jerk. Yes, ive drank yoo much, but * on behalf of all that is good and true - . * FUCK OFF YOU RIPPING WANKER. EVERYONE remember * netstat is a twat. * * ----------------------------------------------------------- */ /* ---------------------------------------------------------------------- */ /* START OF CONFIGURATION BLOCK - please read the comments :) */ /* ---------------------------------------------------------------------- */ #define NoHostServHere1 "HostServ is not available on this network." #define NoHostServHere2 "To get a vHost ask an available IRC Operator" //#define NoHostServHere5 "if someone is persistantly harassing you, flooding or" //#define NoHostServHere6 "making obsene remarks, please do make use of this service." //#define NoHostServHere7 "Help text7" //#define NoHostServHere8 "Help Text8" //#define NoHostServHere9 "Help Text9" //#define NoHostServHere10 "Help Text10" // Set this to 1 to FULLY Disable HostServ // Set this to 2 to restrict HostServ to Opers only // Set this to 3 to restrict HostServ to ServicesAdmins only #define DisableType 2 // Set this to 1 to respond with NoHostServHereX notices. // Set this to 2 to respond with the default "service offline" message // Set this to 3 to not respond at all. #define ResponseType 1 /* ---------------------------------------------------------------------- */ /* DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING */ /* ---------------------------------------------------------------------- */ int deny_hostserv(User *u); void hostserv_offline_notices(User *u); int no_hs_privmsg(char *source, int ac, char **av); int AnopeInit(int argc, char **argv) { Message *msg = NULL; int status; msg = createMessage("NOTICE", no_hs_privmsg); status = moduleAddMessage(msg, MOD_HEAD); msg = createMessage("PRIVMSG", no_hs_privmsg); status = moduleAddMessage(msg, MOD_HEAD); moduleAddAuthor(AUTHOR); moduleAddVersion(VERSION); alog("[ircd_disablehostserv] This module has loaded and is now active."); return MOD_CONT; } int no_hs_privmsg(char *source, int ac, char **msg) { User *u; char *s; if (ac != 2) { return MOD_CONT; } if (!(u = finduser(source))) { return MOD_CONT; } if (*msg[0] == '#') { return MOD_CONT; } s = strchr(msg[0], '@'); if (s) { *s++ = 0; if (stricmp(s, ServerName) != 0) { return MOD_CONT; } } if (msg[0] != NULL) { if (stricmp(msg[0],s_HostServ)==0) { if (deny_hostserv(u)) { return MOD_STOP; } } else if (s_HostServAlias) { if (stricmp(msg[0], s_HostServAlias)==0) { if (deny_hostserv(u)) { return MOD_STOP; } } } else { return MOD_CONT; } } return MOD_CONT; } /*****************************************************************************/ int deny_hostserv(User * u) { if ((DisableType == 2) && is_oper(u)) { return 0; } if ((DisableType >= 2) && is_services_admin(u)) { return 0; } if (ResponseType == 1) { hostserv_offline_notices(u); return 1; } if (ResponseType==2) { notice_lang(s_HostServ, u, SERVICE_OFFLINE, s_HostServ); return 1; } if (ResponseType==3) { return 1; } return 0; } void hostserv_offline_notices(User *u) { #ifdef NoHostServHere1 notice(s_HostServ, u->nick, "-----------------------------------------------------------------------"); notice(s_HostServ, u->nick, NoHostServHere1); #endif #ifdef NoHostServHere2 notice(s_HostServ, u->nick, NoHostServHere2); #endif #ifdef NoHostServHere3 notice(s_HostServ, u->nick, NoHostServHere3); #endif #ifdef NoHostServHere4 notice(s_HostServ, u->nick, NoHostServHere4); #endif #ifdef NoHostServHere5 notice(s_HostServ, u->nick, NoHostServHere5); #endif #ifdef NoHostServHere6 notice(s_HostServ, u->nick, NoHostServHere6); #endif #ifdef NoHostServHere7 notice(s_HostServ, u->nick, NoHostServHere7); #endif #ifdef NoHostServHere8 notice(s_HostServ, u->nick, NoHostServHere8); #endif #ifdef NoHostServHere9 notice(s_HostServ, u->nick, NoHostServHere9); #endif #ifdef NoHostServHere10 notice(s_HostServ, u->nick, NoHostServHere10); #endif notice(s_HostServ, u->nick, "-----------------------------------------------------------------------"); return; }