@@ -8,6 +8,7 @@ using Content.Shared.Mind;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Administration.Commands;
|
||||
|
||||
@@ -15,7 +16,7 @@ namespace Content.Server.Administration.Commands;
|
||||
public sealed class AGhostCommand : LocalizedCommands
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entities = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;
|
||||
|
||||
public override string Command => "aghost";
|
||||
public override string Help => "aghost";
|
||||
@@ -104,8 +105,8 @@ public sealed class AGhostCommand : LocalizedCommands
|
||||
// TODO: Remove duplication between all this and "GamePreset.OnGhostAttempt()"...
|
||||
if (!string.IsNullOrWhiteSpace(mind.CharacterName))
|
||||
metaDataSystem.SetEntityName(ghost, mind.CharacterName);
|
||||
else if (!string.IsNullOrWhiteSpace(mind.Session?.Name))
|
||||
metaDataSystem.SetEntityName(ghost, mind.Session.Name);
|
||||
else if (!string.IsNullOrWhiteSpace(player.Name))
|
||||
metaDataSystem.SetEntityName(ghost, player.Name);
|
||||
|
||||
mindSystem.Visit(mindId, ghost, mind);
|
||||
}
|
||||
|
||||
@@ -153,9 +153,7 @@ public sealed class AdminSystem : EntitySystem
|
||||
|
||||
private void OnRoleEvent(RoleEvent ev)
|
||||
{
|
||||
var session = _minds.GetSession(ev.Mind);
|
||||
|
||||
if (!ev.RoleTypeUpdate || session == null)
|
||||
if (!ev.RoleTypeUpdate || !_playerManager.TryGetSessionById(ev.Mind.UserId, out var session))
|
||||
return;
|
||||
|
||||
UpdatePlayerList(session);
|
||||
|
||||
Reference in New Issue
Block a user