From 887bf14a45e2f8071e10fc4010aa2e081c39fd77 Mon Sep 17 00:00:00 2001 From: JabkaGenius Date: Sat, 30 Mar 2024 21:38:29 +0300 Subject: [PATCH] =?UTF-8?q?-=20add:=20=D0=A7=D1=82=D0=BE=20=D0=B1=D1=8B=20?= =?UTF-8?q?=D0=B2=20looc=20=D0=BD=D0=B5=20=D1=81=D1=80=D0=B0=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/Chat/Systems/ChatSystem.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index f5b1dac3e9..821d4435da 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -25,7 +25,6 @@ using Content.Shared.Players; using Content.Shared.Radio; using Content.Shared._White; using Content.Shared.Speech; -using Content.Shared._White.Cult; using Content.Shared._White.Cult.Systems; using Robust.Server.Player; using Robust.Shared.Audio; @@ -82,7 +81,9 @@ public sealed partial class ChatSystem : SharedChatSystem private bool _critLoocEnabled; private const bool AdminLoocEnabled = true; private const string ChatNamePalette = "ChatNames"; - + //Amour Edit + private readonly Dictionary _loocCooldowns = new(); + //Amour Edit public override void Initialize() { base.Initialize(); @@ -733,6 +734,15 @@ public sealed partial class ChatSystem : SharedChatSystem if (!_critLoocEnabled && _mobStateSystem.IsCritical(source)) return; + //Amour EDIT + if (_loocCooldowns.TryGetValue(source, out var lastLoocTime) && DateTime.UtcNow - lastLoocTime < TimeSpan.FromSeconds(60)) //LOOC Cooldowns + { + return; + } + + _loocCooldowns[source] = DateTime.UtcNow; + //Amour Edit + var wrappedMessage = Loc.GetString("chat-manager-entity-looc-wrap-message", ("entityName", name), ("message", FormattedMessage.EscapeText(message)));