From f0ccb01915b3f669c10dec05a45c18619286f638 Mon Sep 17 00:00:00 2001 From: Ivan Rubinov Date: Sat, 8 Jun 2024 19:57:07 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D1=85=D1=83=D0=B9?= =?UTF-8?q?=D0=BD=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Commands/CorvaxSetBalanceCommand.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Content.Server/Administration/Commands/CorvaxSetBalanceCommand.cs b/Content.Server/Administration/Commands/CorvaxSetBalanceCommand.cs index a01e36d1684..edb7fb27c8f 100644 --- a/Content.Server/Administration/Commands/CorvaxSetBalanceCommand.cs +++ b/Content.Server/Administration/Commands/CorvaxSetBalanceCommand.cs @@ -39,20 +39,18 @@ public void Execute(IConsoleShell shell, string argStr, string[] args) } [AdminCommand(AdminFlags.Host)] -public sealed class SetBalanceCommand : IConsoleCommand +public sealed class SetZeroBalanceCommand : IConsoleCommand { [Dependency] private readonly IServerDbManager _dbManager = default!; - public string Command => "setbalance"; + public string Command => "setzerobalance"; public string Description => Loc.GetString("set-balance-command-description"); public string Help => Loc.GetString("set-balance-command-help-text", ("command", Command)); public async void Execute(IConsoleShell shell, string argStr, string[] args) { var loc = IoCManager.Resolve(); - var set_balance = 0; - int.TryParse(args[1], out set_balance); - if (args.Length == 1 || args.Length == 2) + if (args.Length == 1) { var _userId = await _dbManager.GetPlayerRecordByUserName(args[0], new CancellationToken()); if (_userId is not null) { @@ -70,7 +68,7 @@ public async void Execute(IConsoleShell shell, string argStr, string[] args) profile.Age, profile.Sex, profile.Gender, - set_balance, + 0, profile.Appearance, profile.SpawnPriority, profile.JobPriorities, @@ -82,12 +80,15 @@ public async void Execute(IConsoleShell shell, string argStr, string[] args) } } } + return; + } else { + shell.WriteLine(Loc.GetString("shell-target-player-does-not-exist ")); + return; } - return; } else { - shell.WriteLine(Loc.GetString("shell-need-between-arguments", ("lower", "1"), ("upper", "2"))); + shell.WriteLine(Loc.GetString("shell-need-exactly-one-argument")); return; } }