From 232d1b5e88c62ef3e2dae4a03353da817a3b89dc Mon Sep 17 00:00:00 2001 From: "Naram Qashat cyberbotx@cyberbotx.com" Date: Mon, 27 Oct 2008 03:14:59 +0000 Subject: [PATCH] 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 --- data/example_new.conf | 6 ++++++ 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 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(value).substr(0, 5) == "level" && isdigit(value[5])) || static_cast(value) == "chanmodes") { + if ((static_cast(value).substr(0, 5) == "level" && isdigit(value[5])) || static_cast(value) == "chanmodes" || static_cast(value) == "akillreason") { if (!*data.GetString()) throw ConfigException(static_cast("The value for <") + tag + ":" + value + "> cannot be empty when DefCon is enabled!"); } else if (static_cast(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}}},