From d1a033644b49cf7b6c84a9119d783e88f17241f2 Mon Sep 17 00:00:00 2001 From: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Date: Sat, 15 Jan 2022 05:15:41 -0800 Subject: [PATCH] Update admin overlay when player is renamed (#6180) --- Content.Server/Administration/AdminSystem.cs | 2 +- Content.Server/Mind/Commands/RenameCommand.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Content.Server/Administration/AdminSystem.cs b/Content.Server/Administration/AdminSystem.cs index c905d5c2ce..b04ced17a0 100644 --- a/Content.Server/Administration/AdminSystem.cs +++ b/Content.Server/Administration/AdminSystem.cs @@ -33,7 +33,7 @@ namespace Content.Server.Administration SubscribeLocalEvent(OnRoleEvent); } - private void UpdatePlayerList(IPlayerSession player) + public void UpdatePlayerList(IPlayerSession player) { _playerList[player.UserId] = GetPlayerInfo(player); diff --git a/Content.Server/Mind/Commands/RenameCommand.cs b/Content.Server/Mind/Commands/RenameCommand.cs index 7ab5712502..2303d35257 100644 --- a/Content.Server/Mind/Commands/RenameCommand.cs +++ b/Content.Server/Mind/Commands/RenameCommand.cs @@ -8,6 +8,7 @@ using Content.Server.PDA; using Content.Shared.Access.Components; using Content.Shared.Administration; using Content.Shared.PDA; +using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.Console; using Robust.Shared.GameObjects; @@ -90,6 +91,13 @@ public class RenameCommand : IConsoleCommand pdaSystem.SetOwner(pdaComponent, name); } } + + // Admin Overlay + if (entSysMan.TryGetEntitySystem(out var adminSystem) + && entMan.TryGetComponent(entityUid, out var actorComp)) + { + adminSystem.UpdatePlayerList(actorComp.PlayerSession); + } } private static bool TryParseUid(string str, IConsoleShell shell,