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

@@ -10,10 +10,9 @@ using Content.Shared.CCVar;
using Content.Shared.CrewManifest;
using Content.Shared.GameTicking;
using Content.Shared.StationRecords;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
using Robust.Shared.Players;
using Robust.Shared.Player;
namespace Content.Server.CrewManifest;
@@ -60,7 +59,7 @@ public sealed class CrewManifestSystem : EntitySystem
private void OnRequestCrewManifest(RequestCrewManifestMessage message, EntitySessionEventArgs args)
{
if (args.SenderSession is not IPlayerSession sessionCast
if (args.SenderSession is not { } sessionCast
|| !_configManager.GetCVar(CCVars.CrewManifestWithoutEntity))
{
return;
@@ -93,12 +92,12 @@ public sealed class CrewManifestSystem : EntitySystem
private void OnBoundUiClose(EntityUid uid, CrewManifestViewerComponent component, BoundUIClosedEvent ev)
{
var owningStation = _stationSystem.GetOwningStation(uid);
if (owningStation == null || ev.Session is not IPlayerSession sessionCast)
if (owningStation == null || ev.Session is not { } session)
{
return;
}
CloseEui(owningStation.Value, sessionCast, uid);
CloseEui(owningStation.Value, session, uid);
}
/// <summary>
@@ -126,7 +125,7 @@ public sealed class CrewManifestSystem : EntitySystem
private void OpenEuiFromBui(EntityUid uid, CrewManifestViewerComponent component, CrewManifestOpenUiMessage msg)
{
var owningStation = _stationSystem.GetOwningStation(uid);
if (owningStation == null || msg.Session is not IPlayerSession sessionCast)
if (owningStation == null || msg.Session is not { } session)
{
return;
}
@@ -136,7 +135,7 @@ public sealed class CrewManifestSystem : EntitySystem
return;
}
OpenEui(owningStation.Value, sessionCast, uid);
OpenEui(owningStation.Value, session, uid);
}
/// <summary>
@@ -145,7 +144,7 @@ public sealed class CrewManifestSystem : EntitySystem
/// <param name="station">Station that we're displaying the crew manifest for.</param>
/// <param name="session">The player's session.</param>
/// <param name="owner">If this EUI should be 'owned' by an entity.</param>
public void OpenEui(EntityUid station, IPlayerSession session, EntityUid? owner = null)
public void OpenEui(EntityUid station, ICommonSession session, EntityUid? owner = null)
{
if (!HasComp<StationRecordsComponent>(station))
{
@@ -252,7 +251,7 @@ public sealed class CrewManifestCommand : IConsoleCommand
return;
}
if (shell.Player == null || shell.Player is not IPlayerSession session)
if (shell.Player == null || shell.Player is not { } session)
{
shell.WriteLine("You must run this from a client.");
return;