From 284cf259055780a1f34fd5ff19a116228f060fca Mon Sep 17 00:00:00 2001 From: Kyle Tyo <36606155+VerinSenpai@users.noreply.github.com> Date: Tue, 17 Jun 2025 19:40:33 -0400 Subject: [PATCH] Command resolves (#38415) touchups --- .../Radiation/Systems/RadiationSystem.Debug.cs | 2 -- .../Sandbox/Commands/ColorNetworkCommand.cs | 18 +++++++++--------- Content.Server/Voting/VoteCommands.cs | 3 +-- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Content.Server/Radiation/Systems/RadiationSystem.Debug.cs b/Content.Server/Radiation/Systems/RadiationSystem.Debug.cs index f2eac9be6c..7e1775e359 100644 --- a/Content.Server/Radiation/Systems/RadiationSystem.Debug.cs +++ b/Content.Server/Radiation/Systems/RadiationSystem.Debug.cs @@ -1,11 +1,9 @@ -using System.Linq; using Content.Server.Administration; using Content.Server.Radiation.Components; using Content.Shared.Administration; using Content.Shared.Radiation.Events; using Content.Shared.Radiation.Systems; using Robust.Shared.Console; -using Robust.Shared.Debugging; using Robust.Shared.Enums; using Robust.Shared.Map.Components; using Robust.Shared.Player; diff --git a/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs b/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs index 2fcfcd8cbb..9f4d617904 100644 --- a/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs +++ b/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs @@ -11,17 +11,17 @@ using Robust.Shared.Console; namespace Content.Server.Sandbox.Commands { [AnyCommand] - public sealed class ColorNetworkCommand : LocalizedCommands + public sealed class ColorNetworkCommand : LocalizedEntityCommands { - [Dependency] private readonly IEntityManager _entManager = default!; + [Dependency] private readonly IAdminManager _adminManager = default!; + [Dependency] private readonly AtmosPipeColorSystem _pipeColorSystem = default!; + [Dependency] private readonly SandboxSystem _sandboxSystem = default!; public override string Command => "colornetwork"; public override void Execute(IConsoleShell shell, string argStr, string[] args) { - var sandboxManager = _entManager.System(); - var adminManager = IoCManager.Resolve(); - if (shell.IsClient || (!sandboxManager.IsSandboxEnabled && !adminManager.HasAdminFlag(shell.Player!, AdminFlags.Mapping))) + if (shell.IsClient || (!_sandboxSystem.IsSandboxEnabled && !_adminManager.HasAdminFlag(shell.Player!, AdminFlags.Mapping))) { shell.WriteError(Loc.GetString("cmd-colornetwork-no-access")); } @@ -40,13 +40,13 @@ namespace Content.Server.Sandbox.Commands var nent = new NetEntity(targetId); - if (!_entManager.TryGetEntity(nent, out var eUid)) + if (!EntityManager.TryGetEntity(nent, out var eUid)) { shell.WriteLine(Loc.GetString("shell-invalid-entity-id")); return; } - if (!_entManager.TryGetComponent(eUid, out NodeContainerComponent? nodeContainerComponent)) + if (!EntityManager.TryGetComponent(eUid, out NodeContainerComponent? nodeContainerComponent)) { shell.WriteLine(Loc.GetString("shell-entity-is-not-node-container")); return; @@ -77,10 +77,10 @@ namespace Content.Server.Sandbox.Commands foreach (var x in group.Nodes) { - if (!_entManager.TryGetComponent(x.Owner, out AtmosPipeColorComponent? atmosPipeColorComponent)) + if (!EntityManager.TryGetComponent(x.Owner, out AtmosPipeColorComponent? atmosPipeColorComponent)) continue; - _entManager.System().SetColor(x.Owner, atmosPipeColorComponent, color); + _pipeColorSystem.SetColor(x.Owner, atmosPipeColorComponent, color); } } } diff --git a/Content.Server/Voting/VoteCommands.cs b/Content.Server/Voting/VoteCommands.cs index e7b8599855..677fe1d0f6 100644 --- a/Content.Server/Voting/VoteCommands.cs +++ b/Content.Server/Voting/VoteCommands.cs @@ -249,10 +249,9 @@ namespace Content.Server.Voting public override CompletionResult GetCompletion(IConsoleShell shell, string[] args) { - var mgr = IoCManager.Resolve(); if (args.Length == 1) { - var options = mgr.ActiveVotes + var options = _voteManager.ActiveVotes .OrderBy(v => v.Id) .Select(v => new CompletionOption(v.Id.ToString(), v.Title)); -- 2.51.2