Command resolve mega pr 6 (#38398)

commit progress
This commit is contained in:
Kyle Tyo
2025-06-17 13:22:03 -04:00
committed by GitHub
parent b73943b04b
commit 57babe15ee
19 changed files with 160 additions and 146 deletions

View File

@@ -8,32 +8,30 @@ using Robust.Shared.Utility;
namespace Content.Server.Administration.Commands; namespace Content.Server.Administration.Commands;
[AdminCommand(AdminFlags.AdminWho)] [AdminCommand(AdminFlags.AdminWho)]
public sealed class AdminWhoCommand : IConsoleCommand public sealed class AdminWhoCommand : LocalizedCommands
{ {
public string Command => "adminwho"; [Dependency] private readonly IAfkManager _afkManager = default!;
public string Description => "Returns a list of all admins on the server"; [Dependency] private readonly IAdminManager _adminManager = default!;
public string Help => "Usage: adminwho";
public void Execute(IConsoleShell shell, string argStr, string[] args) public override string Command => "adminwho";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
var adminMgr = IoCManager.Resolve<IAdminManager>();
var afk = IoCManager.Resolve<IAfkManager>();
var seeStealth = true; var seeStealth = true;
// If null it (hopefully) means it is being called from the console. // If null it (hopefully) means it is being called from the console.
if (shell.Player != null) if (shell.Player != null)
{ {
var playerData = adminMgr.GetAdminData(shell.Player); var playerData = _adminManager.GetAdminData(shell.Player);
seeStealth = playerData != null && playerData.CanStealth(); seeStealth = playerData != null && playerData.CanStealth();
} }
var sb = new StringBuilder(); var sb = new StringBuilder();
var first = true; 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); DebugTools.AssertNotNull(adminData);
if (adminData.Stealth && !seeStealth) if (adminData.Stealth && !seeStealth)
@@ -50,9 +48,9 @@ public sealed class AdminWhoCommand : IConsoleCommand
if (adminData.Stealth) if (adminData.Stealth)
sb.Append(" (S)"); 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]"); sb.Append(" [AFK]");
} }
} }

View File

@@ -6,26 +6,23 @@ using Robust.Shared.Console;
namespace Content.Server.Administration.Commands namespace Content.Server.Administration.Commands
{ {
[AdminCommand(AdminFlags.Moderator)] [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 override void Execute(IConsoleShell shell, string argStr, string[] args)
public void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
var player = shell.Player; var player = shell.Player;
if (player == null) if (player == null)
{ {
shell.WriteLine("This does not work from the server console."); shell.WriteLine(Loc.GetString($"shell-cannot-run-command-from-server"));
return; return;
} }
var eui = IoCManager.Resolve<EuiManager>();
var ui = new AdminAnnounceEui(); var ui = new AdminAnnounceEui();
eui.OpenEui(ui, player); _euiManager.OpenEui(ui, player);
} }
} }
} }

View File

@@ -7,23 +7,22 @@ namespace Content.Server.Administration.Commands
{ {
[UsedImplicitly] [UsedImplicitly]
[AdminCommand(AdminFlags.None)] [AdminCommand(AdminFlags.None)]
public sealed class DeAdminCommand : IConsoleCommand public sealed class DeAdminCommand : LocalizedCommands
{ {
public string Command => "deadmin"; [Dependency] private readonly IAdminManager _admin = default!;
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.";
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; var player = shell.Player;
if (player == null) 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; return;
} }
var mgr = IoCManager.Resolve<IAdminManager>(); _admin.DeAdmin(player);
mgr.DeAdmin(player);
} }
} }
} }

View File

