Keep players in the PlayerTab until round end (#5921)
* Rework AdminSystem to keep players in the PlayerTab until round end * Prevent sending PlayerStatus to deadminned admins * Change _playerList to non-nullable * Clean up unused usings * Consolidate duplicate foreach loop code
This commit is contained in:
@@ -4,12 +4,8 @@ using System.Linq;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Administration.Events;
|
||||
using Content.Shared.GameTicking;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Players;
|
||||
|
||||
namespace Content.Client.Administration
|
||||
{
|
||||
@@ -36,7 +32,6 @@ namespace Content.Client.Administration
|
||||
InitializeMenu();
|
||||
SubscribeNetworkEvent<FullPlayerListEvent>(OnPlayerListChanged);
|
||||
SubscribeNetworkEvent<PlayerInfoChangedEvent>(OnPlayerInfoChanged);
|
||||
SubscribeNetworkEvent<PlayerInfoRemovalMessage>(OnPlayerInfoRemoval);
|
||||
SubscribeNetworkEvent<RoundRestartCleanupEvent>(OnRoundRestartCleanup);
|
||||
}
|
||||
|
||||
@@ -60,16 +55,6 @@ namespace Content.Client.Administration
|
||||
PlayerListChanged?.Invoke(_playerList.Values.ToList());
|
||||
}
|
||||
|
||||
private void OnPlayerInfoRemoval(PlayerInfoRemovalMessage ev)
|
||||
{
|
||||
if (_playerList == null) _playerList = new();
|
||||
|
||||
var playerInfo = _playerList[ev.NetUserId];
|
||||
_playerList[ev.NetUserId] = new PlayerInfo(playerInfo.Username, playerInfo.CharacterName, playerInfo.Antag,
|
||||
playerInfo.EntityUid, playerInfo.SessionId, false);
|
||||
PlayerListChanged?.Invoke(_playerList.Values.ToList());
|
||||
}
|
||||
|
||||
private void OnPlayerInfoChanged(PlayerInfoChangedEvent ev)
|
||||
{
|
||||
if(ev.PlayerInfo == null) return;
|
||||
|
||||
Reference in New Issue
Block a user