Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -3,6 +3,8 @@ using Content.IntegrationTests.Tests.Construction.Interaction;
using Content.IntegrationTests.Tests.Interaction;
using Content.IntegrationTests.Tests.Weldable;
using Content.Shared.Tools.Components;
using Content.Server.Tools.Components;
using Content.Shared.DoAfter;
namespace Content.IntegrationTests.Tests.DoAfter;
@@ -50,10 +52,10 @@ public sealed class DoAfterCancellationTests : InteractionTest
await StartConstruction(WallConstruction.Wall);
await Interact(Steel, 5, awaitDoAfters: false);
await CancelDoAfters();
Assert.That(Target.HasValue && Target.Value.IsClientSide());
await Interact(Steel, 5);
AssertPrototype(WallConstruction.Girder);
ClientAssertPrototype(WallConstruction.Girder, ClientTarget);
Target = CTestSystem.Ghosts[ClientTarget!.Value.GetHashCode()];
await Interact(Steel, 5, awaitDoAfters: false);
await CancelDoAfters();
AssertPrototype(WallConstruction.Girder);
@@ -84,7 +86,7 @@ public sealed class DoAfterCancellationTests : InteractionTest
await AssertTile(Floor);
// Second DoAfter cancels the first.
await Server.WaitPost(() => InteractSys.UserInteraction(Player, TargetCoords, Target));
await Server.WaitPost(() => InteractSys.UserInteraction(SEntMan.GetEntity(Player), SEntMan.GetCoordinates(TargetCoords), SEntMan.GetEntity(Target)));
Assert.That(ActiveDoAfters.Count(), Is.EqualTo(0));
await AssertTile(Floor);
@@ -112,7 +114,7 @@ public sealed class DoAfterCancellationTests : InteractionTest
// Second DoAfter cancels the first.
// Not using helper, because it runs too many ticks & causes the do-after to finish.
await Server.WaitPost(() => InteractSys.UserInteraction(Player, TargetCoords, Target));
await Server.WaitPost(() => InteractSys.UserInteraction(SEntMan.GetEntity(Player), SEntMan.GetCoordinates(TargetCoords), SEntMan.GetEntity(Target)));
Assert.Multiple(() =>
{
Assert.That(ActiveDoAfters.Count(), Is.EqualTo(0));
@@ -135,7 +137,7 @@ public sealed class DoAfterCancellationTests : InteractionTest
Assert.That(ActiveDoAfters.Count(), Is.EqualTo(1));
Assert.That(comp.IsWelded, Is.True);
});
await Server.WaitPost(() => InteractSys.UserInteraction(Player, TargetCoords, Target));
await Server.WaitPost(() => InteractSys.UserInteraction(SEntMan.GetEntity(Player), SEntMan.GetCoordinates(TargetCoords), SEntMan.GetEntity(Target)));
Assert.Multiple(() =>
{
Assert.That(ActiveDoAfters.Count(), Is.EqualTo(0));