Removed Old PlayerSession Functions (#5404)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Acruid
2021-11-22 23:11:48 -08:00
committed by GitHub
parent 7910928679
commit 6e54e740c7
26 changed files with 97 additions and 94 deletions

View File

@@ -24,9 +24,9 @@ namespace Content.Server.Ghost.Roles
public class GhostRoleSystem : EntitySystem
{
[Dependency] private readonly EuiManager _euiManager = default!;
[Dependency] private IPlayerManager _playerManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
private uint _nextRoleIdentifier = 0;
private uint _nextRoleIdentifier;
private bool _needsUpdateGhostRoleCount = true;
private readonly Dictionary<uint, GhostRoleComponent> _ghostRoles = new();
private readonly Dictionary<IPlayerSession, GhostRolesEui> _openUis = new();
@@ -96,7 +96,7 @@ namespace Content.Server.Ghost.Roles
{
if (_openMakeGhostRoleUis.Remove(session, out var eui))
{
eui?.Close();
eui.Close();
}
}
@@ -119,8 +119,10 @@ namespace Content.Server.Ghost.Roles
{
_needsUpdateGhostRoleCount = false;
var response = new GhostUpdateGhostRoleCountEvent(_ghostRoles.Count);
foreach (var player in _playerManager.GetAllPlayers())
foreach (var player in _playerManager.Sessions)
{
RaiseNetworkEvent(response, player.ConnectedClient);
}
}
}