mirror of
https://github.com/anope/anope.git
synced 2026-06-27 09:46:38 +02:00
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
This commit is contained in:
@@ -1086,31 +1086,6 @@ hostserv
|
||||
#hostsetters = "CyberBotX w00t"
|
||||
}
|
||||
|
||||
/*
|
||||
* [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
|
||||
*
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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];
|
||||
@@ -333,13 +330,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
|
||||
|
||||
+1
-2
@@ -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)
|
||||
|
||||
+1
-12
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
+1
-3
@@ -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))
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user