IPlayerManager refactor (#21215)

This commit is contained in:
Leon Friedrich
2023-10-24 20:19:08 +11:00
committed by GitHub
parent c500a63ada
commit 7ba0ea2926
248 changed files with 966 additions and 1048 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)