@@ -12,6 +12,7 @@ using Content.Shared.Preferences;
|
||||
using JetBrains.Annotations;
|
||||
using Prometheus;
|
||||
using Robust.Server.Maps;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Asynchronous;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Map;
|
||||
@@ -204,7 +205,7 @@ namespace Content.Server.GameTicking
|
||||
|
||||
var startingEvent = new RoundStartingEvent(RoundId);
|
||||
RaiseLocalEvent(startingEvent);
|
||||
var readyPlayers = new List<ICommonSession>();
|
||||
var readyPlayers = new List<IPlayerSession>();
|
||||
var readyPlayerProfiles = new Dictionary<NetUserId, HumanoidCharacterProfile>();
|
||||
|
||||
foreach (var (userId, status) in _playerGameStatuses)
|
||||
@@ -343,7 +344,7 @@ namespace Content.Server.GameTicking
|
||||
{
|
||||
connected = true;
|
||||
}
|
||||
ContentPlayerData? contentPlayerData = null;
|
||||
PlayerData? contentPlayerData = null;
|
||||
if (userId != null && _playerManager.TryGetPlayerData(userId.Value, out var playerData))
|
||||
{
|
||||
contentPlayerData = playerData.ContentData();
|
||||
@@ -359,7 +360,8 @@ namespace Content.Server.GameTicking
|
||||
else if (mind.CurrentEntity != null && TryName(mind.CurrentEntity.Value, out var icName))
|
||||
playerIcName = icName;
|
||||
|
||||
if (TryGetEntity(mind.OriginalOwnedEntity, out var entity))
|
||||
var entity = mind.OriginalOwnedEntity;
|
||||
if (Exists(entity))
|
||||
_pvsOverride.AddGlobalOverride(entity.Value, recursive: true);
|
||||
|
||||
var roles = _roles.MindGetAllRoles(mindId);
|
||||
@@ -492,7 +494,7 @@ namespace Content.Server.GameTicking
|
||||
private void ResettingCleanup()
|
||||
{
|
||||
// Move everybody currently in the server to lobby.
|
||||
foreach (var player in _playerManager.Sessions)
|
||||
foreach (var player in _playerManager.ServerSessions)
|
||||
{
|
||||
PlayerJoinLobby(player);
|
||||
}
|
||||
@@ -540,7 +542,7 @@ namespace Content.Server.GameTicking
|
||||
|
||||
DisallowLateJoin = false;
|
||||
_playerGameStatuses.Clear();
|
||||
foreach (var session in _playerManager.Sessions)
|
||||
foreach (var session in _playerManager.ServerSessions)
|
||||
{
|
||||
_playerGameStatuses[session.UserId] = LobbyEnabled ? PlayerGameStatus.NotReadyToPlay : PlayerGameStatus.ReadyToPlay;
|
||||
}
|
||||
@@ -734,10 +736,10 @@ namespace Content.Server.GameTicking
|
||||
/// </summary>
|
||||
public sealed class RoundStartAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
public ICommonSession[] Players { get; }
|
||||
public IPlayerSession[] Players { get; }
|
||||
public bool Forced { get; }
|
||||
|
||||
public RoundStartAttemptEvent(ICommonSession[] players, bool forced)
|
||||
public RoundStartAttemptEvent(IPlayerSession[] players, bool forced)
|
||||
{
|
||||
Players = players;
|
||||
Forced = forced;
|
||||
@@ -756,11 +758,11 @@ namespace Content.Server.GameTicking
|
||||
/// If you want to handle a specific player being spawned, remove it from this list and do what you need.
|
||||
/// </summary>
|
||||
/// <remarks>If you spawn a player by yourself from this event, don't forget to call <see cref="GameTicker.PlayerJoinGame"/> on them.</remarks>
|
||||
public List<ICommonSession> PlayerPool { get; }
|
||||
public List<IPlayerSession> PlayerPool { get; }
|
||||
public IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> Profiles { get; }
|
||||
public bool Forced { get; }
|
||||
|
||||
public RulePlayerSpawningEvent(List<ICommonSession> playerPool, IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> profiles, bool forced)
|
||||
public RulePlayerSpawningEvent(List<IPlayerSession> playerPool, IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> profiles, bool forced)
|
||||
{
|
||||
PlayerPool = playerPool;
|
||||
Profiles = profiles;
|
||||
@@ -774,11 +776,11 @@ namespace Content.Server.GameTicking
|
||||
/// </summary>
|
||||
public sealed class RulePlayerJobsAssignedEvent
|
||||
{
|
||||
public ICommonSession[] Players { get; }
|
||||
public IPlayerSession[] Players { get; }
|
||||
public IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> Profiles { get; }
|
||||
public bool Forced { get; }
|
||||
|
||||
public RulePlayerJobsAssignedEvent(ICommonSession[] players, IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> profiles, bool forced)
|
||||
public RulePlayerJobsAssignedEvent(IPlayerSession[] players, IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> profiles, bool forced)
|
||||
{
|
||||
Players = players;
|
||||
Profiles = profiles;
|
||||
|
||||
Reference in New Issue
Block a user