Basic rate limiting for chat messages (#21907)
This commit is contained in:
committed by
GitHub
parent
dbb3da9232
commit
8bf807a9b5
@@ -183,6 +183,9 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (player != null && !_chatManager.HandleRateLimit(player))
|
||||
return;
|
||||
|
||||
// Sus
|
||||
if (player?.AttachedEntity is { Valid: true } entity && source != entity)
|
||||
{
|
||||
@@ -267,6 +270,9 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
if (!CanSendInGame(message, shell, player))
|
||||
return;
|
||||
|
||||
if (player != null && !_chatManager.HandleRateLimit(player))
|
||||
return;
|
||||
|
||||
// It doesn't make any sense for a non-player to send in-game OOC messages, whereas non-players may be sending
|
||||
// in-game IC messages.
|
||||
if (player?.AttachedEntity is not { Valid: true } entity || source != entity)
|
||||
|
||||
Reference in New Issue
Block a user