Un-revert IPlayerManager refactor (#21244)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using Content.Shared.CharacterInfo;
|
||||
using Content.Shared.Objectives;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.UserInterface;
|
||||
|
||||
@@ -11,14 +10,11 @@ public sealed class CharacterInfoSystem : EntitySystem
|
||||
[Dependency] private readonly IPlayerManager _players = default!;
|
||||
|
||||
public event Action<CharacterData>? OnCharacterUpdate;
|
||||
public event Action? OnCharacterDetached;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<PlayerAttachSysMessage>(OnPlayerAttached);
|
||||
|
||||
SubscribeNetworkEvent<CharacterInfoEvent>(OnCharacterInfoEvent);
|
||||
}
|
||||
|
||||
@@ -33,14 +29,6 @@ public sealed class CharacterInfoSystem : EntitySystem
|
||||
RaiseNetworkEvent(new RequestCharacterInfoEvent(GetNetEntity(entity.Value)));
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(PlayerAttachSysMessage msg)
|
||||
{
|
||||
if (msg.AttachedEntity == default)
|
||||
{
|
||||
OnCharacterDetached?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCharacterInfoEvent(CharacterInfoEvent msg, EntitySessionEventArgs args)
|
||||
{
|
||||
var entity = GetEntity(msg.NetEntity);
|
||||
|
||||
Reference in New Issue
Block a user