diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 17:47:52 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 17:47:52 +0000 |
commit | ba47bf2f6f2fe04e50ca63b26f14ba1e524bee72 (patch) | |
tree | a00ce3d3e30bc4a7d96a0b174169cdd676af0135 | |
parent | 330d9ee9e782a4ed3e2de8ff3082cc5bbe7d6b9e (diff) |
HelpServ has been destroyed, +1000 points. Also fixed the argument order in the deprecated match_wild() function.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2074 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | data/example.conf | 25 | ||||
-rw-r--r-- | include/extern.h | 9 | ||||
-rw-r--r-- | include/modules.h | 10 | ||||
-rw-r--r-- | src/Makefile | 3 | ||||
-rw-r--r-- | src/config.c | 13 | ||||
-rw-r--r-- | src/core/he_help.c | 55 | ||||
-rw-r--r-- | src/core/os_modinfo.c | 1 | ||||
-rw-r--r-- | src/helpserv.c | 69 | ||||
-rw-r--r-- | src/init.c | 3 | ||||
-rw-r--r-- | src/messages.c | 4 | ||||
-rw-r--r-- | src/misc.c | 4 | ||||
-rw-r--r-- | src/module.cpp | 9 | ||||
-rw-r--r-- | src/modules.c | 14 |
13 files changed, 3 insertions, 216 deletions
diff --git a/data/example.conf b/data/example.conf index 57978509d..2e955200c 100644 --- a/data/example.conf +++ b/data/example.conf @@ -1087,31 +1087,6 @@ hostserv } /* - * [REQUIRED] HelpServ Config - * - * This section is used to set up the Help Service pseudo-client. All directives are required. - */ -helpserv -{ - /* - * The nickname of the HelpServ client. - */ - nick = "HelpServ" - - /* - * The description of the HelpServ client, which will be used as the GECOS (real - * name) of the client. - */ - description = "Help Service" - - /* - * The core modules to load for HelpServ. This is a space separated list that corresponds - * to the base names of the modules for HelpServ. This directive is optional, but highly recommended. - */ - modules = "he_help" -} - -/* * [REQUIRED] OperServ Config * * This section is used to set up the Operator Service pseudo-client. Unless specified otherwise, diff --git a/include/extern.h b/include/extern.h index 9942d8271..43adbf644 100644 --- a/include/extern.h +++ b/include/extern.h @@ -237,14 +237,12 @@ E char *s_NickServ; E char *s_ChanServ; E char *s_MemoServ; E char *s_BotServ; -E char *s_HelpServ; E char *s_OperServ; E char *s_GlobalNoticer; E char *desc_NickServ; E char *desc_ChanServ; E char *desc_MemoServ; E char *desc_BotServ; -E char *desc_HelpServ; E char *desc_OperServ; E char *desc_GlobalNoticer; @@ -401,9 +399,6 @@ E int ModulesDelayedNumber; E char **HostServCoreModules; E int HostServCoreNumber; -E char **HelpServCoreModules; -E int HelpServCoreNumber; - E char **MemoServCoreModules; E int MemoServCoreNumber; @@ -469,10 +464,6 @@ E void encmodule_encrypt_check_len(int (*func)(int passlen, int bufsize)); E void encmodule_decrypt(int (*func)(const char *src, char *dest, int size)); E void encmodule_check_password(int (*func)(const char *plaintext, const char *password)); -/**** helpserv.c ****/ -E void helpserv(User * u, char *buf); -E void helpserv_init(); - /**** hostserv.c ****/ E void get_hostserv_stats(long *nrec, long *memuse); E void hostserv_init(); diff --git a/include/modules.h b/include/modules.h index aa1d6c6c6..0e2ba9c7c 100644 --- a/include/modules.h +++ b/include/modules.h @@ -58,7 +58,6 @@ enum CommandReturn #define MEMOSERV MS_cmdTable #define NICKSERV NS_cmdTable #define CHANSERV CS_cmdTable -#define HELPSERV HE_cmdTable #define OPERSERV OS_cmdTable #define IRCD IRCD_cmdTable #define MODULE_HASH Module_table @@ -135,7 +134,6 @@ extern MDE CommandHash *BOTSERV[MAX_CMD_HASH]; extern MDE CommandHash *MEMOSERV[MAX_CMD_HASH]; extern MDE CommandHash *NICKSERV[MAX_CMD_HASH]; extern MDE CommandHash *CHANSERV[MAX_CMD_HASH]; -extern MDE CommandHash *HELPSERV[MAX_CMD_HASH]; extern MDE CommandHash *OPERSERV[MAX_CMD_HASH]; extern MDE MessageHash *IRCD[MAX_CMD_HASH]; extern MDE ModuleHash *MODULE_HASH[MAX_CMD_HASH]; @@ -248,7 +246,6 @@ class CoreExport Module void (*botHelp)(User *u); /* 4 */ void (*operHelp)(User *u); /* 5 */ void (*hostHelp)(User *u); /* 6 */ - void (*helpHelp)(User *u); /* 7 */ MessageHash *msgList[MAX_CMD_HASH]; ModuleLang lang[NUM_LANGS]; @@ -334,13 +331,6 @@ class CoreExport Module void SetHostHelp(void (*func)(User *)); /** - * Add output to helpserv help. - * when doing a /msg helpserv help, your function will be called to allow it to send out a notice() with the code you wish to dispaly - * @param func a pointer to the function which will display the code - **/ - void SetHelpHelp(void (*func)(User *)); - - /** * Allow a module to add a set of language strings to anope * @param langNumber the language number for the strings * @param ac The language count for the strings diff --git a/src/Makefile b/src/Makefile index 8e41b92ee..179268fb3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ OBJS = actions.o base64.o bots.o botserv.o channels.o chanserv.o command.o commands.o compat.o \ - config.o datafiles.o encrypt.o events.o hashcomp.o helpserv.o hostserv.o init.o ircd.o language.o log.o mail.o main.o \ + config.o datafiles.o encrypt.o events.o hashcomp.o hostserv.o init.o ircd.o language.o log.o mail.o main.o \ memory.o memoserv.o messages.o misc.o modules.o news.o nickserv.o operserv.o \ process.o protocol.o send.o servers.o sessions.o slist.o sockutil.o opertype.o timeout.o users.o module.o modulemanager.o configreader.o \ wildcard.o nickcore.o @@ -49,7 +49,6 @@ encrypt.o: encrypt.c $(INCLUDES) events.o: events.c $(INCLUDES) init.o: init.c $(INCLUDES) ircd.o: ircd.c $(INCLUDES) -helpserv.o: helpserv.c $(INCLUDES) hostserv.o: hostserv.c $(INCLUDES) language.o: language.c $(INCLUDES) log.o: log.c $(INCLUDES) diff --git a/src/config.c b/src/config.c index bd2168f1a..7834a81cd 100644 --- a/src/config.c +++ b/src/config.c @@ -44,14 +44,12 @@ char *s_NickServ; char *s_ChanServ; char *s_MemoServ; char *s_BotServ; -char *s_HelpServ; char *s_OperServ; char *s_GlobalNoticer; char *desc_NickServ; char *desc_ChanServ; char *desc_MemoServ; char *desc_BotServ; -char *desc_HelpServ; char *desc_OperServ; char *desc_GlobalNoticer; @@ -226,10 +224,6 @@ static char *MemoCoreModules; char **MemoServCoreModules; int MemoServCoreNumber; -static char *HelpCoreModules; -char **HelpServCoreModules; -int HelpServCoreNumber; - static char *BotCoreModules; char **BotServCoreModules; int BotServCoreNumber; @@ -735,7 +729,7 @@ int ServerConfig::Read(bool bail) { errstr.clear(); // These tags MUST occur and must ONLY occur once in the config file - static const char *Once[] = {"serverinfo", "networkinfo", "options", "nickserv", "chanserv", "memoserv", "helpserv", "operserv", NULL}; + static const char *Once[] = {"serverinfo", "networkinfo", "options", "nickserv", "chanserv", "memoserv", "operserv", NULL}; // These tags can occur ONCE or not at all InitialConfig Values[] = { /* The following comments are from CyberBotX to w00t as examples to use: @@ -905,9 +899,6 @@ int ServerConfig::Read(bool bail) {"hostserv", "database", "hosts.db", new ValueContainerChar(&HostDBName), DT_CHARPTR, ValidateHostServ}, {"hostserv", "modules", "", new ValueContainerChar(&HostCoreModules), DT_CHARPTR, NoValidation}, {"hostserv", "hostsetters", "", new ValueContainerChar(&HostSetter), DT_CHARPTR, NoValidation}, - {"helpserv", "nick", "HelpServ", new ValueContainerChar(&s_HelpServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, - {"helpserv", "description", "Help Service", new ValueContainerChar(&desc_HelpServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, - {"helpserv", "modules", "", new ValueContainerChar(&HelpCoreModules), DT_CHARPTR, NoValidation}, {"operserv", "nick", "OperServ", new ValueContainerChar(&s_OperServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, {"operserv", "description", "Operator Service", new ValueContainerChar(&desc_OperServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, {"operserv", "globalnick", "Global", new ValueContainerChar(&s_GlobalNoticer), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, @@ -1801,8 +1792,6 @@ int read_config(int reload) buildStringList(HostCoreModules ? HostCoreModules : "", &HostServCoreNumber); MemoServCoreModules = buildStringList(MemoCoreModules ? MemoCoreModules : "", &MemoServCoreNumber); - HelpServCoreModules = - buildStringList(HelpCoreModules ? HelpCoreModules : "", &HelpServCoreNumber); BotServCoreModules = buildStringList(BotCoreModules ? BotCoreModules : "", &BotServCoreNumber); diff --git a/src/core/he_help.c b/src/core/he_help.c deleted file mode 100644 index 7227669cf..000000000 --- a/src/core/he_help.c +++ /dev/null @@ -1,55 +0,0 @@ -/* HelpServ core functions - * - * (C) 2003-2009 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * - * $Id$ - * - */ -/*************************************************************************/ - -#include "module.h" - -class CommandHEHelp : public Command -{ - public: - CommandHEHelp() : Command("HELP", 1, 1) - { - } - - CommandReturn Execute(User *u, std::vector<std::string> ¶ms) - { - mod_help_cmd(s_HelpServ, u, HELPSERV, params.size() > 0 ? params[0].c_str() : NULL); - return MOD_CONT; - } - - void OnSyntaxError(User *u) - { - notice_help(s_HelpServ, u, HELP_HELP, s_NickServ, s_ChanServ, s_MemoServ); - if (s_BotServ) - notice_help(s_HelpServ, u, HELP_HELP_BOT, s_BotServ); - if (s_HostServ) - notice_help(s_HelpServ, u, HELP_HELP_HOST, s_HostServ); - moduleDisplayHelp(7, u); - } -}; - -class HEHelp : public Module -{ - public: - HEHelp(const std::string &modname, const std::string &creator) : Module(modname, creator) - { - this->SetAuthor("Anope"); - this->SetVersion("$Id$"); - this->SetType(CORE); - - this->AddCommand(HELPSERV, new CommandHEHelp(), MOD_UNIQUE); - } -}; - -MODULE_INIT("he_help", HEHelp) diff --git a/src/core/os_modinfo.c b/src/core/os_modinfo.c index a1a0694e6..e96de987c 100644 --- a/src/core/os_modinfo.c +++ b/src/core/os_modinfo.c @@ -47,7 +47,6 @@ class CommandOSModInfo : public Command showModuleCmdLoaded(CHANSERV[idx], m->name.c_str(), u); showModuleCmdLoaded(BOTSERV[idx], m->name.c_str(), u); showModuleCmdLoaded(MEMOSERV[idx], m->name.c_str(), u); - showModuleCmdLoaded(HELPSERV[idx], m->name.c_str(), u); } } else diff --git a/src/helpserv.c b/src/helpserv.c deleted file mode 100644 index d26e69603..000000000 --- a/src/helpserv.c +++ /dev/null @@ -1,69 +0,0 @@ -/* HelpServ functions - * - * (C) 2003-2009 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * - * $Id$ - * - */ - -/*************************************************************************/ -#include "services.h" -#include "pseudo.h" - -void moduleAddHelpServCmds(); - -/*************************************************************************/ - -/** - * Setup the commands for HelpServ - * @return void - */ -void moduleAddHelpServCmds() -{ - ModuleManager::LoadModuleList(HelpServCoreNumber, HelpServCoreModules); -} - -/*************************************************************************/ - -/** - * HelpServ initialization. - * @return void - */ -void helpserv_init() -{ - moduleAddHelpServCmds(); -} - -/*************************************************************************/ - -/** - * Main HelpServ routine. - * @param u User Struct of the user sending the PRIVMSG - * @param buf Buffer containing the PRIVMSG data - * @return void - */ -void helpserv(User * u, char *buf) -{ - const char *cmd, *s; - - cmd = strtok(buf, " "); - - if (!cmd) { - return; - } else if (stricmp(cmd, "\1PING") == 0) { - if (!(s = strtok(NULL, ""))) { - s = ""; - } - ircdproto->SendCTCP(findbot(s_HelpServ), u->nick, "PING %s", s); - } else { - mod_run_cmd(s_HelpServ, u, HELPSERV, cmd); - } -} - -/*************************************************************************/ diff --git a/src/init.c b/src/init.c index a70f883ee..79633d0ec 100644 --- a/src/init.c +++ b/src/init.c @@ -494,7 +494,6 @@ int init_secondary(int ac, char **av) bs_init(); os_init(); hostserv_init(); - helpserv_init(); /* load any custom modules */ ModuleManager::LoadModuleList(ModulesNumber, ModulesAutoload); @@ -596,8 +595,6 @@ int init_secondary(int ac, char **av) bi = new BotInfo(s_MemoServ, ServiceUser, ServiceHost, desc_MemoServ); if (s_BotServ) bi = new BotInfo(s_BotServ, ServiceUser, ServiceHost, desc_BotServ); - if (s_HelpServ) - bi = new BotInfo(s_HelpServ, ServiceUser, ServiceHost, desc_HelpServ); if (s_GlobalNoticer) bi = new BotInfo(s_GlobalNoticer, ServiceUser, ServiceHost, desc_GlobalNoticer); } diff --git a/src/messages.c b/src/messages.c index 83f1dd338..45ff4cbd3 100644 --- a/src/messages.c +++ b/src/messages.c @@ -185,8 +185,6 @@ int m_privmsg(const char *source, const char *receiver, const char *msg) memoserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX } else if (s_HostServ && !stricmp(receiver, s_HostServ)) { hostserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX - } else if (s_HelpServ && !stricmp(receiver, s_HelpServ)) { - helpserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX } else if (s_BotServ && !stricmp(receiver, s_BotServ)) { botserv(u, const_cast<char *>(msg)); // XXX Unsafe cast, this needs reviewing -- CyberBotX } else if (s_BotServ && (bi = findbot(receiver))) { @@ -293,8 +291,6 @@ int m_whois(const char *source, const char *who) clientdesc = desc_BotServ; else if (s_HostServ && stricmp(who, s_HostServ) == 0) clientdesc = desc_HostServ; - else if (stricmp(who, s_HelpServ) == 0) - clientdesc = desc_HelpServ; else if (stricmp(who, s_OperServ) == 0) clientdesc = desc_OperServ; else if (stricmp(who, s_GlobalNoticer) == 0) diff --git a/src/misc.c b/src/misc.c index 858cb0ebc..28f0009a1 100644 --- a/src/misc.c +++ b/src/misc.c @@ -219,7 +219,7 @@ const char *merge_args(int argc, char **argv) */ int match_wild(const char *pattern, const char *str) { - return Anope::Match(str, pattern, true); + return Anope::Match(pattern, str, true); } /*************************************************************************/ @@ -828,8 +828,6 @@ int nickIsServices(const char *tempnick, int bot) found++; else if (s_BotServ && (stricmp(nick, s_BotServ) == 0)) found++; - else if (s_HelpServ && (stricmp(nick, s_HelpServ) == 0)) - found++; else if (s_OperServ && (stricmp(nick, s_OperServ) == 0)) found++; else if (s_GlobalNoticer && (stricmp(nick, s_GlobalNoticer) == 0)) diff --git a/src/module.cpp b/src/module.cpp index cfec523b3..af002d94e 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -21,7 +21,6 @@ Module::Module(const std::string &mname, const std::string &creator) this->botHelp = NULL; this->operHelp = NULL; this->hostHelp = NULL; - this->helpHelp = NULL; this->type = THIRD; this->handle = NULL; @@ -123,14 +122,6 @@ Module::~Module() } } - for (current = HE_cmdTable[idx]; current; current = current->next) { - for (c = current->c; c; c = c->next) { - if ((c->mod_name) && (strcmp(c->mod_name, this->name.c_str()) == 0)) { - this->DelCommand(HELPSERV, c->name.c_str()); - } - } - } - for (current = OS_cmdTable[idx]; current; current = current->next) { for (c = current->c; c; c = c->next) { if ((c->mod_name) && (stricmp(c->mod_name, this->name.c_str()) == 0)) { diff --git a/src/modules.c b/src/modules.c index 6359c7c01..7d4f1942d 100644 --- a/src/modules.c +++ b/src/modules.c @@ -23,7 +23,6 @@ CommandHash *BOTSERV[MAX_CMD_HASH]; CommandHash *MEMOSERV[MAX_CMD_HASH]; CommandHash *NICKSERV[MAX_CMD_HASH]; CommandHash *CHANSERV[MAX_CMD_HASH]; -CommandHash *HELPSERV[MAX_CMD_HASH]; CommandHash *OPERSERV[MAX_CMD_HASH]; MessageHash *IRCD[MAX_CMD_HASH]; ModuleHash *MODULE_HASH[MAX_CMD_HASH]; @@ -296,12 +295,6 @@ int Module::AddCommand(CommandHash * cmdTable[], Command * c, int pos) } else { return MOD_ERR_NOSERVICE; } - } else if (cmdTable == HELPSERV) { - if (s_HelpServ) { - c->service = sstrdup(s_HelpServ); - } else { - return MOD_ERR_NOSERVICE; - } } else if (cmdTable == OPERSERV) { if (s_OperServ) { c->service = sstrdup(s_OperServ); @@ -932,11 +925,6 @@ void Module::SetHostHelp(void (*func)(User *)) this->hostHelp = func; } -void Module::SetHelpHelp(void (*func)(User *)) -{ - this->helpHelp = func; -} - /** * Display any extra module help for the given service. * @param services which services is help being dispalyed for? @@ -961,8 +949,6 @@ void moduleDisplayHelp(int service, User * u) current->m->operHelp(u); } else if ((service == 6) && current->m->hostHelp) { current->m->hostHelp(u); - } else if ((service == 7) && current->m->helpHelp) { - current->m->helpHelp(u); } } } |