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

@@ -4,7 +4,6 @@ using Content.Server.Ghost.Roles.Components;
using Content.Server.Ghost.Roles.Events;
using Content.Server.Ghost.Roles.UI;
using Content.Server.Mind.Commands;
using Content.Server.Players;
using Content.Shared.Administration;
using Content.Shared.Database;
using Content.Shared.Follower;
@@ -14,13 +13,14 @@ using Content.Shared.Ghost.Roles;
using Content.Shared.Mind;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs;
using Content.Shared.Players;
using Content.Shared.Roles;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.Enums;
using Robust.Shared.Players;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Utility;
@@ -97,7 +97,7 @@ namespace Content.Server.Ghost.Roles
return unchecked(_nextRoleIdentifier++);
}
public void OpenEui(IPlayerSession session)
public void OpenEui(ICommonSession session)
{
if (session.AttachedEntity is not {Valid: true} attached ||
!EntityManager.HasComponent<GhostComponent>(attached))
@@ -111,7 +111,7 @@ namespace Content.Server.Ghost.Roles
eui.StateDirty();
}
public void OpenMakeGhostRoleEui(IPlayerSession session, EntityUid uid)
public void OpenMakeGhostRoleEui(ICommonSession session, EntityUid uid)
{
if (session.AttachedEntity == null)
return;
@@ -420,7 +420,7 @@ namespace Content.Server.Ghost.Roles
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if(shell.Player != null)
EntitySystem.Get<GhostRoleSystem>().OpenEui((IPlayerSession)shell.Player);
EntitySystem.Get<GhostRoleSystem>().OpenEui(shell.Player);
else
shell.WriteLine("You can only open the ghost roles UI on a client.");
}