Command resolve mega pr batch 5 (#38389)
* commit progress * requested changes
This commit is contained in:
@@ -6,13 +6,14 @@ using Robust.Shared.Console;
|
||||
namespace Content.Server.Administration.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.NameColor)]
|
||||
internal sealed class SetAdminOOC : IConsoleCommand
|
||||
internal sealed class SetAdminOOC : LocalizedCommands
|
||||
{
|
||||
public string Command => "setadminooc";
|
||||
public string Description => Loc.GetString("set-admin-ooc-command-description", ("command", Command));
|
||||
public string Help => Loc.GetString("set-admin-ooc-command-help-text", ("command", Command));
|
||||
[Dependency] private readonly IServerDbManager _dbManager = default!;
|
||||
[Dependency] private readonly IServerPreferencesManager _preferenceManager = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
public override string Command => "setadminooc";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (shell.Player == null)
|
||||
{
|
||||
@@ -36,11 +37,9 @@ namespace Content.Server.Administration.Commands
|
||||
|
||||
var userId = shell.Player.UserId;
|
||||
// Save the DB
|
||||
var dbMan = IoCManager.Resolve<IServerDbManager>();
|
||||
dbMan.SaveAdminOOCColorAsync(userId, color.Value);
|
||||
_dbManager.SaveAdminOOCColorAsync(userId, color.Value);
|
||||
// Update the cached preference
|
||||
var prefManager = IoCManager.Resolve<IServerPreferencesManager>();
|
||||
var prefs = prefManager.GetPreferences(userId);
|
||||
var prefs = _preferenceManager.GetPreferences(userId);
|
||||
prefs.AdminOOCColor = color.Value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user