diff --git a/Changes b/Changes index 3f4047485..6d592cb26 100644 --- a/Changes +++ b/Changes @@ -859,3 +859,6 @@ seen. gmtime warning still there - Made makeconf load scan_http.so - Fixed a /who bug, found by IXpfah - Updated makefile.win32 for all the new modules +- Added in Fish's patches +- Added bitching when you lack needed IRC commands +- Removed REMGLINE diff --git a/include/h.h b/include/h.h index 65157b3eb..a98d18f19 100644 --- a/include/h.h +++ b/include/h.h @@ -142,6 +142,7 @@ extern int R_do_dns, R_fin_dns, R_fin_dnsc, R_fail_dns, #endif extern inline aCommand *find_Command(char *cmd, short token, int flags); +extern aCommand *find_Command_simple(char *cmd); extern aChannel *find_channel(char *, aChannel *); extern Member *find_member_link(Member *, aClient *); extern void remove_user_from_channel(aClient *, aChannel *); diff --git a/src/modules/Makefile.in b/src/modules/Makefile.in index ac2653d3a..1f9486578 100644 --- a/src/modules/Makefile.in +++ b/src/modules/Makefile.in @@ -30,7 +30,7 @@ R_MODULES=m_sethost.so m_chghost.so m_chgident.so m_setname.so \ m_away.so m_svsnoop.so m_svso.so m_svsnick.so \ m_adminchat.so m_akill.so m_chgname.so m_guest.so m_htm.so m_kill.so \ m_kline.so m_lag.so m_message.so m_nachat.so m_oper.so m_pingpong.so \ - m_quit.so m_rakill.so m_remgline.so m_rping.so m_sendumode.so m_sqline.so \ + m_quit.so m_rakill.so m_rping.so m_sendumode.so m_sqline.so \ m_techat.so m_tsctl.so m_unkline.so m_unsqline.so m_unzline.so m_whois.so \ m_zline.so \ scan.so scan_socks.so scan_http.so web/httpd.so @@ -40,7 +40,7 @@ COMMANDS=m_sethost.c m_chghost.c m_chgident.c m_setname.c m_setident.c \ m_who.c m_mkpasswd.c m_away.c m_svsnoop.c m_svso.c m_svsnick.c \ m_adminchat.c m_akill.c m_chgname.c m_guest.c m_htm.c m_kill.c \ m_kline.c m_lag.c m_message.c m_nachat.c m_oper.c m_pingpong.c \ - m_quit.c m_rakill.c m_remgline.c m_rping.c m_sendumode.c m_sqline.c \ + m_quit.c m_rakill.c m_rping.c m_sendumode.c m_sqline.c \ m_techat.c m_tsctl.c m_unkline.c m_unsqline.c m_unzline.c m_whois.c \ m_zline.c @@ -112,10 +112,6 @@ m_rakill.so: m_rakill.c $(INCLUDES) $(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \ -o m_rakill.so m_rakill.c -m_remgline.so: m_remgline.c $(INCLUDES) - $(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \ - -o m_remgline.so m_remgline.c - m_rping.so: m_rping.c $(INCLUDES) $(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \ -o m_rping.so m_rping.c diff --git a/src/modules/m_remgline.c b/src/modules/m_remgline.c deleted file mode 100644 index 152716bad..000000000 --- a/src/modules/m_remgline.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Module skeleton, by Carsten V. Munk 2001 - * May be used, modified, or changed by anyone, no license applies. - * You may relicense this, to any license - */ -#include "config.h" -#include "struct.h" -#include "common.h" -#include "sys.h" -#include "numeric.h" -#include "msg.h" -#include "channel.h" -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif -#include -#include "h.h" -#ifdef STRIPBADWORDS -#include "badwords.h" -#endif -#ifdef _WIN32 -#include "version.h" -#endif - -DLLFUNC int m_remgline(aClient *cptr, aClient *sptr, int parc, char *parv[]); - -/* Place includes here */ -#define MSG_REMGLINE "REMGLINE" /* remove g-line */ -#define TOK_REMGLINE "BG" - -#ifndef DYNAMIC_LINKING -ModuleInfo m_remgline_info -#else -#define m_remgline_info mod_header -ModuleInfo mod_header -#endif - = { - 2, - "remgline", /* Name of module */ - "$Id$", /* Version */ - "command /remgline", /* Short description of module */ - NULL, /* Pointer to our dlopen() return value */ - NULL - }; - - -/* The purpose of these ifdefs, are that we can "static" link the ircd if we - * want to -*/ - -/* This is called on module init, before Server Ready */ -#ifdef DYNAMIC_LINKING -DLLFUNC int mod_init(int module_load) -#else -int m_remgline_init(int module_load) -#endif -{ - /* - * We call our add_Command crap here - */ - add_Command(MSG_REMGLINE, TOK_REMGLINE, m_remgline, MAXPARA); -} - -/* Is first run when server is 100% ready */ -#ifdef DYNAMIC_LINKING -DLLFUNC int mod_load(int module_load) -#else -int m_remgline_load(int module_load) -#endif -{ -} - - -/* Called when module is unloaded */ -#ifdef DYNAMIC_LINKING -DLLFUNC void mod_unload(void) -#else -void m_remgline_unload(void) -#endif -{ - if (del_Command(MSG_REMGLINE, TOK_REMGLINE, m_remgline) < 0) - { - sendto_realops("Failed to delete commands when unloading %s", - m_remgline_info.name); - } -} - - -DLLFUNC int m_remgline(aClient *cptr, aClient *sptr, int parc, char *parv[]) -{ - if (!IsOper(sptr)) - return 0; - - sendto_one(sptr, - ":%s %s %s :*** Please use /gline -mask instead of /Remgline", - me.name, IsWebTV(sptr) ? "PRIVMSG" : "NOTICE", sptr->name); -} diff --git a/src/packet.c b/src/packet.c index f673e2ac0..ac32806c4 100644 --- a/src/packet.c +++ b/src/packet.c @@ -355,3 +355,16 @@ inline aCommand *find_Command(char *cmd, short token, int flags) } return NULL; } + + +aCommand *find_Command_simple(char *cmd) +{ + aCommand *p; + + for (p = CommandHash[toupper(*cmd)]; p; p = p->next) { + if (!stricmp(p->cmd, cmd)) + return (p); + } + return NULL; + +} diff --git a/src/s_conf.c b/src/s_conf.c index 463bc3203..ecd65e184 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -3433,6 +3433,11 @@ void validate_configuration(void) add_CommandX("StatServ", NULL, m_alias, 1, M_USER|M_ALIAS); Warning("No alias{}'s found, using default of NickServ, ChanServ, MemoServ, OperServ, HelpServ, StatServ"); } + if (!find_Command_simple("AWAY") || !find_Command_simple("KILL") || + !find_Command_simple("OPER") || !find_Command_simple("PING")) + { + Error("Someone forgot to load modules with proper commands in them. Read the documentation"); + } #ifdef _WIN32 if (config_error_flag) win_log("Errors in configuration, terminating program.");