@@ -4,42 +4,40 @@ using Robust.Shared.Console;
namespace Content.Server.Administration.Commands namespace Content.Server.Administration.Commands
{ {
[AdminCommand(AdminFlags.Spawn)] [AdminCommand(AdminFlags.Spawn)]
public sealed class DeleteComponent : IConsoleCommand public sealed class DeleteComponent : LocalizedEntityCommands
{ {
public string Command => "deletecomponent"; [Dependency] private readonly IComponentFactory _compFactory = default!;
public string Description => "Deletes all instances of the specified component.";
public string Help => $"Usage: {Command} <name>";
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) switch (args.Length)
{ {
case 0: case 0:
shell.WriteLine($"Not enough arguments.\n{Help}"); shell.WriteLine(Loc.GetString($"shell-need-exactly-one-argument"));
break; break;
default: default:
var name = string.Join(" ", args); 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; break;
} }
var componentType = registration.Type; var componentType = registration.Type;
var components = entityManager.GetAllComponents(componentType, true); var components = EntityManager.GetAllComponents(componentType, true);
var i = 0; var i = 0;
foreach (var (uid, component) in components) foreach (var (uid, component) in components)
{ {
entityManager.RemoveComponent(uid, component); EntityManager.RemoveComponent(uid, component);
i++; i++;
} }
shell.WriteLine($"Removed {i} components with name {name}."); shell.WriteLine(Loc.GetString($"cmd-deletecomponent-success", ("count", i), ("name", name)));
break; break;
} }

View File

@@ -13,72 +13,73 @@ using Robust.Server.GameObjects;
namespace Content.Server.Administration.Commands; namespace Content.Server.Administration.Commands;
[AdminCommand(AdminFlags.Fun)] [AdminCommand(AdminFlags.Fun)]
public sealed class OpenExplosionEui : IConsoleCommand public sealed class OpenExplosionEui : LocalizedEntityCommands
{ {
public string Command => "explosionui"; [Dependency] private readonly EuiManager _euiManager = default!;
public string Description => "Opens a window for easy access to station destruction";
public string Help => $"Usage: {Command}";
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; var player = shell.Player;
if (player == null) if (player == null)
{ {
shell.WriteError("This does not work from the server console."); shell.WriteError(Loc.GetString($"shell-cannot-run-command-from-server"));
return; return;
} }
var eui = IoCManager.Resolve<EuiManager>();
var ui = new SpawnExplosionEui(); var ui = new SpawnExplosionEui();
eui.OpenEui(ui, player); _euiManager.OpenEui(ui, player);
} }
} }
[AdminCommand(AdminFlags.Fun)] // for the admin. Not so much for anyone else. [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"; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
public string Description => "Train go boom"; [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 // Note that if you change the arguments, you should also update the client-side SpawnExplosionWindow, as that just
// uses this command. // uses this command.
public string Help => "Usage: explosion [intensity] [slope] [maxIntensity] [x y] [mapId] [prototypeId]"; public override void Execute(IConsoleShell shell, string argStr, string[] args)
public void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
if (args.Length == 0 || args.Length == 4 || args.Length > 7) 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; return;
} }
if (!float.TryParse(args[0], out var intensity)) 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; return;
} }
float slope = 5; float slope = 5;
if (args.Length > 1 && !float.TryParse(args[1], out slope)) 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; return;
} }
float maxIntensity = 100; float maxIntensity = 100;
if (args.Length > 2 && !float.TryParse(args[2], out maxIntensity)) 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; return;
} }
float x = 0, y = 0; float x = 0, y = 0;
if (args.Length > 4) if (args.Length > 4)
{ {
if (!float.TryParse(args[3], out x) || if (!float.TryParse(args[3], out x) || !float.TryParse(args[4], out y))
!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; return;
} }
} }
@@ -88,7 +89,7 @@ public sealed class ExplosionCommand : IConsoleCommand
{ {
if (!int.TryParse(args[5], out var parsed)) 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; return;
} }
coords = new MapCoordinates(new Vector2(x, y), new(parsed)); coords = new MapCoordinates(new Vector2(x, y), new(parsed));
@@ -96,42 +97,39 @@ public sealed class ExplosionCommand : IConsoleCommand
else else
{ {
// attempt to find the player's current position // attempt to find the player's current position
var entMan = IoCManager.Resolve<IEntityManager>(); if (!EntityManager.TryGetComponent(shell.Player?.AttachedEntity, out TransformComponent? xform))
if (!entMan.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; return;
} }
if (args.Length > 4) if (args.Length > 4)
coords = new MapCoordinates(new Vector2(x, y), xform.MapID); coords = new MapCoordinates(new Vector2(x, y), xform.MapID);
else else
coords = entMan.System<TransformSystem>().GetMapCoordinates(shell.Player.AttachedEntity.Value, xform: xform); coords = _transform.GetMapCoordinates(shell.Player.AttachedEntity.Value, xform: xform);
} }
ExplosionPrototype? type; ExplosionPrototype? type;
var protoMan = IoCManager.Resolve<IPrototypeManager>();
if (args.Length > 6) 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; 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 // 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) if (type == null)
{ {
shell.WriteError($"Prototype manager has no explosion prototypes?"); shell.WriteError(Loc.GetString($"cmd-explosion-no-prototypes"));
return; return;
} }
} }
var sysMan = IoCManager.Resolve<IEntitySystemManager>(); _explosion.QueueExplosion(coords, type.ID, intensity, slope, maxIntensity, null);
sysMan.GetEntitySystem<ExplosionSystem>().QueueExplosion(coords, type.ID, intensity, slope, maxIntensity, null);
} }
} }

