summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/example_new.conf6
-rw-r--r--src/config.c5
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}}},