Command resolves. (#38519)
* banlist-command * open-admin-notes-command * stealthmin-command * set-alert-level-command * remove unused usings * whitelist commands
This commit is contained in:
@@ -2,16 +2,15 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared.Administration;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.AlertLevel.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
public sealed class SetAlertLevelCommand : LocalizedCommands
|
||||
public sealed class SetAlertLevelCommand : LocalizedEntityCommands
|
||||
{
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||
[Dependency] private readonly AlertLevelSystem _alertLevelSystem = default!;
|
||||
[Dependency] private readonly StationSystem _stationSystem = default!;
|
||||
|
||||
public override string Command => "setalertlevel";
|
||||
|
||||
@@ -21,11 +20,9 @@ namespace Content.Server.AlertLevel.Commands
|
||||
var player = shell.Player;
|
||||
if (player?.AttachedEntity != null)
|
||||
{
|
||||
var stationUid = _entitySystems.GetEntitySystem<StationSystem>().GetOwningStation(player.AttachedEntity.Value);
|
||||
var stationUid = _stationSystem.GetOwningStation(player.AttachedEntity.Value);
|
||||
if (stationUid != null)
|
||||
{
|
||||
levelNames = GetStationLevelNames(stationUid.Value);
|
||||
}
|
||||
}
|
||||
|
||||
return args.Length switch
|
||||
@@ -60,7 +57,7 @@ namespace Content.Server.AlertLevel.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var stationUid = _entitySystems.GetEntitySystem<StationSystem>().GetOwningStation(player.AttachedEntity.Value);
|
||||
var stationUid = _stationSystem.GetOwningStation(player.AttachedEntity.Value);
|
||||
if (stationUid == null)
|
||||
{
|
||||
shell.WriteLine(LocalizationManager.GetString("cmd-setalertlevel-invalid-grid"));
|
||||
@@ -75,13 +72,12 @@ namespace Content.Server.AlertLevel.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
_entitySystems.GetEntitySystem<AlertLevelSystem>().SetLevel(stationUid.Value, level, true, true, true, locked);
|
||||
_alertLevelSystem.SetLevel(stationUid.Value, level, true, true, true, locked);
|
||||
}
|
||||
|
||||
private string[] GetStationLevelNames(EntityUid station)
|
||||
{
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entityManager.TryGetComponent<AlertLevelComponent>(station, out var alertLevelComp))
|
||||
if (!EntityManager.TryGetComponent<AlertLevelComponent>(station, out var alertLevelComp))
|
||||
return new string[]{};
|
||||
|
||||
if (alertLevelComp.AlertLevels == null)
|
||||
|
||||
Reference in New Issue
Block a user