Add stealthmins (#26263)

* Add stealthmin command.

* Update Content.Server/Administration/Commands/AdminWhoCommand.cs

As suggested by CE.

Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>

* Add admin notifications for admins toggling stealthmin.

* Localize stealthmin command

---------

Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
This commit is contained in:
nikthechampiongr
2024-03-24 17:39:53 +02:00
committed by GitHub
parent 3731cc3c50
commit dca0c6694b
11 changed files with 197 additions and 10 deletions

View File

@@ -19,6 +19,16 @@ public sealed class AdminWhoCommand : IConsoleCommand
var adminMgr = IoCManager.Resolve<IAdminManager>();
var afk = IoCManager.Resolve<IAfkManager>();
var seeStealth = true;
// If null it (hopefully) means it is being called from the console.
if (shell.Player != null)
{
var playerData = adminMgr.GetAdminData(shell.Player);
seeStealth = playerData != null && playerData.CanStealth();
}
var sb = new StringBuilder();
var first = true;
foreach (var admin in adminMgr.ActiveAdmins)
@@ -30,10 +40,16 @@ public sealed class AdminWhoCommand : IConsoleCommand
var adminData = adminMgr.GetAdminData(admin)!;
DebugTools.AssertNotNull(adminData);
if (adminData.Stealth && !seeStealth)
continue;
sb.Append(admin.Name);
if (adminData.Title is { } title)
sb.Append($": [{title}]");
if (adminData.Stealth)
sb.Append(" (S)");
if (shell.Player is { } player && adminMgr.HasAdminFlag(player, AdminFlags.Admin))
{
if (afk.IsAfk(admin))