diff options
author | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-27 03:14:59 +0000 |
---|---|---|
committer | Naram Qashat cyberbotx@cyberbotx.com <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-10-27 03:14:59 +0000 |
commit | 232d1b5e88c62ef3e2dae4a03353da817a3b89dc (patch) | |
tree | 3f92f9f2949a945f8ccd593589ad7410839059a1 | |
parent | a9be866804d2020bd59673959b5629b45519e50b (diff) |
Added akillreason directive to defcon block in new config.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1501 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | data/example_new.conf | 6 | ||||
-rw-r--r-- | src/config.c | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/data/example_new.conf b/data/example_new.conf index 86b79d4a4..636b2a3c8 100644 --- a/data/example_new.conf +++ b/data/example_new.conf @@ -954,4 +954,10 @@ defcon * and will also override globalondefcon and globalondefconmore when set. */ #offmessage = "Services are now back to normal, sorry for any inconvenience" + + /* + * Defines the reason to use when clients are KILLed or AKILLed from the network while the proper + * DefCon operation is in effect. + */ + #akillreason = "This network is currently not accepting connections, please try again later" } diff --git a/src/config.c b/src/config.c index fa57eca4c..73ac09cb3 100644 --- a/src/config.c +++ b/src/config.c @@ -520,7 +520,7 @@ bool ValidateDefCon(ServerConfig *, const char *tag, const char *value, ValueIte if (level > 5) throw ConfigException("The value for <defcon:defaultlevel> must be between 1 through 5 if you wish to use DefCon or 0 if you wish to disable it!"); } else if (DefConLevel) { - if ((static_cast<std::string>(value).substr(0, 5) == "level" && isdigit(value[5])) || static_cast<std::string>(value) == "chanmodes") { + if ((static_cast<std::string>(value).substr(0, 5) == "level" && isdigit(value[5])) || static_cast<std::string>(value) == "chanmodes" || static_cast<std::string>(value) == "akillreason") { 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) == "message" && GlobalOnDefconMore) { @@ -711,6 +711,7 @@ int ServerConfig::Read(bool bail) {"defcon", "globalondefconmore", "no", new ValueContainerBool(&GlobalOnDefconMore), DT_BOOLEAN, NoValidation}, {"defcon", "message", "", new ValueContainerChar(&DefconMessage), DT_CHARPTR, ValidateDefCon}, {"defcon", "offmessage", "", new ValueContainerChar(&DefConOffMessage), DT_CHARPTR, NoValidation}, + {"defcon", "akillreason", "", new ValueContainerChar(&DefConAkillReason), DT_CHARPTR, ValidateDefCon}, {NULL, NULL, NULL, NULL, DT_NOTHING, NoValidation} }; /* These tags can occur multiple times, and therefore they have special code to read them @@ -1291,8 +1292,6 @@ Directive directives[] = { {"DontQuoteAddresses", {{PARAM_SET, PARAM_RELOAD, &DontQuoteAddresses}}}, {"DumpCore", {{PARAM_SET, 0, &DumpCore}}}, - {"DefConAkillReason", - {{PARAM_STRING, PARAM_RELOAD, &DefConAkillReason}}}, {"EncModule", {{PARAM_STRING, 0, &EncModule}}}, {"ExpireTimeout", {{PARAM_TIME, PARAM_RELOAD, &ExpireTimeout}}}, {"ForceForbidReason", {{PARAM_SET, PARAM_RELOAD, &ForceForbidReason}}}, |