Files
Delta-v/Content.Server/Administration/Commands/ShuttleCommands.cs
T
Samuka df16c8b0a2 Admin log now shows who called or recalled evac (#41557)
* admin log now shows who called or recalled evac

* ops

* named parameters

* show in player search

* ops, forgot 2

* when did this happen?
2026-06-29 12:43:39 +02:00

42 lines
1.6 KiB
C#

using Content.Server.RoundEnd;
using Content.Shared.Administration;
using Content.Shared.Localizations;
using Robust.Shared.Console;
namespace Content.Server.Administration.Commands
{
[AdminCommand(AdminFlags.Round)]
public sealed class CallShuttleCommand : LocalizedEntityCommands
{
[Dependency] private readonly RoundEndSystem _roundEndSystem = default!;
public override string Command => "callshuttle";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
// ReSharper disable once ConvertIfStatementToSwitchStatement
if (args.Length == 1 && TimeSpan.TryParseExact(args[0], ContentLocalizationManager.TimeSpanMinutesFormats, LocalizationManager.DefaultCulture, out var timeSpan))
_roundEndSystem.RequestRoundEnd(timeSpan, shell.Player?.AttachedEntity, checkCooldown: false);
else if (args.Length == 1)
shell.WriteLine(Loc.GetString("shell-timespan-minutes-must-be-correct"));
else
_roundEndSystem.RequestRoundEnd(shell.Player?.AttachedEntity, checkCooldown: false);
}
}
[AdminCommand(AdminFlags.Round)]
public sealed class RecallShuttleCommand : LocalizedEntityCommands
{
[Dependency] private readonly RoundEndSystem _roundEndSystem = default!;
public override string Command => "recallshuttle";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
_roundEndSystem.CancelRoundEndCountdown(shell.Player?.AttachedEntity, forceRecall: true);
}
}
}