Merge ActorSystem and IPlayerManager (#21314)

This commit is contained in:
Leon Friedrich
2023-11-11 13:08:10 +11:00
committed by GitHub
parent a367097c33
commit 654cc7f071
25 changed files with 42 additions and 42 deletions

View File

@@ -5,7 +5,6 @@ using Content.Client.Construction;
using Content.Client.Examine;
using Content.IntegrationTests.Pair;
using Content.Server.Body.Systems;
using Content.Server.Players;
using Content.Server.Stack;
using Content.Server.Tools;
using Content.Shared.Body.Part;
@@ -17,8 +16,6 @@ using Content.Shared.Mind;
using Content.Shared.Players;
using Robust.Client.Input;
using Robust.Client.UserInterface;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Map;
@@ -102,7 +99,6 @@ public abstract partial class InteractionTest
protected ToolSystem ToolSys = default!;
protected InteractionTestSystem STestSystem = default!;
protected SharedTransformSystem Transform = default!;
protected ActorSystem Actor = default!;
protected ISawmill SLogger = default!;
// CLIENT dependencies
@@ -161,7 +157,6 @@ public abstract partial class InteractionTest
SConstruction = SEntMan.System<Server.Construction.ConstructionSystem>();
STestSystem = SEntMan.System<InteractionTestSystem>();
Stack = SEntMan.System<StackSystem>();
Actor = SEntMan.System<ActorSystem>();
SLogger = Server.ResolveDependency<ILogManager>().RootSawmill;
// client dependencies
@@ -197,17 +192,17 @@ public abstract partial class InteractionTest
// Mind system is a time vampire
SEntMan.System<SharedMindSystem>().WipeMind(ServerSession.ContentData()?.Mind);
old = cPlayerMan.LocalPlayer.ControlledEntity;
old = cPlayerMan.LocalEntity;
Player = SEntMan.GetNetEntity(SEntMan.SpawnEntity(PlayerPrototype, SEntMan.GetCoordinates(PlayerCoords)));
var serverPlayerEnt = SEntMan.GetEntity(Player);
Actor.Attach(serverPlayerEnt, ServerSession);
Server.PlayerMan.SetAttachedEntity(ServerSession, serverPlayerEnt);
Hands = SEntMan.GetComponent<HandsComponent>(serverPlayerEnt);
DoAfters = SEntMan.GetComponent<DoAfterComponent>(serverPlayerEnt);
});
// Check player got attached.
await RunTicks(5);
Assert.That(CEntMan.GetNetEntity(cPlayerMan.LocalPlayer.ControlledEntity), Is.EqualTo(Player));
Assert.That(CEntMan.GetNetEntity(cPlayerMan.LocalEntity), Is.EqualTo(Player));
// Delete old player entity.
await Server.WaitPost(() =>
@@ -234,7 +229,7 @@ public abstract partial class InteractionTest
await Pair.ReallyBeIdle(5);
Assert.Multiple(() =>
{
Assert.That(CEntMan.GetNetEntity(cPlayerMan.LocalPlayer.ControlledEntity), Is.EqualTo(Player));
Assert.That(CEntMan.GetNetEntity(cPlayerMan.LocalEntity), Is.EqualTo(Player));
Assert.That(sPlayerMan.GetSessionByUserId(ClientSession.UserId).AttachedEntity, Is.EqualTo(SEntMan.GetEntity(Player)));
});
}