CatStation/Content.Server/Administration/Commands/ShuttleCommands.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* IoC source gen compatibility

Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter.

* Missed a spot
2026-05-09 03:29:58 +00:00

41 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 partial class CallShuttleCommand : LocalizedEntityCommands
{
[Dependency] private 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 partial class RecallShuttleCommand : LocalizedEntityCommands
{
[Dependency] private 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);
}
}
}