Files
tbd-station-14/Content.Server/Administration/Commands/PromoteHostCommand.cs
Acruid ca4fd649fe Massive Namespace Cleanup (#3120)
* Engine namespace changes.

* Automated remove redundant using statements.

* Simplified Graphics namespace.

* Apparently the container system stores full type names in the map file.😞 This updates those names.

* API Changes to LocalizationManager.LoadCulture.

* Update submodule to v0.3.2
2021-02-11 01:13:03 -08:00

36 lines
1.1 KiB
C#

#nullable enable
using JetBrains.Annotations;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.IoC;
namespace Content.Server.Administration.Commands
{
[UsedImplicitly]
public sealed class PromoteHostCommand : IConsoleCommand
{
public string Command => "promotehost";
public string Description => "Grants client temporary full host admin privileges. Use this to bootstrap admins.";
public string Help => "Usage promotehost <player>";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 1)
{
shell.WriteLine("Expected exactly one argument.");
return;
}
var plyMgr = IoCManager.Resolve<IPlayerManager>();
if (!plyMgr.TryGetSessionByUsername(args[0], out var targetPlayer))
{
shell.WriteLine("Unable to find a player by that name.");
return;
}
var adminMgr = IoCManager.Resolve<IAdminManager>();
adminMgr.PromoteHost(targetPlayer);
}
}
}