mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-28 07:56:51 +01:00
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:
1 parent
28118efc27
commit
07cd31b8aa
7 files changed
+71
-15
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user