diff --git a/Content.Server/Administration/Commands/BanPanelCommand.cs b/Content.Server/Administration/Commands/BanPanelCommand.cs index 9f9ec9e89f..b4faa6afef 100644 --- a/Content.Server/Administration/Commands/BanPanelCommand.cs +++ b/Content.Server/Administration/Commands/BanPanelCommand.cs @@ -17,7 +17,7 @@ public sealed class BanPanelCommand : LocalizedCommands { if (shell.Player is not { } player) { - shell.WriteError(Loc.GetString("cmd-banpanel-server")); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Administration/Commands/ControlMob.cs b/Content.Server/Administration/Commands/ControlMob.cs index 9d39cb9dde..8613fafeae 100644 --- a/Content.Server/Administration/Commands/ControlMob.cs +++ b/Content.Server/Administration/Commands/ControlMob.cs @@ -17,7 +17,7 @@ namespace Content.Server.Administration.Commands { if (shell.Player is not { } player) { - shell.WriteLine("shell-server-cannot"); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Administration/Commands/DSay.cs b/Content.Server/Administration/Commands/DSay.cs index f29e105909..8e7f0f4bf0 100644 --- a/Content.Server/Administration/Commands/DSay.cs +++ b/Content.Server/Administration/Commands/DSay.cs @@ -17,10 +17,9 @@ namespace Content.Server.Administration.Commands public void Execute(IConsoleShell shell, string argStr, string[] args) { - var player = shell.Player; - if (player == null) + if (shell.Player is not { } player) { - shell.WriteLine("shell-only-players-can-run-this-command"); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Administration/Commands/FaxUiCommand.cs b/Content.Server/Administration/Commands/FaxUiCommand.cs index 8323278c58..c1103f47d8 100644 --- a/Content.Server/Administration/Commands/FaxUiCommand.cs +++ b/Content.Server/Administration/Commands/FaxUiCommand.cs @@ -15,10 +15,9 @@ public sealed class FaxUiCommand : IConsoleCommand public void Execute(IConsoleShell shell, string argStr, string[] args) { - var player = shell.Player; - if (player == null) + if (shell.Player is not { } player) { - shell.WriteLine("shell-only-players-can-run-this-command"); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Administration/Commands/FollowCommand.cs b/Content.Server/Administration/Commands/FollowCommand.cs index 9f94f83b4d..b59a99b8b4 100644 --- a/Content.Server/Administration/Commands/FollowCommand.cs +++ b/Content.Server/Administration/Commands/FollowCommand.cs @@ -16,10 +16,9 @@ public sealed class FollowCommand : IConsoleCommand public void Execute(IConsoleShell shell, string argStr, string[] args) { - var player = shell.Player; - if (player == null) + if (shell.Player is not { } player) { - shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command")); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Administration/Commands/OpenAdminLogsCommand.cs b/Content.Server/Administration/Commands/OpenAdminLogsCommand.cs index 47ff3e1a1c..5572fa542b 100644 --- a/Content.Server/Administration/Commands/OpenAdminLogsCommand.cs +++ b/Content.Server/Administration/Commands/OpenAdminLogsCommand.cs @@ -16,7 +16,7 @@ public sealed class OpenAdminLogsCommand : IConsoleCommand { if (shell.Player is not { } player) { - shell.WriteLine("This does not work from the server console."); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Administration/Commands/OpenAdminNotesCommand.cs b/Content.Server/Administration/Commands/OpenAdminNotesCommand.cs index e6ae4f7616..ae79aa52bb 100644 --- a/Content.Server/Administration/Commands/OpenAdminNotesCommand.cs +++ b/Content.Server/Administration/Commands/OpenAdminNotesCommand.cs @@ -17,7 +17,7 @@ public sealed class OpenAdminNotesCommand : IConsoleCommand { if (shell.Player is not { } player) { - shell.WriteError("This does not work from the server console."); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Administration/Commands/OpenUserVisibleNotesCommand.cs b/Content.Server/Administration/Commands/OpenUserVisibleNotesCommand.cs index 507c7ab279..53651a8a8e 100644 --- a/Content.Server/Administration/Commands/OpenUserVisibleNotesCommand.cs +++ b/Content.Server/Administration/Commands/OpenUserVisibleNotesCommand.cs @@ -28,7 +28,7 @@ public sealed class OpenUserVisibleNotesCommand : IConsoleCommand if (shell.Player is not { } player) { - shell.WriteError("This does not work from the server console."); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Administration/Commands/SetAdminOOC.cs b/Content.Server/Administration/Commands/SetAdminOOC.cs index c1f72f7666..b3e17c9622 100644 --- a/Content.Server/Administration/Commands/SetAdminOOC.cs +++ b/Content.Server/Administration/Commands/SetAdminOOC.cs @@ -16,7 +16,7 @@ namespace Content.Server.Administration.Commands { if (shell.Player == null) { - shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command")); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Chat/Commands/LOOCCommand.cs b/Content.Server/Chat/Commands/LOOCCommand.cs index 059d25df27..e303b9766d 100644 --- a/Content.Server/Chat/Commands/LOOCCommand.cs +++ b/Content.Server/Chat/Commands/LOOCCommand.cs @@ -18,7 +18,7 @@ namespace Content.Server.Chat.Commands { if (shell.Player is not { } player) { - shell.WriteError("This command cannot be run from the server."); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Chat/Commands/SayCommand.cs b/Content.Server/Chat/Commands/SayCommand.cs index 273f908c9a..df6e548e5d 100644 --- a/Content.Server/Chat/Commands/SayCommand.cs +++ b/Content.Server/Chat/Commands/SayCommand.cs @@ -16,7 +16,7 @@ namespace Content.Server.Chat.Commands { if (shell.Player is not { } player) { - shell.WriteError("This command cannot be run from the server."); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Chat/Commands/SuicideCommand.cs b/Content.Server/Chat/Commands/SuicideCommand.cs index ea45158e44..ec623b4a51 100644 --- a/Content.Server/Chat/Commands/SuicideCommand.cs +++ b/Content.Server/Chat/Commands/SuicideCommand.cs @@ -23,7 +23,7 @@ namespace Content.Server.Chat.Commands { if (shell.Player is not { } player) { - shell.WriteLine(Loc.GetString("shell-cannot-run-command-from-server")); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Chat/Commands/WhisperCommand.cs b/Content.Server/Chat/Commands/WhisperCommand.cs index c88e2519ee..13effa3446 100644 --- a/Content.Server/Chat/Commands/WhisperCommand.cs +++ b/Content.Server/Chat/Commands/WhisperCommand.cs @@ -16,7 +16,7 @@ namespace Content.Server.Chat.Commands { if (shell.Player is not { } player) { - shell.WriteError("This command cannot be run from the server."); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Disposal/TubeConnectionsCommand.cs b/Content.Server/Disposal/TubeConnectionsCommand.cs index 55e6465937..564c46be7a 100644 --- a/Content.Server/Disposal/TubeConnectionsCommand.cs +++ b/Content.Server/Disposal/TubeConnectionsCommand.cs @@ -17,8 +17,13 @@ namespace Content.Server.Disposal public void Execute(IConsoleShell shell, string argStr, string[] args) { - var player = shell.Player; - if (player?.AttachedEntity == null) + if (shell.Player is not { } player) + { + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); + return; + } + + if (player.AttachedEntity is not { } attached) { shell.WriteLine(Loc.GetString("shell-only-players-can-run-this-command")); return; diff --git a/Content.Server/EntityList/SpawnEntityListCommand.cs b/Content.Server/EntityList/SpawnEntityListCommand.cs index 027d25dc2c..127e1ec47c 100644 --- a/Content.Server/EntityList/SpawnEntityListCommand.cs +++ b/Content.Server/EntityList/SpawnEntityListCommand.cs @@ -23,13 +23,13 @@ namespace Content.Server.EntityList if (shell.Player is not { } player) { - shell.WriteError("You must be a player to run this command."); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } if (player.AttachedEntity is not {} attached) { - shell.WriteError("You must have an entity to run this command."); + shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command")); return; } diff --git a/Content.Server/GameTicking/Commands/ObserveCommand.cs b/Content.Server/GameTicking/Commands/ObserveCommand.cs index 5a03503317..e13d70b972 100644 --- a/Content.Server/GameTicking/Commands/ObserveCommand.cs +++ b/Content.Server/GameTicking/Commands/ObserveCommand.cs @@ -19,6 +19,7 @@ namespace Content.Server.GameTicking.Commands { if (shell.Player is not { } player) { + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Mapping/MappingCommand.cs b/Content.Server/Mapping/MappingCommand.cs index 46534f7059..70647d3281 100644 --- a/Content.Server/Mapping/MappingCommand.cs +++ b/Content.Server/Mapping/MappingCommand.cs @@ -42,7 +42,7 @@ namespace Content.Server.Mapping { if (shell.Player is not { } player) { - shell.WriteError(Loc.GetString("cmd-savemap-server")); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/NPC/Commands/NPCCommand.cs b/Content.Server/NPC/Commands/NPCCommand.cs index 7f9e56b8ca..e1e432e1a4 100644 --- a/Content.Server/NPC/Commands/NPCCommand.cs +++ b/Content.Server/NPC/Commands/NPCCommand.cs @@ -16,6 +16,7 @@ public sealed class NPCCommand : IConsoleCommand { if (shell.Player is not { } playerSession) { + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Content.Server/Salvage/SalvageRulerCommand.cs b/Content.Server/Salvage/SalvageRulerCommand.cs index 49785e8f41..b445358c37 100644 --- a/Content.Server/Salvage/SalvageRulerCommand.cs +++ b/Content.Server/Salvage/SalvageRulerCommand.cs @@ -27,7 +27,7 @@ sealed class SalvageRulerCommand : IConsoleCommand if (shell.Player is not { } player) { - shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command")); + shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server")); return; } diff --git a/Resources/Locale/en-US/administration/commands/set-outfit-command.ftl b/Resources/Locale/en-US/administration/commands/set-outfit-command.ftl index 7d97963ba9..793c339c28 100644 --- a/Resources/Locale/en-US/administration/commands/set-outfit-command.ftl +++ b/Resources/Locale/en-US/administration/commands/set-outfit-command.ftl @@ -1,4 +1,4 @@ set-outfit-command-description = Sets the outfit of the specified entity. The entity must have {INDEFINITE($requiredComponent)} {$requiredComponent} set-outfit-command-help-text = Usage: {$command} | {$command} -set-outfit-command-is-not-player-error = This does not work from the server console. You must pass the outfit id aswell. +set-outfit-command-is-not-player-error = This command requires both arguments to work from the server console. set-outfit-command-invalid-outfit-id-error = Invalid outfit id diff --git a/Resources/Locale/en-US/shell.ftl b/Resources/Locale/en-US/shell.ftl index 34460f001a..957d3d3c02 100644 --- a/Resources/Locale/en-US/shell.ftl +++ b/Resources/Locale/en-US/shell.ftl @@ -2,7 +2,6 @@ ## General -shell-server-cannot = Server cannot do this. shell-command-success = Command successful shell-invalid-command = Invalid command. shell-invalid-command-specific = Invalid {$commandName} command.