]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Command resolve mega pr 6 (#38398)
authorKyle Tyo <36606155+VerinSenpai@users.noreply.github.com>
Tue, 17 Jun 2025 17:22:03 +0000 (13:22 -0400)
committerGitHub <noreply@github.com>
Tue, 17 Jun 2025 17:22:03 +0000 (19:22 +0200)
commit progress

19 files changed:
Content.Server/Administration/Commands/AdminWhoCommand.cs
Content.Server/Administration/Commands/AnnounceUiCommand.cs
Content.Server/Administration/Commands/DeAdminCommand.cs
Content.Server/Administration/Commands/DeleteComponent.cs
Content.Server/Administration/Commands/ExplosionCommand.cs
Content.Server/Administration/Commands/FaxUiCommand.cs
Content.Server/Administration/Commands/LoadGameMapCommand.cs
Content.Server/Administration/Commands/OpenAdminLogsCommand.cs
Content.Server/Administration/Commands/OpenPermissionsCommand.cs
Content.Server/Administration/Commands/PardonCommand.cs
Resources/Locale/en-US/administration/ui/admin-announce-window.ftl
Resources/Locale/en-US/administration/ui/admin-spawn-explosion-eui.ftl
Resources/Locale/en-US/administration/ui/permissions-eui.ftl
Resources/Locale/en-US/commands/admin-logs-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/admin-who-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/deadmin-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/delete-component-command.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/map-commands.ftl [new file with mode: 0644]
Resources/Locale/en-US/commands/pardon-command.ftl [new file with mode: 0644]

index ee5c362a4d5b4428bc97c32783d14dd3962fe5bd..0866aed78ad1dd82704855f86b850a517bbb0206 100644 (file)
@@ -8,32 +8,30 @@ using Robust.Shared.Utility;
 namespace Content.Server.Administration.Commands;
 
 [AdminCommand(AdminFlags.AdminWho)]
-public sealed class AdminWhoCommand : IConsoleCommand
+public sealed class AdminWhoCommand : LocalizedCommands
 {
-    public string Command => "adminwho";
-    public string Description => "Returns a list of all admins on the server";
-    public string Help => "Usage: adminwho";
+    [Dependency] private readonly IAfkManager _afkManager = default!;
+    [Dependency] private readonly IAdminManager _adminManager = default!;
 
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
-    {
-        var adminMgr = IoCManager.Resolve<IAdminManager>();
-        var afk = IoCManager.Resolve<IAfkManager>();
+    public override string Command => "adminwho";
 
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
+    {
         var seeStealth = true;
 
         // If null it (hopefully) means it is being called from the console.
         if (shell.Player != null)
         {
-            var playerData = adminMgr.GetAdminData(shell.Player);
+            var playerData = _adminManager.GetAdminData(shell.Player);
 
             seeStealth = playerData != null && playerData.CanStealth();
         }
 
         var sb = new StringBuilder();
         var first = true;
-        foreach (var admin in adminMgr.ActiveAdmins)
+        foreach (var admin in _adminManager.ActiveAdmins)
         {
-            var adminData = adminMgr.GetAdminData(admin)!;
+            var adminData = _adminManager.GetAdminData(admin)!;
             DebugTools.AssertNotNull(adminData);
 
             if (adminData.Stealth && !seeStealth)
@@ -50,9 +48,9 @@ public sealed class AdminWhoCommand : IConsoleCommand
             if (adminData.Stealth)
                 sb.Append(" (S)");
 
-            if (shell.Player is { } player && adminMgr.HasAdminFlag(player, AdminFlags.Admin))
+            if (shell.Player is { } player && _adminManager.HasAdminFlag(player, AdminFlags.Admin))
             {
-                if (afk.IsAfk(admin))
+                if (_afkManager.IsAfk(admin))
                     sb.Append(" [AFK]");
             }
         }
index abb9235a3af3a26cc095e110565fc9e2680ec9ef..55a913b80e5d55083029b7c92c4557efff8a1893 100644 (file)
@@ -6,26 +6,23 @@ using Robust.Shared.Console;
 namespace Content.Server.Administration.Commands
 {
     [AdminCommand(AdminFlags.Moderator)]
-    public sealed class AnnounceUiCommand : IConsoleCommand
+    public sealed class AnnounceUiCommand : LocalizedEntityCommands
     {
-        public string Command => "announceui";
+        [Dependency] private readonly EuiManager _euiManager = default!;
 
-        public string Description => "Opens the announcement UI";
+        public override string Command => "announceui";
 
-        public string Help => $"{Command}";
-
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             var player = shell.Player;
             if (player == null)
             {
-                shell.WriteLine("This does not work from the server console.");
+                shell.WriteLine(Loc.GetString($"shell-cannot-run-command-from-server"));
                 return;
             }
 
-            var eui = IoCManager.Resolve<EuiManager>();
             var ui = new AdminAnnounceEui();
-            eui.OpenEui(ui, player);
+            _euiManager.OpenEui(ui, player);
         }
     }
 }
index cf659412008ecbae77ee24d37284af8948084c46..3979c93bd70b3d014078904cda423362e90b0521 100644 (file)
@@ -7,23 +7,22 @@ namespace Content.Server.Administration.Commands
 {
     [UsedImplicitly]
     [AdminCommand(AdminFlags.None)]
-    public sealed class DeAdminCommand : IConsoleCommand
+    public sealed class DeAdminCommand : LocalizedCommands
     {
-        public string Command => "deadmin";
-        public string Description => "Temporarily de-admins you so you can experience the round as a normal player.";
-        public string Help => "Usage: deadmin\nUse readmin to re-admin after using this.";
+        [Dependency] private readonly IAdminManager _admin = default!;
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override string Command => "deadmin";
+
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             var player = shell.Player;
             if (player == null)
             {
-                shell.WriteLine("You cannot use this command from the server console.");
+                shell.WriteLine(Loc.GetString($"shell-cannot-run-command-from-server"));
                 return;
             }
 
-            var mgr = IoCManager.Resolve<IAdminManager>();
-            mgr.DeAdmin(player);
+            _admin.DeAdmin(player);
         }
     }
 }
index f4b2a007605d2e9c926f92a23eece8c7c982579a..c569a8375f74238c68ec55edff5b2abe74a76000 100644 (file)
@@ -4,42 +4,40 @@ using Robust.Shared.Console;
 namespace Content.Server.Administration.Commands
 {
     [AdminCommand(AdminFlags.Spawn)]
-    public sealed class DeleteComponent : IConsoleCommand
+    public sealed class DeleteComponent : LocalizedEntityCommands
     {
-        public string Command => "deletecomponent";
-        public string Description => "Deletes all instances of the specified component.";
-        public string Help => $"Usage: {Command} <name>";
+        [Dependency] private readonly IComponentFactory _compFactory = default!;
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override string Command => "deletecomponent";
+
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             switch (args.Length)
             {
                 case 0:
-                    shell.WriteLine($"Not enough arguments.\n{Help}");
+                    shell.WriteLine(Loc.GetString($"shell-need-exactly-one-argument"));
                     break;
                 default:
                     var name = string.Join(" ", args);
-                    var componentFactory = IoCManager.Resolve<IComponentFactory>();
-                    var entityManager = IoCManager.Resolve<IEntityManager>();
 
-                    if (!componentFactory.TryGetRegistration(name, out var registration))
+                    if (!_compFactory.TryGetRegistration(name, out var registration))
                     {
-                        shell.WriteLine($"No component exists with name {name}.");
+                        shell.WriteLine(Loc.GetString($"cmd-deletecomponent-no-component-exists", ("name", name)));
                         break;
                     }
 
                     var componentType = registration.Type;
-                    var components = entityManager.GetAllComponents(componentType, true);
+                    var components = EntityManager.GetAllComponents(componentType, true);
 
                     var i = 0;
 
                     foreach (var (uid, component) in components)
                     {
-                        entityManager.RemoveComponent(uid, component);
+                        EntityManager.RemoveComponent(uid, component);
                         i++;
                     }
 
-                    shell.WriteLine($"Removed {i} components with name {name}.");
+                    shell.WriteLine(Loc.GetString($"cmd-deletecomponent-success", ("count", i), ("name", name)));
 
                     break;
             }
index c916a7cb5f35ddda5c9a632caa340b035a2149be..787886f164a36a61f078f993474621072f067c39 100644 (file)
@@ -13,72 +13,73 @@ using Robust.Server.GameObjects;
 namespace Content.Server.Administration.Commands;
 
 [AdminCommand(AdminFlags.Fun)]
-public sealed class OpenExplosionEui : IConsoleCommand
+public sealed class OpenExplosionEui : LocalizedEntityCommands
 {
-    public string Command => "explosionui";
-    public string Description => "Opens a window for easy access to station destruction";
-    public string Help => $"Usage: {Command}";
+    [Dependency] private readonly EuiManager _euiManager = default!;
 
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    public override string Command => "explosionui";
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
         var player = shell.Player;
         if (player == null)
         {
-            shell.WriteError("This does not work from the server console.");
+            shell.WriteError(Loc.GetString($"shell-cannot-run-command-from-server"));
             return;
         }
 
-        var eui = IoCManager.Resolve<EuiManager>();
         var ui = new SpawnExplosionEui();
-        eui.OpenEui(ui, player);
+        _euiManager.OpenEui(ui, player);
     }
 }
 
 [AdminCommand(AdminFlags.Fun)] // for the admin. Not so much for anyone else.
-public sealed class ExplosionCommand : IConsoleCommand
+public sealed class ExplosionCommand : LocalizedEntityCommands
 {
-    public string Command => "explosion";
-    public string Description => "Train go boom";
+    [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+    [Dependency] private readonly ExplosionSystem _explosion = default!;
+    [Dependency] private readonly TransformSystem _transform = default!;
+
+    public override string Command => "explosion";
 
     // Note that if you change the arguments, you should also update the client-side SpawnExplosionWindow, as that just
     // uses this command.
-    public string Help => "Usage: explosion [intensity] [slope] [maxIntensity] [x y] [mapId] [prototypeId]";
-
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
         if (args.Length == 0 || args.Length == 4 || args.Length > 7)
         {
-            shell.WriteError("Wrong number of arguments.");
+            shell.WriteError(Loc.GetString($"shell-wrong-arguments-number"));
             return;
         }
 
         if (!float.TryParse(args[0], out var intensity))
         {
-            shell.WriteError($"Failed to parse intensity: {args[0]}");
+            shell.WriteError(Loc.GetString($"cmd-explosion-failed-to-parse-intensity", ("value", args[0])));
             return;
         }
 
         float slope = 5;
         if (args.Length > 1 && !float.TryParse(args[1], out slope))
         {
-            shell.WriteError($"Failed to parse float: {args[1]}");
+            shell.WriteError(Loc.GetString($"cmd-explosion-failed-to-parse-float", ("value", args[1])));
             return;
         }
 
         float maxIntensity = 100;
         if (args.Length > 2 && !float.TryParse(args[2], out maxIntensity))
         {
-            shell.WriteError($"Failed to parse float: {args[2]}");
+            shell.WriteError(Loc.GetString($"cmd-explosion-failed-to-parse-float", ("value", args[2])));
             return;
         }
 
         float x = 0, y = 0;
         if (args.Length > 4)
         {
-            if (!float.TryParse(args[3], out x) ||
-                !float.TryParse(args[4], out y))
+            if (!float.TryParse(args[3], out x) || !float.TryParse(args[4], out y))
             {
-                shell.WriteError($"Failed to parse coordinates: {(args[3], args[4])}");
+                shell.WriteError(Loc.GetString($"cmd-explosion-failed-to-parse-coords",
+                    ("value1", args[3]),
+                    ("value2", args[4])));
                 return;
             }
         }
@@ -88,7 +89,7 @@ public sealed class ExplosionCommand : IConsoleCommand
         {
             if (!int.TryParse(args[5], out var parsed))
             {
-                shell.WriteError($"Failed to parse map ID: {args[5]}");
+                shell.WriteError(Loc.GetString($"cmd-explosion-failed-to-parse-map-id", ("value", args[5])));
                 return;
             }
             coords = new MapCoordinates(new Vector2(x, y), new(parsed));
@@ -96,42 +97,39 @@ public sealed class ExplosionCommand : IConsoleCommand
         else
         {
             // attempt to find the player's current position
-            var entMan = IoCManager.Resolve<IEntityManager>();
-            if (!entMan.TryGetComponent(shell.Player?.AttachedEntity, out TransformComponent? xform))
+            if (!EntityManager.TryGetComponent(shell.Player?.AttachedEntity, out TransformComponent? xform))
             {
-                shell.WriteError($"Failed get default coordinates/map via player's transform. Need to specify explicitly.");
+                shell.WriteError(Loc.GetString($"cmd-explosion-need-coords-explicit"));
                 return;
             }
 
             if (args.Length > 4)
                 coords = new MapCoordinates(new Vector2(x, y), xform.MapID);
             else
-                coords = entMan.System<TransformSystem>().GetMapCoordinates(shell.Player.AttachedEntity.Value, xform: xform);
+                coords = _transform.GetMapCoordinates(shell.Player.AttachedEntity.Value, xform: xform);
         }
 
         ExplosionPrototype? type;
-        var protoMan = IoCManager.Resolve<IPrototypeManager>();
         if (args.Length > 6)
         {
-            if (!protoMan.TryIndex(args[6], out type))
+            if (!_prototypeManager.TryIndex(args[6], out type))
             {
-                shell.WriteError($"Unknown explosion prototype: {args[6]}");
+                shell.WriteError(Loc.GetString($"cmd-explosion-unknown-prototype", ("value", args[6])));
                 return;
             }
         }
-        else if (!protoMan.TryIndex(ExplosionSystem.DefaultExplosionPrototypeId, out type))
+        else if (!_prototypeManager.TryIndex(ExplosionSystem.DefaultExplosionPrototypeId, out type))
         {
             // no prototype was specified, so lets default to whichever one was defined first
-            type = protoMan.EnumeratePrototypes<ExplosionPrototype>().FirstOrDefault();
+            type = _prototypeManager.EnumeratePrototypes<ExplosionPrototype>().FirstOrDefault();
 
             if (type == null)
             {
-                shell.WriteError($"Prototype manager has no explosion prototypes?");
+                shell.WriteError(Loc.GetString($"cmd-explosion-no-prototypes"));
                 return;
             }
         }
 
-        var sysMan = IoCManager.Resolve<IEntitySystemManager>();
-        sysMan.GetEntitySystem<ExplosionSystem>().QueueExplosion(coords, type.ID, intensity, slope, maxIntensity, null);
+        _explosion.QueueExplosion(coords, type.ID, intensity, slope, maxIntensity, null);
     }
 }
index c1103f47d8f0498f23265b41dcf78b0a4ce32983..4b788375bdaeab8b6a1bf32df01c3a8d422ab214 100644 (file)
@@ -6,14 +6,13 @@ using Robust.Shared.Console;
 namespace Content.Server.Administration.Commands;
 
 [AdminCommand(AdminFlags.Fun)]
-public sealed class FaxUiCommand : IConsoleCommand
+public sealed class FaxUiCommand : LocalizedEntityCommands
 {
-    public string Command => "faxui";
+    [Dependency] private readonly EuiManager _euiManager = default!;
 
-    public string Description => Loc.GetString("cmd-faxui-desc");
-    public string Help => Loc.GetString("cmd-faxui-help");
+    public override string Command => "faxui";
 
-    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)
         {
@@ -21,8 +20,7 @@ public sealed class FaxUiCommand : IConsoleCommand
             return;
         }
 
-        var eui = IoCManager.Resolve<EuiManager>();
         var ui = new AdminFaxEui();
-        eui.OpenEui(ui, player);
+        _euiManager.OpenEui(ui, player);
     }
 }
index 034b50a9c5e4485b0947376cc66488f0fe0ced3d..dfe18ea5bca95390be5bc5938940b7818af2fb2a 100644 (file)
@@ -3,42 +3,36 @@ using Content.Server.GameTicking;
 using Content.Server.Maps;
 using Content.Shared.Administration;
 using Robust.Shared.Console;
-using Robust.Shared.EntitySerialization;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
 
 namespace Content.Server.Administration.Commands
 {
     [AdminCommand(AdminFlags.Round | AdminFlags.Spawn)]
-    public sealed class LoadGameMapCommand : IConsoleCommand
+    public sealed class LoadGameMapCommand : LocalizedEntityCommands
     {
-        public string Command => "loadgamemap";
+        [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+        [Dependency] private readonly GameTicker _gameTicker = default!;
+        [Dependency] private readonly SharedMapSystem _mapSystem = default!;
 
-        public string Description => "Loads the given game map at the given coordinates.";
+        public override string Command => "loadgamemap";
 
-        public string Help => "loadgamemap <mapid> <gamemap> [<x> <y> [<name>]] ";
-
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
-            var entityManager = IoCManager.Resolve<IEntityManager>();
-            var gameTicker = entityManager.EntitySysManager.GetEntitySystem<GameTicker>();
-            var mapSys = entityManager.EntitySysManager.GetEntitySystem<SharedMapSystem>();
-
             if (args.Length is not (2 or 4 or 5))
             {
                 shell.WriteError(Loc.GetString("shell-wrong-arguments-number"));
                 return;
             }
 
-            if (!prototypeManager.TryIndex<GameMapPrototype>(args[1], out var gameMap))
+            if (!_prototypeManager.TryIndex<GameMapPrototype>(args[1], out var gameMap))
             {
                 shell.WriteError($"The given map prototype {args[0]} is invalid.");
                 return;
             }
 
             if (!int.TryParse(args[0], out var mapId))
-                    return;
+                return;
 
             var stationName = args.Length == 5 ? args[4] : null;
 
@@ -48,14 +42,14 @@ namespace Content.Server.Administration.Commands
 
             var id = new MapId(mapId);
 
-            var grids = mapSys.MapExists(id)
-                ? gameTicker.MergeGameMap(gameMap, id, stationName: stationName, offset: offset)
-                : gameTicker.LoadGameMapWithId(gameMap, id, stationName: stationName, offset: offset);
+            var grids = _mapSystem.MapExists(id)
+                ? _gameTicker.MergeGameMap(gameMap, id, stationName: stationName, offset: offset)
+                : _gameTicker.LoadGameMapWithId(gameMap, id, stationName: stationName, offset: offset);
 
             shell.WriteLine($"Loaded {grids.Count} grids.");
         }
 
-        public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
+        public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
         {
             switch (args.Length)
             {
@@ -79,26 +73,20 @@ namespace Content.Server.Administration.Commands
     }
 
     [AdminCommand(AdminFlags.Round | AdminFlags.Spawn)]
-    public sealed class ListGameMaps : IConsoleCommand
+    public sealed class ListGameMaps : LocalizedCommands
     {
-        public string Command => "listgamemaps";
+        [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
 
-        public string Description => "Lists the game maps that can be used by loadgamemap";
+        public override string Command => "listgamemaps";
 
-        public string Help => "listgamemaps";
-
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
-            var entityManager = IoCManager.Resolve<IEntityManager>();
-            var gameTicker = entityManager.EntitySysManager.GetEntitySystem<GameTicker>();
-
             if (args.Length != 0)
             {
                 shell.WriteError(Loc.GetString("shell-wrong-arguments-number"));
                 return;
             }
-            foreach (var prototype in prototypeManager.EnumeratePrototypes<GameMapPrototype>())
+            foreach (var prototype in _prototypeManager.EnumeratePrototypes<GameMapPrototype>())
             {
                 shell.WriteLine($"{prototype.ID} - {prototype.MapName}");
             }
index 5572fa542bd552e6cd4c54b7f0fb480325a52b41..1beaaa928e35f18848b37d534aad39bd8ff40ad7 100644 (file)
@@ -6,13 +6,13 @@ using Robust.Shared.Console;
 namespace Content.Server.Administration.Commands;
 
 [AdminCommand(AdminFlags.Logs)]
-public sealed class OpenAdminLogsCommand : IConsoleCommand
+public sealed class OpenAdminLogsCommand : LocalizedEntityCommands
 {
-    public string Command => "adminlogs";
-    public string Description => "Opens the admin logs panel.";
-    public string Help => $"Usage: {Command}";
+    [Dependency] private readonly EuiManager _euiManager = default!;
 
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    public override string Command => "adminlogs";
+
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
         if (shell.Player is not { } player)
         {
@@ -20,8 +20,7 @@ public sealed class OpenAdminLogsCommand : IConsoleCommand
             return;
         }
 
-        var eui = IoCManager.Resolve<EuiManager>();
         var ui = new AdminLogsEui();
-        eui.OpenEui(ui, player);
+        _euiManager.OpenEui(ui, player);
     }
 }
index fd3227d4aafa7ff88ef3b44017f13ee2a732f87b..14167931e81066f1dc449c328be9195bf968c6c8 100644 (file)
@@ -6,24 +6,23 @@ using Robust.Shared.Console;
 namespace Content.Server.Administration.Commands
 {
     [AdminCommand(AdminFlags.Permissions)]
-    public sealed class OpenPermissionsCommand : IConsoleCommand
+    public sealed class OpenPermissionsCommand : LocalizedEntityCommands
     {
-        public string Command => "permissions";
-        public string Description => "Opens the admin permissions panel.";
-        public string Help => "Usage: permissions";
+        [Dependency] private readonly EuiManager _euiManager = default!;
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override string Command => "permissions";
+
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             var player = shell.Player;
             if (player == null)
             {
-                shell.WriteLine("This does not work from the server console.");
+                shell.WriteLine(Loc.GetString($"shell-cannot-run-command-from-server"));
                 return;
             }
 
-            var eui = IoCManager.Resolve<EuiManager>();
             var ui = new PermissionsEui();
-            eui.OpenEui(ui, player);
+            _euiManager.OpenEui(ui, player);
         }
     }
 }
index 9cbaaece310fc4264b3481f85898d3752efaabdf..5c4417a966f4888df0059b1ae4302b222ef2f99a 100644 (file)
@@ -1,21 +1,19 @@
-using System.Text;
-using Content.Server.Database;
+using Content.Server.Database;
 using Content.Shared.Administration;
 using Robust.Shared.Console;
 
 namespace Content.Server.Administration.Commands
 {
     [AdminCommand(AdminFlags.Ban)]
-    public sealed class PardonCommand : IConsoleCommand
+    public sealed class PardonCommand : LocalizedCommands
     {
-        public string Command => "pardon";
-        public string Description => "Pardons somebody's ban";
-        public string Help => $"Usage: {Command} <ban id>";
+        [Dependency] private readonly IServerDbManager _dbManager = default!;
 
-        public async void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override string Command => "pardon";
+
+        public override async void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             var player = shell.Player;
-            var dbMan = IoCManager.Resolve<IServerDbManager>();
 
             if (args.Length != 1)
             {
@@ -25,11 +23,11 @@ namespace Content.Server.Administration.Commands
 
             if (!int.TryParse(args[0], out var banId))
             {
-                shell.WriteLine($"Unable to parse {args[0]} as a ban id integer.\n{Help}");
+                shell.WriteLine(Loc.GetString($"cmd-pardon-unable-to-parse", ("id", args[0]), ("help", Help)));
                 return;
             }
 
-            var ban = await dbMan.GetServerBanAsync(banId);
+            var ban = await _dbManager.GetServerBanAsync(banId);
 
             if (ban == null)
             {
@@ -39,22 +37,22 @@ namespace Content.Server.Administration.Commands
 
             if (ban.Unban != null)
             {
-                var response = new StringBuilder("This ban has already been pardoned");
-
                 if (ban.Unban.UnbanningAdmin != null)
                 {
-                    response.Append($" by {ban.Unban.UnbanningAdmin.Value}");
+                    shell.WriteLine(Loc.GetString($"cmd-pardon-already-pardoned-specific",
+                        ("admin", ban.Unban.UnbanningAdmin.Value),
+                        ("time", ban.Unban.UnbanTime)));
                 }
 
-                response.Append($" in {ban.Unban.UnbanTime}.");
+                else
+                    shell.WriteLine(Loc.GetString($"cmd-pardon-already-pardoned"));
 
-                shell.WriteLine(response.ToString());
                 return;
             }
 
-            await dbMan.AddServerUnbanAsync(new ServerUnbanDef(banId, player?.UserId, DateTimeOffset.Now));
+            await _dbManager.AddServerUnbanAsync(new ServerUnbanDef(banId, player?.UserId, DateTimeOffset.Now));
 
-            shell.WriteLine($"Pardoned ban with id {banId}");
+            shell.WriteLine(Loc.GetString($"cmd-pardon-success", ("id", banId)));
         }
     }
 }
index 1db8cfad25f9ab6c34578338276e50b0e587beb7..d4341b99bc16008dce52381ec145d8a6d2308d61 100644 (file)
@@ -6,3 +6,6 @@ admin-announce-button = Announce
 admin-announce-type-station = Station
 admin-announce-type-server = Server
 admin-announce-keep-open = Keep open
+
+cmd-announceui-desc = Opens the announcement UI.
+cmd-announceui-help = Usage: announceui
index 85f4a065f494f019de7b8b3a1911de4e91b02904..1d30c5d9fc4236e1279d19f6544923125ef29ddf 100644 (file)
@@ -13,4 +13,17 @@ admin-explosion-eui-label-directional = Directional
 admin-explosion-eui-label-angle = Angle
 admin-explosion-eui-label-spread = Spread
 admin-explosion-eui-label-distance = Distance
-admin-explosion-eui-label-spawn = Kabloom!
\ No newline at end of file
+admin-explosion-eui-label-spawn = Kabloom!
+
+cmd-explosionui-desc = Opens a window for easy access to station destruction.
+cmd-explosionui-help = Usage: explosionui
+
+cmd-explosion-desc = Train go boom
+cmd-explosion-help = Usage: explosion [intensity] [slope] [maxIntensity] [x y] [mapId] [prototypeId]
+cmd-explosion-failed-to-parse-intensity = Failed to parse intensity: {$value}
+cmd-explosion-failed-to-parse-float = Failed to parse float: {$value}
+cmd-explosion-failed-to-parse-coords = Failed to parse coordinates: {$value1} {$value2}
+cmd-explosion-failed-to-parse-map-id = Failed to parse map ID: {$value}
+cmd-explosion-need-coords-explicit = Failed get default coordinates/map via player's transform. Need to specify explicitly.
+cmd-explosion-unknown-prototype = Unknown explosion prototype: {$value}
+cmd-explosion-no-prototypes = Prototype manager has no explosion prototypes?
index 228f40f828676dd792ca79e410f3908feb9dbb0f..0ff1f9fb550d8bc1ffb522790a68fec770f9d02c 100644 (file)
@@ -21,3 +21,6 @@ permissions-eui-edit-admin-rank-button = Edit
 permissions-eui-edit-admin-rank-window-title = Edit Admin Rank
 permissions-eui-edit-admin-window-save-button = Save
 permissions-eui-edit-admin-window-remove-flag-button = Remove
+
+cmd-permissions-desc = Opens the admin permissions panel.
+cmd-permissions-help = Usage: permissions
diff --git a/Resources/Locale/en-US/commands/admin-logs-command.ftl b/Resources/Locale/en-US/commands/admin-logs-command.ftl
new file mode 100644 (file)
index 0000000..539c917
--- /dev/null
@@ -0,0 +1,2 @@
+cmd-adminlogs-desc = Opens the admin logs panel.
+cmd-adminlogs-help = Usage: adminlogs
diff --git a/Resources/Locale/en-US/commands/admin-who-command.ftl b/Resources/Locale/en-US/commands/admin-who-command.ftl
new file mode 100644 (file)
index 0000000..05ad540
--- /dev/null
@@ -0,0 +1,2 @@
+cmd-adminwho-desc = Returns a list of all admins on the server.
+cmd-adminwho-help = Usage: adminwho
diff --git a/Resources/Locale/en-US/commands/deadmin-command.ftl b/Resources/Locale/en-US/commands/deadmin-command.ftl
new file mode 100644 (file)
index 0000000..e031595
--- /dev/null
@@ -0,0 +1,3 @@
+cmd-deadmin-desc = Temporarily de-admins you so you can experience the round as a normal player.
+cmd-deadmin-help = Usage: deadmin
+                   Use readmin to re-admin after using this.
diff --git a/Resources/Locale/en-US/commands/delete-component-command.ftl b/Resources/Locale/en-US/commands/delete-component-command.ftl
new file mode 100644 (file)
index 0000000..f8435e4
--- /dev/null
@@ -0,0 +1,4 @@
+cmd-deletecomponent-desc = Deletes all instances of the specified component.
+cmd-deletecomponent-help = Usage: deletecomponent <name>"
+cmd-deletecomponent-no-component-exists = No component exists with name {$name}.
+cmd-deletecomponent-success = Removed {$count} components with name {$name}.
diff --git a/Resources/Locale/en-US/commands/map-commands.ftl b/Resources/Locale/en-US/commands/map-commands.ftl
new file mode 100644 (file)
index 0000000..f5663f6
--- /dev/null
@@ -0,0 +1,5 @@
+cmd-loadgamemap-desc = Loads the given game map at the given coordinates.
+cmd-loadgamemap-help = loadgamemap <mapid> <gamemap> [<x> <y> [<name>]]
+
+cmd-listgamemaps-desc = Lists the game maps that can be used by loadgamemap.
+cmd-listgamemaps-help = Usage: listgamemaps
diff --git a/Resources/Locale/en-US/commands/pardon-command.ftl b/Resources/Locale/en-US/commands/pardon-command.ftl
new file mode 100644 (file)
index 0000000..c934865
--- /dev/null
@@ -0,0 +1,7 @@
+cmd-pardon-desc = Pardon somebody's ban.
+cmd-pardon-help = Usage: pardon <ban id>
+cmd-pardon-unable-to-parse = Unable to parse {$id} as a ban id integer.
+                             {$help}
+cmd-pardon-already-pardoned = This ban has already been pardoned.
+cmd-pardon-already-pardoned-specific = This ban has already been pardoned by {$admin} in {$time}.
+cmd-pardon-success = Pardoned ban with id {$id}.