]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Command resolve and LEC conversion batch 3 (#38378)
authorKyle Tyo <36606155+VerinSenpai@users.noreply.github.com>
Tue, 17 Jun 2025 09:39:42 +0000 (05:39 -0400)
committerGitHub <noreply@github.com>
Tue, 17 Jun 2025 09:39:42 +0000 (11:39 +0200)
* I'm just a silly goober

* requested changes

* Update Content.Server/Interaction/TilePryCommand.cs

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
16 files changed:
Content.Server/GameTicking/Commands/ForceMapCommand.cs
Content.Server/GameTicking/Commands/ForcePresetCommand.cs
Content.Server/GameTicking/Commands/GoLobbyCommand.cs
Content.Server/GhostKick/GhostKickManager.cs
Content.Server/Interaction/TilePryCommand.cs
Content.Server/Mapping/MappingCommand.cs
Content.Server/Maps/GridDraggingCommand.cs
Content.Server/Mind/Commands/MindInfoCommand.cs
Resources/Locale/en-US/commands/force-map-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/force-preset-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/ghost-kick-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/go-lobby-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/grid-drag-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/mind-info-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/tile-pry-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/game-ticking/forcemap-command.ftl [deleted file]

index 4cc30ff38af623bbc4db58122857fa9ad3e538dd..577464acadb129d322e01147b57caa948e41b5a5 100644 (file)
@@ -10,50 +10,49 @@ using Robust.Shared.Prototypes;
 namespace Content.Server.GameTicking.Commands
 {
     [AdminCommand(AdminFlags.Round)]
-    sealed class ForceMapCommand : IConsoleCommand
+    public sealed class ForceMapCommand : LocalizedCommands
     {
         [Dependency] private readonly IConfigurationManager _configurationManager = default!;
+        [Dependency] private readonly IGameMapManager _gameMapManager = default!;
+        [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
 
-        public string Command => "forcemap";
-        public string Description => Loc.GetString("forcemap-command-description");
-        public string Help => Loc.GetString("forcemap-command-help");
+        public override string Command => "forcemap";
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             if (args.Length != 1)
             {
-                shell.WriteLine(Loc.GetString("forcemap-command-need-one-argument"));
+                shell.WriteLine(Loc.GetString(Loc.GetString($"shell-need-exactly-one-argument")));
                 return;
             }
 
-            var gameMap = IoCManager.Resolve<IGameMapManager>();
             var name = args[0];
 
             // An empty string clears the forced map
-            if (!string.IsNullOrEmpty(name) && !gameMap.CheckMapExists(name))
+            if (!string.IsNullOrEmpty(name) && !_gameMapManager.CheckMapExists(name))
             {
-                shell.WriteLine(Loc.GetString("forcemap-command-map-not-found", ("map", name)));
+                shell.WriteLine(Loc.GetString("cmd-forcemap-map-not-found", ("map", name)));
                 return;
             }
 
             _configurationManager.SetCVar(CCVars.GameMap, name);
 
             if (string.IsNullOrEmpty(name))
-                shell.WriteLine(Loc.GetString("forcemap-command-cleared"));
+                shell.WriteLine(Loc.GetString("cmd-forcemap-cleared"));
             else
-                shell.WriteLine(Loc.GetString("forcemap-command-success", ("map", name)));
+                shell.WriteLine(Loc.GetString("cmd-forcemap-success", ("map", name)));
         }
 
-        public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
+        public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
         {
             if (args.Length == 1)
             {
-                var options = IoCManager.Resolve<IPrototypeManager>()
+                var options = _prototypeManager
                     .EnumeratePrototypes<GameMapPrototype>()
                     .Select(p => new CompletionOption(p.ID, p.MapName))
                     .OrderBy(p => p.Value);
 
-                return CompletionResult.FromHintOptions(options, Loc.GetString("forcemap-command-arg-map"));
+                return CompletionResult.FromHintOptions(options, Loc.GetString($"cmd-forcemap-hint"));
             }
 
             return CompletionResult.Empty;
index 5ef72f59b370aec372bc3e3130c053d3ae22b54c..327465be95096905149aec86c072a913d2c16091 100644 (file)
@@ -8,51 +8,49 @@ using Robust.Shared.Prototypes;
 namespace Content.Server.GameTicking.Commands
 {
     [AdminCommand(AdminFlags.Round)]
-    sealed class ForcePresetCommand : IConsoleCommand
+    public sealed class ForcePresetCommand : LocalizedEntityCommands
     {
-        [Dependency] private readonly IEntityManager _e = default!;
+        [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+        [Dependency] private readonly GameTicker _ticker = default!;
 
-        public string Command => "forcepreset";
-        public string Description => "Forces a specific game preset to start for the current lobby.";
-        public string Help => $"Usage: {Command} <preset>";
+        public override string Command => "forcepreset";
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var ticker = _e.System<GameTicker>();
-            if (ticker.RunLevel != GameRunLevel.PreRoundLobby)
+            if (_ticker.RunLevel != GameRunLevel.PreRoundLobby)
             {
-                shell.WriteLine("This can only be executed while the game is in the pre-round lobby.");
+                shell.WriteLine(Loc.GetString($"cmd-forcepreset-preround-lobby-only"));
                 return;
             }
 
             if (args.Length != 1)
             {
-                shell.WriteLine("Need exactly one argument.");
+                shell.WriteLine(Loc.GetString($"shell-need-exactly-one-argument"));
                 return;
             }
 
             var name = args[0];
-            if (!ticker.TryFindGamePreset(name, out var type))
+            if (!_ticker.TryFindGamePreset(name, out var type))
             {
-                shell.WriteLine($"No preset exists with name {name}.");
+                shell.WriteLine(Loc.GetString($"cmd-forcepreset-no-preset-found", ("preset", name)));
                 return;
             }
 
-            ticker.SetGamePreset(type, true);
-            shell.WriteLine($"Forced the game to start with preset {name}.");
-            ticker.UpdateInfoText();
+            _ticker.SetGamePreset(type, true);
+            shell.WriteLine(Loc.GetString($"cmd-forcepreset-success", ("preset", name)));
+            _ticker.UpdateInfoText();
         }
 
-        public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
+        public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
         {
             if (args.Length == 1)
             {
-                var options = IoCManager.Resolve<IPrototypeManager>()
+                var options = _prototypeManager
                     .EnumeratePrototypes<GamePresetPrototype>()
                     .OrderBy(p => p.ID)
                     .Select(p => p.ID);
 
-                return CompletionResult.FromHintOptions(options, "<preset>");
+                return CompletionResult.FromHintOptions(options, Loc.GetString($"cmd-forcepreset-hint"));
             }
 
             return CompletionResult.Empty;
index b5984d260d3c4a035d50b0f1a876336eceb4da94..98c1b91e082b8e14dc84df78ab181c5417479bf3 100644 (file)
@@ -8,40 +8,35 @@ using Robust.Shared.Console;
 namespace Content.Server.GameTicking.Commands
 {
     [AdminCommand(AdminFlags.Round)]
-    public sealed class GoLobbyCommand : IConsoleCommand
+    public sealed class GoLobbyCommand : LocalizedEntityCommands
     {
-        [Dependency] private readonly IEntityManager _e = default!;
+        [Dependency] private readonly IConfigurationManager _configManager = default!;
+        [Dependency] private readonly GameTicker _gameTicker = default!;
 
-        public string Command => "golobby";
-        public string Description => "Enables the lobby and restarts the round.";
-        public string Help => $"Usage: {Command} / {Command} <preset>";
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override string Command => "golobby";
+
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             GamePresetPrototype? preset = null;
             var presetName = string.Join(" ", args);
 
-            var ticker = _e.System<GameTicker>();
-
             if (args.Length > 0)
             {
-                if (!ticker.TryFindGamePreset(presetName, out preset))
+                if (!_gameTicker.TryFindGamePreset(presetName, out preset))
                 {
-                    shell.WriteLine($"No preset found with name {presetName}");
+                    shell.WriteLine(Loc.GetString($"cmd-forcepreset-no-preset-found", ("preset", presetName)));
                     return;
                 }
             }
 
-            var config = IoCManager.Resolve<IConfigurationManager>();
-            config.SetCVar(CCVars.GameLobbyEnabled, true);
+            _configManager.SetCVar(CCVars.GameLobbyEnabled, true);
 
-            ticker.RestartRound();
+            _gameTicker.RestartRound();
 
             if (preset != null)
-            {
-                ticker.SetGamePreset(preset);
-            }
+                _gameTicker.SetGamePreset(preset);
 
-            shell.WriteLine($"Enabling the lobby and restarting the round.{(preset == null ? "" : $"\nPreset set to {presetName}")}");
+            shell.WriteLine(Loc.GetString(preset == null ? "cmd-golobby-success" : "cmd-golobby-success-with-preset", ("preset", presetName)));
         }
     }
 }
index 40d21d79d2ccc91443af116a58fef1b16d58bf8d..61d8cf9b32913f4dc1d9d954c975b82e7dd1b466 100644 (file)
@@ -10,7 +10,7 @@ namespace Content.Server.GhostKick;
 
 // Handles logic for "ghost kicking".
 // Basically we boot the client off the server without telling them, so the game shits itself.
-// Hilariously isn't it?
+// Hilarious, isn't it?
 
 public sealed class GhostKickManager
 {
@@ -45,32 +45,30 @@ public sealed class GhostKickManager
 }
 
 [AdminCommand(AdminFlags.Moderator)]
-public sealed class GhostKickCommand : IConsoleCommand
+public sealed class GhostKickCommand : LocalizedEntityCommands
 {
-    public string Command => "ghostkick";
-    public string Description => "Kick a client from the server as if their network just dropped.";
-    public string Help => "Usage: ghostkick <Player> [Reason]";
+    [Dependency] private readonly IPlayerManager _playerManager = default!;
+    [Dependency] private readonly GhostKickManager _ghostKick = default!;
 
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    public override string Command => "ghostkick";
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
         if (args.Length < 1)
         {
-            shell.WriteError("Need at least one argument");
+            shell.WriteError(Loc.GetString($"shell-need-exactly-one-argument"));
             return;
         }
 
         var playerName = args[0];
-        var reason = args.Length > 1 ? args[1] : "Ghost kicked by console";
-
-        var players = IoCManager.Resolve<IPlayerManager>();
-        var ghostKick = IoCManager.Resolve<GhostKickManager>();
+        var reason = args.Length > 1 ? args[1] : Loc.GetString($"cmd-ghostkick-default-reason");
 
-        if (!players.TryGetSessionByUsername(playerName, out var player))
+        if (!_playerManager.TryGetSessionByUsername(playerName, out var player))
         {
-            shell.WriteError($"Unable to find player: '{playerName}'.");
+            shell.WriteError(Loc.GetString($"shell-target-player-does-not-exist"));
             return;
         }
 
-        ghostKick.DoDisconnect(player.Channel, reason);
+        _ghostKick.DoDisconnect(player.Channel, reason);
     }
 }
index e8999a7d18ae66fdf7ba5c70d94e9f326e48ed20..6db649a5e7859e56fcf24d701b152ddf0562ea89 100644 (file)
@@ -5,19 +5,21 @@ using Content.Shared.Maps;
 using Robust.Shared.Console;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Interaction;
 
 [AdminCommand(AdminFlags.Debug)]
-public sealed class TilePryCommand : IConsoleCommand
+public sealed class TilePryCommand : LocalizedEntityCommands
 {
-    [Dependency] private readonly IEntityManager _entities = default!;
+    [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
+    [Dependency] private readonly SharedMapSystem _mapSystem = default!;
 
-    public string Command => "tilepry";
-    public string Description => "Pries up all tiles in a radius around the user.";
-    public string Help => $"Usage: {Command} <radius>";
+    private readonly string _platingId = "Plating";
 
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    public override string Command => "tilepry";
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
         var player = shell.Player;
         if (player?.AttachedEntity is not { } attached)
@@ -33,39 +35,38 @@ public sealed class TilePryCommand : IConsoleCommand
 
         if (!int.TryParse(args[0], out var radius))
         {
-            shell.WriteError($"{args[0]} isn't a valid integer.");
+            shell.WriteError(Loc.GetString($"cmd-tilepry-arg-must-be-number", ("arg", args[0])));
             return;
         }
 
         if (radius < 0)
         {
-            shell.WriteError("Radius must be positive.");
+            shell.WriteError(Loc.GetString($"cmd-tilepry-radius-must-be-positive"));
             return;
         }
 
-        var mapSystem = _entities.System<SharedMapSystem>();
-        var xform = _entities.GetComponent<TransformComponent>(attached);
+        var xform = EntityManager.GetComponent<TransformComponent>(attached);
 
         var playerGrid = xform.GridUid;
 
-        if (!_entities.TryGetComponent<MapGridComponent>(playerGrid, out var mapGrid))
+        if (!EntityManager.TryGetComponent<MapGridComponent>(playerGrid, out var mapGrid))
             return;
 
         var playerPosition = xform.Coordinates;
-        var tileDefinitionManager = IoCManager.Resolve<ITileDefinitionManager>();
 
         for (var i = -radius; i <= radius; i++)
         {
             for (var j = -radius; j <= radius; j++)
             {
-                var tile = mapSystem.GetTileRef(playerGrid.Value, mapGrid, playerPosition.Offset(new Vector2(i, j)));
-                var coordinates = mapSystem.GridTileToLocal(playerGrid.Value, mapGrid, tile.GridIndices);
-                var tileDef = (ContentTileDefinition)tileDefinitionManager[tile.Tile.TypeId];
+                var tile = _mapSystem.GetTileRef(playerGrid.Value, mapGrid, playerPosition.Offset(new Vector2(i, j)));
+                var coordinates = _mapSystem.GridTileToLocal(playerGrid.Value, mapGrid, tile.GridIndices);
+                var tileDef = (ContentTileDefinition)_tileDefinitionManager[tile.Tile.TypeId];
 
-                if (!tileDef.CanCrowbar) continue;
+                if (!tileDef.CanCrowbar)
+                    continue;
 
-                var plating = tileDefinitionManager["Plating"];
-                mapSystem.SetTile(playerGrid.Value, mapGrid, coordinates, new Tile(plating.TileId));
+                var plating = _tileDefinitionManager[_platingId];
+                _mapSystem.SetTile(playerGrid.Value, mapGrid, coordinates, new Tile(plating.TileId));
             }
         }
     }
index 7482ef811fc944370048a58ea158408fc0d49056..96a21573f6db07318a1bfed0b6be155d586423e9 100644 (file)
@@ -13,24 +13,24 @@ using Robust.Shared.Utility;
 namespace Content.Server.Mapping
 {
     [AdminCommand(AdminFlags.Server | AdminFlags.Mapping)]
-    sealed class MappingCommand : IConsoleCommand
+    public sealed class MappingCommand : LocalizedEntityCommands
     {
-        [Dependency] private readonly IEntityManager _entities = default!;
+        [Dependency] private readonly IResourceManager _resourceMgr = default!;
+        [Dependency] private readonly SharedMapSystem _mapSystem = default!;
+        [Dependency] private readonly MappingSystem _mappingSystem = default!;
+        [Dependency] private readonly MapLoaderSystem _mapLoader = default!;
 
-        public string Command => "mapping";
-        public string Description => Loc.GetString("cmd-mapping-desc");
-        public string Help => Loc.GetString("cmd-mapping-help");
+        public override string Command => "mapping";
 
-        public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
+        public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
         {
             switch (args.Length)
             {
                 case 1:
                     return CompletionResult.FromHint(Loc.GetString("cmd-hint-mapping-id"));
                 case 2:
-                    var res = IoCManager.Resolve<IResourceManager>();
-                    var opts = CompletionHelper.UserFilePath(args[1], res.UserData)
-                        .Concat(CompletionHelper.ContentFilePath(args[1], res));
+                    var opts = CompletionHelper.UserFilePath(args[1], _resourceMgr.UserData)
+                        .Concat(CompletionHelper.ContentFilePath(args[1], _resourceMgr));
                     return CompletionResult.FromHintOptions(opts, Loc.GetString("cmd-hint-mapping-path"));
                 case 3:
                     return CompletionResult.FromHintOptions(["false", "true"], Loc.GetString("cmd-mapping-hint-grid"));
@@ -38,7 +38,7 @@ namespace Content.Server.Mapping
             return CompletionResult.Empty;
         }
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             if (shell.Player is not { } player)
             {
@@ -65,7 +65,7 @@ namespace Content.Server.Mapping
 
             MapId mapId;
             string? toLoad = null;
-            var mapSys = _entities.System<SharedMapSystem>();
+
             Entity<MapGridComponent>? grid = null;
 
             // Get the map ID to use
@@ -86,7 +86,7 @@ namespace Content.Server.Mapping
                     return;
                 }
 
-                if (mapSys.MapExists(mapId))
+                if (_mapSystem.MapExists(mapId))
                 {
                     shell.WriteError(Loc.GetString("cmd-mapping-exists", ("mapId", mapId)));
                     return;
@@ -95,26 +95,25 @@ namespace Content.Server.Mapping
                 // either load a map or create a new one.
                 if (args.Length <= 1)
                 {
-                    mapSys.CreateMap(mapId, runMapInit: false);
+                    _mapSystem.CreateMap(mapId, runMapInit: false);
                 }
                 else
                 {
                     var path = new ResPath(args[1]);
                     toLoad = path.FilenameWithoutExtension;
                     var opts = new DeserializationOptions {StoreYamlUids = true};
-                    var loader = _entities.System<MapLoaderSystem>();
 
                     if (isGrid == true)
                     {
-                        mapSys.CreateMap(mapId, runMapInit: false);
-                        if (!loader.TryLoadGrid(mapId, path, out grid, opts))
+                        _mapSystem.CreateMap(mapId, runMapInit: false);
+                        if (!_mapLoader.TryLoadGrid(mapId, path, out grid, opts))
                         {
                             shell.WriteError(Loc.GetString("cmd-mapping-error"));
-                            mapSys.DeleteMap(mapId);
+                            _mapSystem.DeleteMap(mapId);
                             return;
                         }
                     }
-                    else if (!loader.TryLoadMapWithId(mapId, path, out _, out _, opts))
+                    else if (!_mapLoader.TryLoadMapWithId(mapId, path, out _, out _, opts))
                     {
                         if (isGrid == false)
                         {
@@ -125,31 +124,29 @@ namespace Content.Server.Mapping
                         // isGrid was not specified and loading it as a map failed, so we fall back to trying to load
                         // the file as a grid
                         shell.WriteLine(Loc.GetString("cmd-mapping-try-grid"));
-                        mapSys.CreateMap(mapId, runMapInit: false);
-                        if (!loader.TryLoadGrid(mapId, path, out grid, opts))
+                        _mapSystem.CreateMap(mapId, runMapInit: false);
+                        if (!_mapLoader.TryLoadGrid(mapId, path, out grid, opts))
                         {
                             shell.WriteError(Loc.GetString("cmd-mapping-error"));
-                            mapSys.DeleteMap(mapId);
+                            _mapSystem.DeleteMap(mapId);
                             return;
                         }
                     }
                 }
 
                 // was the map actually created or did it fail somehow?
-                if (!mapSys.MapExists(mapId))
+                if (!_mapSystem.MapExists(mapId))
                 {
                     shell.WriteError(Loc.GetString("cmd-mapping-error"));
                     return;
                 }
             }
             else
-            {
-                mapSys.CreateMap(out mapId, runMapInit: false);
-            }
+                _mapSystem.CreateMap(out mapId, runMapInit: false);
 
             // map successfully created. run misc helpful mapping commands
             if (player.AttachedEntity is { Valid: true } playerEntity &&
-                _entities.GetComponent<MetaDataComponent>(playerEntity).EntityPrototype?.ID != GameTicker.AdminObserverPrototypeName)
+                EntityManager.GetComponent<MetaDataComponent>(playerEntity).EntityPrototype?.ID != GameTicker.AdminObserverPrototypeName)
             {
                 shell.ExecuteCommand("aghost");
             }
@@ -158,15 +155,14 @@ namespace Content.Server.Mapping
             shell.ExecuteCommand("changecvar events.enabled false");
             shell.ExecuteCommand("changecvar shuttle.auto_call_time 0");
 
-            var auto = _entities.System<MappingSystem>();
             if (grid != null)
-                auto.ToggleAutosave(grid.Value.Owner, toLoad ?? "NEWGRID");
+                _mappingSystem.ToggleAutosave(grid.Value.Owner, toLoad ?? "NEWGRID");
             else
-                auto.ToggleAutosave(mapId, toLoad ?? "NEWMAP");
+                _mappingSystem.ToggleAutosave(mapId, toLoad ?? "NEWMAP");
 
             shell.ExecuteCommand($"tp 0 0 {mapId}");
             shell.RemoteExecuteCommand("mappingclientsidesetup");
-            DebugTools.Assert(mapSys.IsPaused(mapId));
+            DebugTools.Assert(_mapSystem.IsPaused(mapId));
 
             if (args.Length != 2)
                 shell.WriteLine(Loc.GetString("cmd-mapping-success", ("mapId", mapId)));
index 897b9c08efe80706c4e5b5de186002d4c4377545..8050a65ec56329124db5f96d000eb01a50c1e361 100644 (file)
@@ -9,25 +9,21 @@ namespace Content.Server.Maps;
 /// Toggles GridDragging on the system.
 /// </summary>
 [AdminCommand(AdminFlags.Fun)]
-public sealed class GridDraggingCommand : IConsoleCommand
+public sealed class GridDraggingCommand : LocalizedEntityCommands
 {
-    public string Command => SharedGridDraggingSystem.CommandName;
-    public string Description => $"Allows someone with permissions to drag grids around.";
-    public string Help => $"{Command}";
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    [Dependency] private readonly GridDraggingSystem _grid = default!;
+
+    public override string Command => SharedGridDraggingSystem.CommandName;
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
         if (shell.Player == null)
         {
-            shell.WriteError("shell-server-cannot");
+            shell.WriteError("shell-only-players-can-run-this-command");
             return;
         }
 
-        var system = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<GridDraggingSystem>();
-        system.Toggle(shell.Player);
-
-        if (system.IsEnabled(shell.Player))
-            shell.WriteLine("Grid dragging toggled on");
-        else
-            shell.WriteLine("Grid dragging toggled off");
+        _grid.Toggle(shell.Player);
+        shell.WriteLine(Loc.GetString($"cmd-griddrag-status", ("status", _grid.IsEnabled(shell.Player))));
     }
 }
index c365702a3142066d2363a53a24a26babec9844ae..bd9d15d549fd306404d8c4a1bf2c2820fd169de4 100644 (file)
@@ -9,41 +9,38 @@ using Robust.Shared.Console;
 namespace Content.Server.Mind.Commands
 {
     [AdminCommand(AdminFlags.Admin)]
-    public sealed class MindInfoCommand : IConsoleCommand
+    public sealed class MindInfoCommand : LocalizedEntityCommands
     {
-        [Dependency] private readonly IEntityManager _entities = default!;
+        [Dependency] private readonly IPlayerManager _playerManager = default!;
+        [Dependency] private readonly SharedRoleSystem _roles = default!;
+        [Dependency] private readonly SharedMindSystem _minds = default!;
 
-        public string Command => "mindinfo";
-        public string Description => "Lists info for the mind of a specific player.";
-        public string Help => "mindinfo <session ID>";
+        public override string Command => "mindinfo";
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             if (args.Length != 1)
             {
-                shell.WriteLine("Expected exactly 1 argument.");
+                shell.WriteLine(Loc.GetString($"shell-need-exactly-one-argument"));
                 return;
             }
 
-            var mgr = IoCManager.Resolve<IPlayerManager>();
-            if (!mgr.TryGetSessionByUsername(args[0], out var session))
+            if (!_playerManager.TryGetSessionByUsername(args[0], out var session))
             {
-                shell.WriteLine("Can't find that mind");
+                shell.WriteLine(Loc.GetString($"cmd-mindinfo-mind-not-found"));
                 return;
             }
 
-            var minds = _entities.System<SharedMindSystem>();
-            if (!minds.TryGetMind(session, out var mindId, out var mind))
+            if (!_minds.TryGetMind(session, out var mindId, out var mind))
             {
-                shell.WriteLine("Can't find that mind");
+                shell.WriteLine(Loc.GetString($"cmd-mindinfo-mind-not-found"));
                 return;
             }
 
             var builder = new StringBuilder();
             builder.AppendFormat("player: {0}, mob: {1}\nroles: ", mind.UserId, mind.OwnedEntity);
 
-            var roles = _entities.System<SharedRoleSystem>();
-            foreach (var role in roles.MindGetAllRoleInfo(mindId))
+            foreach (var role in _roles.MindGetAllRoleInfo(mindId))
             {
                 builder.AppendFormat("{0} ", role.Name);
             }
diff --git a/Resources/Locale/en-US/commands/force-map-command.ftl b/Resources/Locale/en-US/commands/force-map-command.ftl
new file mode 100644 (file)
index 0000000..fabd5f0
--- /dev/null
@@ -0,0 +1,6 @@
+cmd-forcemap-desc = Forces the game to start with a given map next round.
+cmd-forcemap-help = Usage: forcemap <map ID>
+cmd-forcemap-success = Forced the game to start with map { $map } next round.
+cmd-forcemap-cleared = Cleared the forced map setting.
+cmd-forcemap-map-not-found = No eligible map exists with name { $map }.
+cmd-forcemap-hint = <map ID>
diff --git a/Resources/Locale/en-US/commands/force-preset-command.ftl b/Resources/Locale/en-US/commands/force-preset-command.ftl
new file mode 100644 (file)
index 0000000..9f534a0
--- /dev/null
@@ -0,0 +1,6 @@
+cmd-forcepreset-desc = Forces a specific game preset to start for the current lobby.
+cmd-forcepreset-help = Usage: forcepreset <preset>
+cmd-forcepreset-preround-lobby-only = This can only be executed while the game is in the pre-round lobby.
+cmd-forcepreset-no-preset-found = No preset exists with name {$preset}.
+cmd-forcepreset-success = Forced the game to start with preset {$preset}.
+cmd-forcepreset-hint = <preset>
diff --git a/Resources/Locale/en-US/commands/ghost-kick-command.ftl b/Resources/Locale/en-US/commands/ghost-kick-command.ftl
new file mode 100644 (file)
index 0000000..fffae96
--- /dev/null
@@ -0,0 +1,3 @@
+cmd-ghostkick-desc = Kick a client from the server as if their network just dropped.
+cmd-ghostkick-help = Usage: ghostkick <Player> [Reason]
+cmd-ghostkick-default-reason = Ghost kicked by console.
diff --git a/Resources/Locale/en-US/commands/go-lobby-command.ftl b/Resources/Locale/en-US/commands/go-lobby-command.ftl
new file mode 100644 (file)
index 0000000..7ba54aa
--- /dev/null
@@ -0,0 +1,4 @@
+cmd-golobby-desc = Enables the lobby and restarts the round.
+cmd-golobby-help = Usage: golobby / golobby <preset>
+cmd-golobby-success = Enabling the lobby and restarting the round.
+cmd-golobby-success-with-preset = Enabling the lobby and restarting the round with preset {$preset}.
diff --git a/Resources/Locale/en-US/commands/grid-drag-command.ftl b/Resources/Locale/en-US/commands/grid-drag-command.ftl
new file mode 100644 (file)
index 0000000..34efa64
--- /dev/null
@@ -0,0 +1,3 @@
+cmd-griddrag-desc = Allows someone with permissions to drag grids around.
+cmd-griddrag-help = Usage: griddrag
+cmd-griddrag-status = Grid dragging set to {$status}.
diff --git a/Resources/Locale/en-US/commands/mind-info-command.ftl b/Resources/Locale/en-US/commands/mind-info-command.ftl
new file mode 100644 (file)
index 0000000..57a1731
--- /dev/null
@@ -0,0 +1,3 @@
+cmd-mindinfo-desc = Lists info for the mind of a specific player.
+cmd-mindinfo-help = Usage: mindinfo <session ID>
+cmd-mindinfo-mind-not-found = Can't find that mind.
diff --git a/Resources/Locale/en-US/commands/tile-pry-command.ftl b/Resources/Locale/en-US/commands/tile-pry-command.ftl
new file mode 100644 (file)
index 0000000..5c7d313
--- /dev/null
@@ -0,0 +1,4 @@
+cmd-tilepry-desc = Pries up all tiles in a radius around the user.
+cmd-tilepry-help = Usage: tilepry <radius>
+cmd-tilepry-radius-must-be-positive = Radius must be positive.
+cmd-tilepry-arg-must-be-number = {$arg} isn't a valid integer.
diff --git a/Resources/Locale/en-US/game-ticking/forcemap-command.ftl b/Resources/Locale/en-US/game-ticking/forcemap-command.ftl
deleted file mode 100644 (file)
index 573aa78..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-## Forcemap command loc.
-
-forcemap-command-description = Forces the game to start with a given map next round.
-forcemap-command-help = forcemap <map ID>
-forcemap-command-need-one-argument = forcemap takes one argument, the path to the map file.
-forcemap-command-map-not-found = No eligible map exists with name { $map }.
-forcemap-command-success = Forced the game to start with map { $map } next round.
-forcemap-command-cleared = Cleared the forced map setting.
-forcemap-command-arg-map = <map ID>