From f3f4ed7444c62b2d87bb38d0ff4570e1b248b03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schr=C3=B6dinger?= <132720404+Schrodinger71@users.noreply.github.com> Date: Sun, 29 Dec 2024 00:27:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B7=D0=B0=D0=B4=D0=B5=D1=80=D0=B6=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=B2=2010=20=D1=81=D0=B5=D0=BA=D1=83=D0=BD=D0=B4=20=D0=BC?= =?UTF-8?q?=D0=B5=D0=B6=D0=B4=D1=83=20=D0=BA=D0=BE=D0=B4=D0=BE=D0=BC=20?= =?UTF-8?q?=D0=B3=D0=B0=D0=BC=D0=BC=D0=B0=20=D0=B8=20=D0=BE=D0=B1=D1=8A?= =?UTF-8?q?=D1=8F=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=BE=D0=B1=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=BD=D1=8F=D1=82=D0=B8=D0=B8=20=D0=BE=D0=B1?= =?UTF-8?q?=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Administration/Commands/SendERTCommand.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Content.Server/ADT/Administration/Commands/SendERTCommand.cs b/Content.Server/ADT/Administration/Commands/SendERTCommand.cs index eddfe27d1f2..b9728408607 100644 --- a/Content.Server/ADT/Administration/Commands/SendERTCommand.cs +++ b/Content.Server/ADT/Administration/Commands/SendERTCommand.cs @@ -16,6 +16,7 @@ using System.Numerics; using Content.Server.Chat.Managers; using Robust.Shared.ContentPack; +using System.Threading.Tasks; namespace Content.Server.ADT.Administration.Commands; @@ -33,7 +34,8 @@ public sealed class SendERTCommand : IConsoleCommand public string Command => "sendert"; public string Description => Loc.GetString("send-ert-description"); public string Help => Loc.GetString("send-ert-help"); - public void Execute(IConsoleShell shell, string argStr, string[] args) + + public async void Execute(IConsoleShell shell, string argStr, string[] args) { #region Setup vars string audioPath = ""; @@ -158,12 +160,6 @@ public void Execute(IConsoleShell shell, string argStr, string[] args) if (isAnnounce) // Write announce & play audio { - if (isSetAlertLevel) - { - if (stationUid == null) { shell.WriteLine(Loc.GetString("sent-ert-invalid-grid")); return; } //We are on station? - _system.GetEntitySystem().SetLevel(stationUid.Value, alertLevelCode, false, true, true, true); - } - if (isPlayAudio) { Filter filter = Filter.Empty().AddAllPlayers(_playerManager); @@ -175,6 +171,15 @@ public void Execute(IConsoleShell shell, string argStr, string[] args) } _system.GetEntitySystem().DispatchGlobalAnnouncement(Loc.GetString($"ert-send-{args[0].ToLower()}-announcement"), Loc.GetString($"ert-send-{args[0].ToLower()}-announcer"), playSound: playAuidoFromAnnouncement, colorOverride: announceColor); + + if (args[0].ToLower() != "denial") // Если отказ то задержка нам не нужна + await Task.Delay(10000); // Ставим задержку на 10 секунд + + if (isSetAlertLevel) + { + if (stationUid == null) { shell.WriteLine(Loc.GetString("sent-ert-invalid-grid")); return; } //We are on station? + _system.GetEntitySystem().SetLevel(stationUid.Value, alertLevelCode, false, true, true, true); + } } #endregion