fix(Commands): Improve Localization of commands. Standardize some behaviors. (#30362)
* I should be studying for school but that is sofucking boring, I will pass my class no matter, however getting an A might be a challenge. My gpa is important but is the tourture for 1 point of GPA worth it? The american government says yes but they are responsible for the majority of all genocides that have ever been conducted since the dawn of man * ugh * ugh
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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} <entityUid> | {$command} <entityUid> <outfitId>
|
||||
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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user