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-27 00:40:17 +0000
committerNaram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-27 00:40:17 +0000
commite3ab258551191bbacf059817603a4300035694f1 (patch)
treeef5b7ed18683a16419c1cd83cee06a9e90c073ef /src
parent3d7a2c1794320a583df10b389a2cc6a30d55a8a1 (diff)
Added sessionlimit directive to defcon block in new config.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1493 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/config.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c
index 2dd43e7ae..3ab9d0a11 100644
--- a/src/config.c
+++ b/src/config.c
@@ -523,6 +523,9 @@ bool ValidateDefCon(ServerConfig *, const char *tag, const char *value, ValueIte
if (static_cast<std::string>(value).substr(0, 5) == "level" && isdigit(value[5])) {
if (!*data.GetString()) throw ConfigException(static_cast<std::string>("The value for <") + tag + ":" + value + "> cannot be empty when DefCon is enabled!");
}
+ else if (static_cast<std::string>(value) == "sessionlimit") {
+ if (!data.GetInteger()) throw ConfigException(static_cast<std::string>("The value for <") + tag + ":" + value + "> must be non-zero when DefCon is enabled!");
+ }
}
return true;
}
@@ -697,6 +700,7 @@ int ServerConfig::Read(bool bail)
{"defcon", "level3", "", new ValueContainerString(&DefCon3), DT_STRING, ValidateDefCon},
{"defcon", "level2", "", new ValueContainerString(&DefCon2), DT_STRING, ValidateDefCon},
{"defcon", "level1", "", new ValueContainerString(&DefCon1), DT_STRING, ValidateDefCon},
+ {"defcon", "sessionlimit", "0", new ValueContainerInt(&DefConSessionLimit), DT_INTEGER, ValidateDefCon},
{NULL, NULL, NULL, NULL, DT_NOTHING, NoValidation}
};
/* These tags can occur multiple times, and therefore they have special code to read them
@@ -1277,8 +1281,6 @@ Directive directives[] = {
{"DontQuoteAddresses",
{{PARAM_SET, PARAM_RELOAD, &DontQuoteAddresses}}},
{"DumpCore", {{PARAM_SET, 0, &DumpCore}}},
- {"DefConSessionLimit",
- {{PARAM_INT, PARAM_RELOAD, &DefConSessionLimit}}},
{"DefConAkillExpire", {{PARAM_STRING, PARAM_RELOAD, &DefConAKILL}}},
{"DefConChanModes", {{PARAM_STRING, PARAM_RELOAD, &DefConChanModes}}},
{"DefConTimeOut", {{PARAM_STRING, PARAM_RELOAD, &DefConTimeOut}}},