Update admin overlay when player is renamed (#6180)

This commit is contained in:
ShadowCommander
2022-01-15 05:15:41 -08:00
committed by GitHub
parent 55f52f76be
commit d1a033644b
2 changed files with 9 additions and 1 deletions

View File

@@ -33,7 +33,7 @@ namespace Content.Server.Administration
SubscribeLocalEvent<RoleRemovedEvent>(OnRoleEvent); SubscribeLocalEvent<RoleRemovedEvent>(OnRoleEvent);
} }
private void UpdatePlayerList(IPlayerSession player) public void UpdatePlayerList(IPlayerSession player)
{ {
_playerList[player.UserId] = GetPlayerInfo(player); _playerList[player.UserId] = GetPlayerInfo(player);

View File

@@ -8,6 +8,7 @@ using Content.Server.PDA;
using Content.Shared.Access.Components; using Content.Shared.Access.Components;
using Content.Shared.Administration; using Content.Shared.Administration;
using Content.Shared.PDA; using Content.Shared.PDA;
using Robust.Server.GameObjects;
using Robust.Server.Player; using Robust.Server.Player;
using Robust.Shared.Console; using Robust.Shared.Console;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
@@ -90,6 +91,13 @@ public class RenameCommand : IConsoleCommand
pdaSystem.SetOwner(pdaComponent, name); pdaSystem.SetOwner(pdaComponent, name);
} }
} }
// Admin Overlay
if (entSysMan.TryGetEntitySystem<AdminSystem>(out var adminSystem)
&& entMan.TryGetComponent<ActorComponent>(entityUid, out var actorComp))
{
adminSystem.UpdatePlayerList(actorComp.PlayerSession);
}
} }
private static bool TryParseUid(string str, IConsoleShell shell, private static bool TryParseUid(string str, IConsoleShell shell,