View File

@@ -6,14 +6,13 @@ using Robust.Shared.Console;
namespace Content.Server.Administration.Commands; namespace Content.Server.Administration.Commands;
[AdminCommand(AdminFlags.Fun)] [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 override string Command => "faxui";
public string Help => Loc.GetString("cmd-faxui-help");
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) if (shell.Player is not { } player)
{ {
@@ -21,8 +20,7 @@ public sealed class FaxUiCommand : IConsoleCommand
return; return;
} }
var eui = IoCManager.Resolve<EuiManager>();
var ui = new AdminFaxEui(); var ui = new AdminFaxEui();
eui.OpenEui(ui, player); _euiManager.OpenEui(ui, player);
} }
} }

View File

@@ -3,35 +3,29 @@ using Content.Server.GameTicking;
using Content.Server.Maps; using Content.Server.Maps;
using Content.Shared.Administration; using Content.Shared.Administration;
using Robust.Shared.Console; using Robust.Shared.Console;
using Robust.Shared.EntitySerialization;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Server.Administration.Commands namespace Content.Server.Administration.Commands
{ {
[AdminCommand(AdminFlags.Round | AdminFlags.Spawn)] [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 override void Execute(IConsoleShell shell, string argStr, string[] args)
public 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)) if (args.Length is not (2 or 4 or 5))
{ {
shell.WriteError(Loc.GetString("shell-wrong-arguments-number")); shell.WriteError(Loc.GetString("shell-wrong-arguments-number"));
return; 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."); shell.WriteError($"The given map prototype {args[0]} is invalid.");
return; return;
@@ -48,14 +42,14 @@ namespace Content.Server.Administration.Commands
var id = new MapId(mapId); var id = new MapId(mapId);
var grids = mapSys.MapExists(id) var grids = _mapSystem.MapExists(id)
? gameTicker.MergeGameMap(gameMap, id, stationName: stationName, offset: offset) ? _gameTicker.MergeGameMap(gameMap, id, stationName: stationName, offset: offset)
: gameTicker.LoadGameMapWithId(gameMap, id, stationName: stationName, offset: offset); : _gameTicker.LoadGameMapWithId(gameMap, id, stationName: stationName, offset: offset);
shell.WriteLine($"Loaded {grids.Count} grids."); shell.WriteLine($"Loaded {grids.Count} grids.");
} }
public CompletionResult GetCompletion(IConsoleShell shell, string[] args) public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
{ {
switch (args.Length) switch (args.Length)
{ {
@@ -79,26 +73,20 @@ namespace Content.Server.Administration.Commands
} }
[AdminCommand(AdminFlags.Round | AdminFlags.Spawn)] [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 override void Execute(IConsoleShell shell, string argStr, string[] args)
public 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) if (args.Length != 0)
{ {
shell.WriteError(Loc.GetString("shell-wrong-arguments-number")); shell.WriteError(Loc.GetString("shell-wrong-arguments-number"));
return; return;
} }
foreach (var prototype in prototypeManager.EnumeratePrototypes<GameMapPrototype>()) foreach (var prototype in _prototypeManager.EnumeratePrototypes<GameMapPrototype>())
{ {
shell.WriteLine($"{prototype.ID} - {prototype.MapName}"); shell.WriteLine($"{prototype.ID} - {prototype.MapName}");
} }

View File

@@ -6,13 +6,13 @@ using Robust.Shared.Console;
namespace Content.Server.Administration.Commands; namespace Content.Server.Administration.Commands;
[AdminCommand(AdminFlags.Logs)] [AdminCommand(AdminFlags.Logs)]
public sealed class OpenAdminLogsCommand : IConsoleCommand public sealed class OpenAdminLogsCommand : LocalizedEntityCommands
{ {
public string Command => "adminlogs"; [Dependency] private readonly EuiManager _euiManager = default!;
public string Description => "Opens the admin logs panel.";
public string Help => $"Usage: {Command}";
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) if (shell.Player is not { } player)
{ {
@@ -20,8 +20,7 @@ public sealed class OpenAdminLogsCommand : IConsoleCommand
return; return;
} }
var eui = IoCManager.Resolve<EuiManager>();
var ui = new AdminLogsEui(); var ui = new AdminLogsEui();
eui.OpenEui(ui, player); _euiManager.OpenEui(ui, player);
} }
} }

