Skip to content

Commit

Permalink
Merge stable into master (#34564)
Browse files Browse the repository at this point in the history
  • Loading branch information
slarticodefast authored Jan 21, 2025
2 parents ef24e4b + ae21306 commit 20acef1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Content.Server/Administration/Systems/AdminSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,14 @@ public override void Initialize()
Subs.CVar(_config, CCVars.PanicBunkerMinAccountAge, OnPanicBunkerMinAccountAgeChanged, true);
Subs.CVar(_config, CCVars.PanicBunkerMinOverallMinutes, OnPanicBunkerMinOverallMinutesChanged, true);

SubscribeLocalEvent<IdentityChangedEvent>(OnIdentityChanged);
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<PlayerDetachedEvent>(OnPlayerDetached);
SubscribeLocalEvent<RoleAddedEvent>(OnRoleEvent);
SubscribeLocalEvent<RoleRemovedEvent>(OnRoleEvent);
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestartCleanup);

SubscribeLocalEvent<ActorComponent, EntityRenamedEvent>(OnPlayerRenamed);
SubscribeLocalEvent<ActorComponent, IdentityChangedEvent>(OnIdentityChanged);
}

private void OnRoundRestartCleanup(RoundRestartCleanupEvent ev)
Expand Down Expand Up @@ -144,12 +145,9 @@ public void UpdatePlayerList(ICommonSession player)
return value ?? null;
}

private void OnIdentityChanged(ref IdentityChangedEvent ev)
private void OnIdentityChanged(Entity<ActorComponent> ent, ref IdentityChangedEvent ev)
{
if (!TryComp<ActorComponent>(ev.CharacterEntity, out var actor))
return;

UpdatePlayerList(actor.PlayerSession);
UpdatePlayerList(ent.Comp.PlayerSession);
}

private void OnRoleEvent(RoleEvent ev)
Expand Down

0 comments on commit 20acef1

Please sign in to comment.