apply chat flood prevention in games next to rooms (#4387)

* apply chat flood prevention in games next to rooms

* add limit to private messages as well
This commit is contained in:
ebbit1q
2021-06-28 07:57:46 +02:00
committed by GitHub
parent a65ce8694c
commit 0280fea3e6
5 changed files with 46 additions and 23 deletions

View File

@@ -945,6 +945,9 @@ Server_Player::cmdGameSay(const Command_GameSay &cmd, ResponseContainer & /*rc*/
}
}
if (!userInterface->addSaidMessageSize(cmd.message().size())) {
return Response::RespChatFlood;
}
Event_GameSay event;
event.set_message(cmd.message());
ges.enqueueGameEvent(event, playerId);