View File

@@ -6,24 +6,23 @@ using Robust.Shared.Console;
namespace Content.Server.Administration.Commands namespace Content.Server.Administration.Commands
{ {
[AdminCommand(AdminFlags.Permissions)] [AdminCommand(AdminFlags.Permissions)]
public sealed class OpenPermissionsCommand : IConsoleCommand public sealed class OpenPermissionsCommand : LocalizedEntityCommands
{ {
public string Command => "permissions"; [Dependency] private readonly EuiManager _euiManager = default!;
public string Description => "Opens the admin permissions panel.";
public string Help => "Usage: permissions";
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; var player = shell.Player;
if (player == null) if (player == null)
{ {
shell.WriteLine("This does not work from the server console."); shell.WriteLine(Loc.GetString($"shell-cannot-run-command-from-server"));
return; return;
} }
var eui = IoCManager.Resolve<EuiManager>();
var ui = new PermissionsEui(); var ui = new PermissionsEui();
eui.OpenEui(ui, player); _euiManager.OpenEui(ui, player);
} }
} }
} }

View File

@@ -1,21 +1,19 @@
using System.Text; using Content.Server.Database;
using Content.Server.Database;
using Content.Shared.Administration; using Content.Shared.Administration;
using Robust.Shared.Console; using Robust.Shared.Console;
namespace Content.Server.Administration.Commands namespace Content.Server.Administration.Commands
{ {
[AdminCommand(AdminFlags.Ban)] [AdminCommand(AdminFlags.Ban)]
public sealed class PardonCommand : IConsoleCommand public sealed class PardonCommand : LocalizedCommands
{ {
public string Command => "pardon"; [Dependency] private readonly IServerDbManager _dbManager = default!;
public string Description => "Pardons somebody's ban";
public string Help => $"Usage: {Command} <ban id>";
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 player = shell.Player;
var dbMan = IoCManager.Resolve<IServerDbManager>();
if (args.Length != 1) if (args.Length != 1)
{ {
@@ -25,11 +23,11 @@ namespace Content.Server.Administration.Commands
if (!int.TryParse(args[0], out var banId)) 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; return;
} }
var ban = await dbMan.GetServerBanAsync(banId); var ban = await _dbManager.GetServerBanAsync(banId);
if (ban == null) if (ban == null)
{ {
@@ -39,22 +37,22 @@ namespace Content.Server.Administration.Commands
if (ban.Unban != null) if (ban.Unban != null)
{ {
var response = new StringBuilder("This ban has already been pardoned");
if (ban.Unban.UnbanningAdmin != null) 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; 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)));
} }
} }
} }

View File

@@ -6,3 +6,6 @@ admin-announce-button = Announce
admin-announce-type-station = Station admin-announce-type-station = Station
admin-announce-type-server = Server admin-announce-type-server = Server
admin-announce-keep-open = Keep open admin-announce-keep-open = Keep open
cmd-announceui-desc = Opens the announcement UI.
cmd-announceui-help = Usage: announceui

View File

@@ -14,3 +14,16 @@ admin-explosion-eui-label-angle = Angle
admin-explosion-eui-label-spread = Spread admin-explosion-eui-label-spread = Spread
admin-explosion-eui-label-distance = Distance admin-explosion-eui-label-distance = Distance
admin-explosion-eui-label-spawn = Kabloom! 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?

View 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-rank-window-title = Edit Admin Rank
permissions-eui-edit-admin-window-save-button = Save permissions-eui-edit-admin-window-save-button = Save
permissions-eui-edit-admin-window-remove-flag-button = Remove permissions-eui-edit-admin-window-remove-flag-button = Remove
cmd-permissions-desc = Opens the admin permissions panel.
cmd-permissions-help = Usage: permissions

View File

@@ -0,0 +1,2 @@
cmd-adminlogs-desc = Opens the admin logs panel.
cmd-adminlogs-help = Usage: adminlogs

View File

@@ -0,0 +1,2 @@
cmd-adminwho-desc = Returns a list of all admins on the server.
cmd-adminwho-help = Usage: adminwho

View File

@@ -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.

View File

@@ -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}.

View File

@@ -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

View File

@@ -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}.