diff --git a/Content.Server/Info/ShowRulesCommand.cs b/Content.Server/Info/ShowRulesCommand.cs index 5d33f5118e..e523227c81 100644 --- a/Content.Server/Info/ShowRulesCommand.cs +++ b/Content.Server/Info/ShowRulesCommand.cs @@ -15,7 +15,7 @@ public sealed class ShowRulesCommand : IConsoleCommand { public string Command => "showrules"; public string Description => "Opens the rules popup for the specified player."; - public string Help => "showrules [time]"; + public string Help => "showrules [seconds]"; public async void Execute(IConsoleShell shell, string argStr, string[] args) { string target; @@ -32,11 +32,13 @@ public sealed class ShowRulesCommand : IConsoleCommand } case 2: { - if (float.TryParse(args[1], out seconds)) + if (!float.TryParse(args[1], out seconds)) + { + shell.WriteError($"{args[1]} is not a valid amount of seconds.\n{Help}"); return; + } target = args[0]; - shell.WriteLine($"{args[1]} is not a valid amount of minutes.\n{Help}"); break; } default: @@ -54,14 +56,12 @@ public sealed class ShowRulesCommand : IConsoleCommand return; } - var message = new SharedRulesManager.ShowRulesPopupMessage - { - PopupTime = seconds - }; + var netManager = IoCManager.Resolve(); - var player = IoCManager.Resolve() - .GetSessionByUserId(located.UserId); - IoCManager.Resolve() - .ServerSendMessage(message, player.ConnectedClient); + var message = netManager.CreateNetMessage(); + message.PopupTime = seconds; + + var player = IoCManager.Resolve().GetSessionByUserId(located.UserId); + netManager.ServerSendMessage(message, player.ConnectedClient); } }