summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-18 21:49:38 +0000
committerNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-18 21:49:38 +0000
commit9432f3f0e8e4e1d20123a58012f51d832b737293 (patch)
treea1f230dcc14cc131709e67bd64488ef0690a5539 /src
parentfdea510668b60f7c4aa0e9cfde5b9f93b6e1510b (diff)
Started botserv block in new config, added nick and description directives.
Added ValidateBotServ function to validate certain BotServ directives only when BotServ is in use. Added forward declaration of NickCore in account.h. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1451 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/config.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c
index 2b2613653..63f969d4a 100644
--- a/src/config.c
+++ b/src/config.c
@@ -483,6 +483,16 @@ bool ValidateBantype(ServerConfig *, const char *, const char *, ValueItem &data
return true;
}
+bool ValidateBotServ(ServerConfig *, const char *tag, const char *value, ValueItem &data)
+{
+ if (s_BotServ) {
+ if (static_cast<std::string>(value) == "description") {
+ if (!*data.GetString()) throw ConfigException(static_cast<std::string>("The value for <") + tag + ":" + value + "> cannot be empty when BotServ is enabled!");
+ }
+ }
+ return true;
+}
+
void ServerConfig::ReportConfigError(const std::string &errormessage, bool bail)
{
alog("There were errors in your configuration file: %s", errormessage.c_str());
@@ -600,6 +610,8 @@ int ServerConfig::Read(bool bail)
{"memoserv", "senddelay", "0", new ValueContainerTime(&MSSendDelay), DT_TIME, NoValidation},
{"memoserv", "notifyall", "no", new ValueContainerBool(&MSNotifyAll), DT_BOOLEAN, NoValidation},
{"memoserv", "memoreceipt", "0", new ValueContainerInt(&MSMemoReceipt), DT_INTEGER, NoValidation},
+ {"botserv", "nick", "", new ValueContainerChar(&s_BotServ), DT_CHARPTR, NoValidation},
+ {"botserv", "description", "Bot Service", new ValueContainerChar(&desc_BotServ), DT_CHARPTR, ValidateBotServ},
{NULL, NULL, NULL, NULL, DT_NOTHING, NoValidation}
};
/* These tags can occur multiple times, and therefore they have special code to read them
@@ -1181,8 +1193,6 @@ Directive directives[] = {
{"BadPassTimeout", {{PARAM_TIME, PARAM_RELOAD, &BadPassTimeout}}},
{"BotCoreModules", {{PARAM_STRING, PARAM_RELOAD, &BotCoreModules}}},
{"BotServDB", {{PARAM_STRING, PARAM_RELOAD, &BotDBName}}},
- {"BotServName", {{PARAM_STRING, 0, &s_BotServ},
- {PARAM_STRING, 0, &desc_BotServ}}},
{"BSBadWordsMax", {{PARAM_POSINT, PARAM_RELOAD, &BSBadWordsMax}}},
{"BSDefDontKickOps", {{PARAM_SET, PARAM_RELOAD, &BSDefDontKickOps}}},
{"BSDefDontKickVoices",