From d316fa3483ce78ab242e654044a8710b9174b598 Mon Sep 17 00:00:00 2001 From: Kyle Tyo <36606155+VerinSenpai@users.noreply.github.com> Date: Tue, 17 Jun 2025 05:39:42 -0400 Subject: [PATCH] Command resolve and LEC conversion batch 3 (#38378) * I'm just a silly goober * requested changes * Update Content.Server/Interaction/TilePryCommand.cs --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --- .../GameTicking/Commands/ForceMapCommand.cs | 27 +++++---- .../Commands/ForcePresetCommand.cs | 34 ++++++----- .../GameTicking/Commands/GoLobbyCommand.cs | 29 ++++------ Content.Server/GhostKick/GhostKickManager.cs | 26 ++++----- Content.Server/Interaction/TilePryCommand.cs | 37 ++++++------ Content.Server/Mapping/MappingCommand.cs | 56 +++++++++---------- Content.Server/Maps/GridDraggingCommand.cs | 22 +++----- .../Mind/Commands/MindInfoCommand.cs | 27 ++++----- .../en-US/commands/force-map-command.ftl | 6 ++ .../en-US/commands/force-preset-command.ftl | 6 ++ .../en-US/commands/ghost-kick-command.ftl | 3 + .../en-US/commands/go-lobby-command.ftl | 4 ++ .../en-US/commands/grid-drag-command.ftl | 3 + .../en-US/commands/mind-info-command.ftl | 3 + .../en-US/commands/tile-pry-command.ftl | 4 ++ .../en-US/game-ticking/forcemap-command.ftl | 9 --- 16 files changed, 148 insertions(+), 148 deletions(-) create mode 100644 Resources/Locale/en-US/commands/force-map-command.ftl create mode 100644 Resources/Locale/en-US/commands/force-preset-command.ftl create mode 100644 Resources/Locale/en-US/commands/ghost-kick-command.ftl create mode 100644 Resources/Locale/en-US/commands/go-lobby-command.ftl create mode 100644 Resources/Locale/en-US/commands/grid-drag-command.ftl create mode 100644 Resources/Locale/en-US/commands/mind-info-command.ftl create mode 100644 Resources/Locale/en-US/commands/tile-pry-command.ftl delete mode 100644 Resources/Locale/en-US/game-ticking/forcemap-command.ftl diff --git a/Content.Server/GameTicking/Commands/ForceMapCommand.cs b/Content.Server/GameTicking/Commands/ForceMapCommand.cs index 4cc30ff38a..577464acad 100644 --- a/Content.Server/GameTicking/Commands/ForceMapCommand.cs +++ b/Content.Server/GameTicking/Commands/ForceMapCommand.cs @@ -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(); 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() + var options = _prototypeManager .EnumeratePrototypes() .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; diff --git a/Content.Server/GameTicking/Commands/ForcePresetCommand.cs b/Content.Server/GameTicking/Commands/ForcePresetCommand.cs index 5ef72f59b3..327465be95 100644 --- a/Content.Server/GameTicking/Commands/ForcePresetCommand.cs +++ b/Content.Server/GameTicking/Commands/ForcePresetCommand.cs @@ -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} "; + 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(); - 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() + var options = _prototypeManager .EnumeratePrototypes() .OrderBy(p => p.ID) .Select(p => p.ID); - return CompletionResult.FromHintOptions(options, ""); + return CompletionResult.FromHintOptions(options, Loc.GetString($"cmd-forcepreset-hint")); } return CompletionResult.Empty; diff --git a/Content.Server/GameTicking/Commands/GoLobbyCommand.cs b/Content.Server/GameTicking/Commands/GoLobbyCommand.cs index b5984d260d..98c1b91e08 100644 --- a/Content.Server/GameTicking/Commands/GoLobbyCommand.cs +++ b/Content.Server/GameTicking/Commands/GoLobbyCommand.cs @@ -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} "; - 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(); - 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(); - 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))); } } } diff --git a/Content.Server/GhostKick/GhostKickManager.cs b/Content.Server/GhostKick/GhostKickManager.cs index 40d21d79d2..61d8cf9b32 100644 --- a/Content.Server/GhostKick/GhostKickManager.cs +++ b/Content.Server/GhostKick/GhostKickManager.cs @@ -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 [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(); - var ghostKick = IoCManager.Resolve(); + 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); } } diff --git a/Content.Server/Interaction/TilePryCommand.cs b/Content.Server/Interaction/TilePryCommand.cs index e8999a7d18..6db649a5e7 100644 --- a/Content.Server/Interaction/TilePryCommand.cs +++ b/Content.Server/Interaction/TilePryCommand.cs @@ -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} "; + 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(); - var xform = _entities.GetComponent(attached); + var xform = EntityManager.GetComponent(attached); var playerGrid = xform.GridUid; - if (!_entities.TryGetComponent(playerGrid, out var mapGrid)) + if (!EntityManager.TryGetComponent(playerGrid, out var mapGrid)) return; var playerPosition = xform.Coordinates; - var tileDefinitionManager = IoCManager.Resolve(); 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)); } } } diff --git a/Content.Server/Mapping/MappingCommand.cs b/Content.Server/Mapping/MappingCommand.cs index 7482ef811f..96a21573f6 100644 --- a/Content.Server/Mapping/MappingCommand.cs +++ b/Content.Server/Mapping/MappingCommand.cs @@ -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(); - 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(); + Entity? 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(); 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(playerEntity).EntityPrototype?.ID != GameTicker.AdminObserverPrototypeName) + EntityManager.GetComponent(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(); 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))); diff --git a/Content.Server/Maps/GridDraggingCommand.cs b/Content.Server/Maps/GridDraggingCommand.cs index 897b9c08ef..8050a65ec5 100644 --- a/Content.Server/Maps/GridDraggingCommand.cs +++ b/Content.Server/Maps/GridDraggingCommand.cs @@ -9,25 +9,21 @@ namespace Content.Server.Maps; /// Toggles GridDragging on the system. /// [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().GetEntitySystem(); - 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)))); } } diff --git a/Content.Server/Mind/Commands/MindInfoCommand.cs b/Content.Server/Mind/Commands/MindInfoCommand.cs index c365702a31..bd9d15d549 100644 --- a/Content.Server/Mind/Commands/MindInfoCommand.cs +++ b/Content.Server/Mind/Commands/MindInfoCommand.cs @@ -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 "; + 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(); - 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(); - 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(); - 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 index 0000000000..fabd5f04c8 --- /dev/null +++ b/Resources/Locale/en-US/commands/force-map-command.ftl @@ -0,0 +1,6 @@ +cmd-forcemap-desc = Forces the game to start with a given map next round. +cmd-forcemap-help = Usage: forcemap +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 = 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 index 0000000000..9f534a01c4 --- /dev/null +++ b/Resources/Locale/en-US/commands/force-preset-command.ftl @@ -0,0 +1,6 @@ +cmd-forcepreset-desc = Forces a specific game preset to start for the current lobby. +cmd-forcepreset-help = Usage: forcepreset +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 = 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 index 0000000000..fffae96ebe --- /dev/null +++ b/Resources/Locale/en-US/commands/ghost-kick-command.ftl @@ -0,0 +1,3 @@ +cmd-ghostkick-desc = Kick a client from the server as if their network just dropped. +cmd-ghostkick-help = Usage: ghostkick [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 index 0000000000..7ba54aa730 --- /dev/null +++ b/Resources/Locale/en-US/commands/go-lobby-command.ftl @@ -0,0 +1,4 @@ +cmd-golobby-desc = Enables the lobby and restarts the round. +cmd-golobby-help = Usage: golobby / golobby +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 index 0000000000..34efa64491 --- /dev/null +++ b/Resources/Locale/en-US/commands/grid-drag-command.ftl @@ -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 index 0000000000..57a1731928 --- /dev/null +++ b/Resources/Locale/en-US/commands/mind-info-command.ftl @@ -0,0 +1,3 @@ +cmd-mindinfo-desc = Lists info for the mind of a specific player. +cmd-mindinfo-help = Usage: mindinfo +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 index 0000000000..5c7d313127 --- /dev/null +++ b/Resources/Locale/en-US/commands/tile-pry-command.ftl @@ -0,0 +1,4 @@ +cmd-tilepry-desc = Pries up all tiles in a radius around the user. +cmd-tilepry-help = Usage: tilepry +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 index 573aa78a28..0000000000 --- a/Resources/Locale/en-US/game-ticking/forcemap-command.ftl +++ /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 -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 = -- 2.51.2