Un-revert IPlayerManager refactor (#21244)

This commit is contained in:
Leon Friedrich
2023-10-28 09:59:53 +11:00
committed by GitHub
parent c55e1dcafd
commit e685cb626b
245 changed files with 781 additions and 943 deletions

View File

@@ -22,6 +22,7 @@ using Content.Server.Station.Systems;
using Content.Server.Shuttles.Systems;
using Content.Shared.Mobs;
using Robust.Server.Containers;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
namespace Content.Server.Antag;
@@ -88,9 +89,9 @@ public sealed class AntagSelectionSystem : GameRuleSystem<GameRuleComponent>
out List<EntityUid> chosen,
bool includeHeads = false)
{
var allPlayers = _playerSystem.ServerSessions.ToList();
var playerList = new List<IPlayerSession>();
var prefList = new List<IPlayerSession>();
var allPlayers = _playerSystem.Sessions.ToList();
var playerList = new List<ICommonSession>();
var prefList = new List<ICommonSession>();
chosen = new List<EntityUid>();
foreach (var player in allPlayers)
{
@@ -116,7 +117,7 @@ public sealed class AntagSelectionSystem : GameRuleSystem<GameRuleComponent>
var antags = Math.Clamp(allPlayers.Count / antagsPerPlayer, 1, maxAntags);
for (var antag = 0; antag < antags; antag++)
{
IPlayerSession chosenPlayer = null!;
ICommonSession? chosenPlayer = null;
if (prefList.Count == 0)
{
if (playerList.Count == 0)