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

@@ -1,10 +1,8 @@
using System.Linq;
using Content.Shared.GameTicking;
using Content.Server.Station.Components;
using Robust.Server.Player;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Players;
using System.Text;
namespace Content.Server.GameTicking
@@ -79,7 +77,7 @@ namespace Content.Server.GameTicking
("roundId", RoundId), ("playerCount", playerCount), ("readyCount", readyCount), ("mapName", stationNames.ToString()),("gmTitle", gmTitle),("desc", desc));
}
private TickerLobbyStatusEvent GetStatusMsg(IPlayerSession session)
private TickerLobbyStatusEvent GetStatusMsg(ICommonSession session)
{
_playerGameStatuses.TryGetValue(session.UserId, out var status);
return new TickerLobbyStatusEvent(RunLevel != GameRunLevel.PreRoundLobby, LobbySong, LobbyBackground,status == PlayerGameStatus.ReadyToPlay, _roundStartTime, RoundPreloadTime, _roundStartTimeSpan, Paused);
@@ -87,7 +85,7 @@ namespace Content.Server.GameTicking
private void SendStatusToAll()
{
foreach (var player in _playerManager.ServerSessions)
foreach (var player in _playerManager.Sessions)
{
RaiseNetworkEvent(GetStatusMsg(player), player.ConnectedClient);
}
@@ -148,7 +146,7 @@ namespace Content.Server.GameTicking
}
}
public void ToggleReady(IPlayerSession player, bool ready)
public void ToggleReady(ICommonSession player, bool ready)
{
if (!_playerGameStatuses.ContainsKey(player.UserId))
return;