Votes: the same answer in the next poll is no longer turned away as a repeat

Chat's flood control refuses a line identical to the one before it within 15 s, which also
caught /2 in a poll right after /2 in the last one. An answer to the running vote or poll is now
exempt from that one rule, on the server and in the game; the pace still holds, and the vote
still counts one answer per player.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Robin MoellerandClaude Opus 5.5 committed 2026-10-18 02:02:56 +02:00
1 parent 28118efc27
commit 07cd31b8aa
7 files changed
+71 -15

No files matched your search

+3 -1
View File
@@ -1247,8 +1247,10 @@ void Host::receive(std::uint64_t peer, std::span<const std::uint8_t> bytes, std:
if (p.kind == PacketKind::physics_tuning || p.kind == PacketKind::physics_extras) return;
if (p.kind == PacketKind::chat) {
active(*link);
// An answer to the running vote may repeat the line before it: the same /2 in the next poll.
const bool answer = p.text.starts_with('/') && answers_vote(*link, std::string_view(p.text).substr(1));
if (!routed_source(p, link->member, peer, true, id_) ||
link->chat_rate.accept(now_, p.text, 1) != ChatRate::Verdict::accepted)
link->chat_rate.accept(now_, p.text, 1, answer) != ChatRate::Verdict::accepted)
return;
link->last_packet = now_;
if (!allowed_words(*link, p.text)) return;