From 57babe15ee7a5c8fef800ae4782e3772ddfad14b Mon Sep 17 00:00:00 2001 From: Kyle Tyo <36606155+VerinSenpai@users.noreply.github.com> Date: Tue, 17 Jun 2025 13:22:03 -0400 Subject: [PATCH] Command resolve mega pr 6 (#38398) commit progress --- .../Commands/AdminWhoCommand.cs | 24 ++++--- .../Commands/AnnounceUiCommand.cs | 15 ++--- .../Administration/Commands/DeAdminCommand.cs | 15 ++--- .../Commands/DeleteComponent.cs | 24 ++++--- .../Commands/ExplosionCommand.cs | 66 +++++++++---------- .../Administration/Commands/FaxUiCommand.cs | 12 ++-- .../Commands/LoadGameMapCommand.cs | 46 +++++-------- .../Commands/OpenAdminLogsCommand.cs | 13 ++-- .../Commands/OpenPermissionsCommand.cs | 15 ++--- .../Administration/Commands/PardonCommand.cs | 32 +++++---- .../ui/admin-announce-window.ftl | 3 + .../ui/admin-spawn-explosion-eui.ftl | 15 ++++- .../administration/ui/permissions-eui.ftl | 3 + .../en-US/commands/admin-logs-command.ftl | 2 + .../en-US/commands/admin-who-command.ftl | 2 + .../Locale/en-US/commands/deadmin-command.ftl | 3 + .../commands/delete-component-command.ftl | 4 ++ .../Locale/en-US/commands/map-commands.ftl | 5 ++ .../Locale/en-US/commands/pardon-command.ftl | 7 ++ 19 files changed, 160 insertions(+), 146 deletions(-) create mode 100644 Resources/Locale/en-US/commands/admin-logs-command.ftl create mode 100644 Resources/Locale/en-US/commands/admin-who-command.ftl create mode 100644 Resources/Locale/en-US/commands/deadmin-command.ftl create mode 100644 Resources/Locale/en-US/commands/delete-component-command.ftl create mode 100644 Resources/Locale/en-US/commands/map-commands.ftl create mode 100644 Resources/Locale/en-US/commands/pardon-command.ftl diff --git a/Content.Server/Administration/Commands/AdminWhoCommand.cs b/Content.Server/Administration/Commands/AdminWhoCommand.cs index ee5c362a4d..0866aed78a 100644 --- a/Content.Server/Administration/Commands/AdminWhoCommand.cs +++ b/Content.Server/Administration/Commands/AdminWhoCommand.cs @@ -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(); - var afk = IoCManager.Resolve(); + 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]"); } } diff --git a/Content.Server/Administration/Commands/AnnounceUiCommand.cs b/Content.Server/Administration/Commands/AnnounceUiCommand.cs index abb9235a3a..55a913b80e 100644 --- a/Content.Server/Administration/Commands/AnnounceUiCommand.cs +++ b/Content.Server/Administration/Commands/AnnounceUiCommand.cs @@ -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(); var ui = new AdminAnnounceEui(); - eui.OpenEui(ui, player); + _euiManager.OpenEui(ui, player); } } } diff --git a/Content.Server/Administration/Commands/DeAdminCommand.cs b/Content.Server/Administration/Commands/DeAdminCommand.cs index cf65941200..3979c93bd7 100644 --- a/Content.Server/Administration/Commands/DeAdminCommand.cs +++ b/Content.Server/Administration/Commands/DeAdminCommand.cs @@ -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(); - mgr.DeAdmin(player); + _admin.DeAdmin(player); } } } diff --git a/Content.Server/Administration/Commands/DeleteComponent.cs b/Content.Server/Administration/Commands/DeleteComponent.cs index f4b2a00760..c569a8375f 100644 --- a/Content.Server/Administration/Commands/DeleteComponent.cs +++ b/Content.Server/Administration/Commands/DeleteComponent.cs @@ -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} "; + [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(); - var entityManager = IoCManager.Resolve(); - 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; } diff --git a/Content.Server/Administration/Commands/ExplosionCommand.cs b/Content.Server/Administration/Commands/ExplosionCommand.cs index c916a7cb5f..787886f164 100644 --- a/Content.Server/Administration/Commands/ExplosionCommand.cs +++ b/Content.Server/Administration/Commands/ExplosionCommand.cs @@ -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(); 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(); - 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().GetMapCoordinates(shell.Player.AttachedEntity.Value, xform: xform); + coords = _transform.GetMapCoordinates(shell.Player.AttachedEntity.Value, xform: xform); } ExplosionPrototype? type; - var protoMan = IoCManager.Resolve(); 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().FirstOrDefault(); + type = _prototypeManager.EnumeratePrototypes().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(); - sysMan.GetEntitySystem().QueueExplosion(coords, type.ID, intensity, slope, maxIntensity, null); + _explosion.QueueExplosion(coords, type.ID, intensity, slope, maxIntensity, null); } } diff --git a/Content.Server/Administration/Commands/FaxUiCommand.cs b/Content.Server/Administration/Commands/FaxUiCommand.cs index c1103f47d8..4b788375bd 100644 --- a/Content.Server/Administration/Commands/FaxUiCommand.cs +++ b/Content.Server/Administration/Commands/FaxUiCommand.cs @@ -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(); var ui = new AdminFaxEui(); - eui.OpenEui(ui, player); + _euiManager.OpenEui(ui, player); } } diff --git a/Content.Server/Administration/Commands/LoadGameMapCommand.cs b/Content.Server/Administration/Commands/LoadGameMapCommand.cs index 034b50a9c5..dfe18ea5bc 100644 --- a/Content.Server/Administration/Commands/LoadGameMapCommand.cs +++ b/Content.Server/Administration/Commands/LoadGameMapCommand.cs @@ -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 [ []] "; - - public void Execute(IConsoleShell shell, string argStr, string[] args) + public override void Execute(IConsoleShell shell, string argStr, string[] args) { - var prototypeManager = IoCManager.Resolve(); - var entityManager = IoCManager.Resolve(); - var gameTicker = entityManager.EntitySysManager.GetEntitySystem(); - var mapSys = entityManager.EntitySysManager.GetEntitySystem(); - if (args.Length is not (2 or 4 or 5)) { shell.WriteError(Loc.GetString("shell-wrong-arguments-number")); return; } - if (!prototypeManager.TryIndex(args[1], out var gameMap)) + if (!_prototypeManager.TryIndex(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(); - var entityManager = IoCManager.Resolve(); - var gameTicker = entityManager.EntitySysManager.GetEntitySystem(); - if (args.Length != 0) { shell.WriteError(Loc.GetString("shell-wrong-arguments-number")); return; } - foreach (var prototype in prototypeManager.EnumeratePrototypes()) + foreach (var prototype in _prototypeManager.EnumeratePrototypes()) { shell.WriteLine($"{prototype.ID} - {prototype.MapName}"); } diff --git a/Content.Server/Administration/Commands/OpenAdminLogsCommand.cs b/Content.Server/Administration/Commands/OpenAdminLogsCommand.cs index 5572fa542b..1beaaa928e 100644 --- a/Content.Server/Administration/Commands/OpenAdminLogsCommand.cs +++ b/Content.Server/Administration/Commands/OpenAdminLogsCommand.cs @@ -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(); var ui = new AdminLogsEui(); - eui.OpenEui(ui, player); + _euiManager.OpenEui(ui, player); } } diff --git a/Content.Server/Administration/Commands/OpenPermissionsCommand.cs b/Content.Server/Administration/Commands/OpenPermissionsCommand.cs index fd3227d4aa..14167931e8 100644 --- a/Content.Server/Administration/Commands/OpenPermissionsCommand.cs +++ b/Content.Server/Administration/Commands/OpenPermissionsCommand.cs @@ -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(); var ui = new PermissionsEui(); - eui.OpenEui(ui, player); + _euiManager.OpenEui(ui, player); } } } diff --git a/Content.Server/Administration/Commands/PardonCommand.cs b/Content.Server/Administration/Commands/PardonCommand.cs index 9cbaaece31..5c4417a966 100644 --- a/Content.Server/Administration/Commands/PardonCommand.cs +++ b/Content.Server/Administration/Commands/PardonCommand.cs @@ -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} "; + [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(); 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))); } } } diff --git a/Resources/Locale/en-US/administration/ui/admin-announce-window.ftl b/Resources/Locale/en-US/administration/ui/admin-announce-window.ftl index 1db8cfad25..d4341b99bc 100644 --- a/Resources/Locale/en-US/administration/ui/admin-announce-window.ftl +++ b/Resources/Locale/en-US/administration/ui/admin-announce-window.ftl @@ -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 diff --git a/Resources/Locale/en-US/administration/ui/admin-spawn-explosion-eui.ftl b/Resources/Locale/en-US/administration/ui/admin-spawn-explosion-eui.ftl index 85f4a065f4..1d30c5d9fc 100644 --- a/Resources/Locale/en-US/administration/ui/admin-spawn-explosion-eui.ftl +++ b/Resources/Locale/en-US/administration/ui/admin-spawn-explosion-eui.ftl @@ -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? diff --git a/Resources/Locale/en-US/administration/ui/permissions-eui.ftl b/Resources/Locale/en-US/administration/ui/permissions-eui.ftl index 228f40f828..0ff1f9fb55 100644 --- a/Resources/Locale/en-US/administration/ui/permissions-eui.ftl +++ b/Resources/Locale/en-US/administration/ui/permissions-eui.ftl @@ -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 index 0000000000..539c917ddb --- /dev/null +++ b/Resources/Locale/en-US/commands/admin-logs-command.ftl @@ -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 index 0000000000..05ad540e0d --- /dev/null +++ b/Resources/Locale/en-US/commands/admin-who-command.ftl @@ -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 index 0000000000..e031595eba --- /dev/null +++ b/Resources/Locale/en-US/commands/deadmin-command.ftl @@ -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 index 0000000000..f8435e4c64 --- /dev/null +++ b/Resources/Locale/en-US/commands/delete-component-command.ftl @@ -0,0 +1,4 @@ +cmd-deletecomponent-desc = Deletes all instances of the specified component. +cmd-deletecomponent-help = Usage: deletecomponent " +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 index 0000000000..f5663f6824 --- /dev/null +++ b/Resources/Locale/en-US/commands/map-commands.ftl @@ -0,0 +1,5 @@ +cmd-loadgamemap-desc = Loads the given game map at the given coordinates. +cmd-loadgamemap-help = loadgamemap [ []] + +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 index 0000000000..c934865629 --- /dev/null +++ b/Resources/Locale/en-US/commands/pardon-command.ftl @@ -0,0 +1,7 @@ +cmd-pardon-desc = Pardon somebody's ban. +cmd-pardon-help = Usage: pardon +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}. -- 2.51.2