Words not allowed in chat are blocked whatever word_warnings is

A dedicated server with word_warnings set to 0 passed such messages on.
It now never does: at 0 the message is dropped, its player is told it
was not sent, and nobody is warned or kicked. The team's lists are read
on every server for this, including one with use_global_bans off, which
still lets globally banned players in.
This commit is contained in:
AyeZeeBB committed 2026-10-09 21:59:10 -05:00
1 parent 70128cf2d7
commit b5230d728c
5 files changed
+27 -15

No files matched your search

+7 -1
View File
@@ -701,7 +701,13 @@ void Host::send_chat(std::string_view text, Guest *only) {
else broadcast(message, true, false);
}
bool Host::allowed_words(Guest &guest, std::string_view text) {
if (!config_.word_warnings || !text::contains_forbidden_words(text)) return true;
if (!text::contains_forbidden_words(text)) return true;
// Never passed on. Without warnings ("word_warnings": 0) that is all that happens.
if (!config_.word_warnings) {
log_("[words] " + guest_name(guest) + " said a word that is not allowed; the message was not passed on.");
send_chat(multiplayer::word_blocked_notice, &guest);
return false;
}
const auto id = guest.member.id;
const auto count = ++word_warnings_[id];
if (count > config_.word_warnings) {