- add: Что бы в looc не срали
This commit is contained in:
@@ -25,7 +25,6 @@ using Content.Shared.Players;
|
|||||||
using Content.Shared.Radio;
|
using Content.Shared.Radio;
|
||||||
using Content.Shared._White;
|
using Content.Shared._White;
|
||||||
using Content.Shared.Speech;
|
using Content.Shared.Speech;
|
||||||
using Content.Shared._White.Cult;
|
|
||||||
using Content.Shared._White.Cult.Systems;
|
using Content.Shared._White.Cult.Systems;
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
@@ -82,7 +81,9 @@ public sealed partial class ChatSystem : SharedChatSystem
|
|||||||
private bool _critLoocEnabled;
|
private bool _critLoocEnabled;
|
||||||
private const bool AdminLoocEnabled = true;
|
private const bool AdminLoocEnabled = true;
|
||||||
private const string ChatNamePalette = "ChatNames";
|
private const string ChatNamePalette = "ChatNames";
|
||||||
|
//Amour Edit
|
||||||
|
private readonly Dictionary<EntityUid, DateTime> _loocCooldowns = new();
|
||||||
|
//Amour Edit
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
@@ -733,6 +734,15 @@ public sealed partial class ChatSystem : SharedChatSystem
|
|||||||
if (!_critLoocEnabled && _mobStateSystem.IsCritical(source))
|
if (!_critLoocEnabled && _mobStateSystem.IsCritical(source))
|
||||||
return;
|
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",
|
var wrappedMessage = Loc.GetString("chat-manager-entity-looc-wrap-message",
|
||||||
("entityName", name),
|
("entityName", name),
|
||||||
("message", FormattedMessage.EscapeText(message)));
|
("message", FormattedMessage.EscapeText(message)));
|
||||||
|
|||||||
Reference in New Issue
Block a user