* Loadouts redux * Loadout window mockup * More workout * rent * validation * Developments * bcs * More cleanup * Rebuild working * Fix model and loading * obsession * efcore * We got a stew goin * Cleanup * Optional + SeniorEngineering fix * Fixes * Update science.yml * add add * Automatic naming * Update nukeops * Coming together * Right now * stargate * rejig the UI * weh * Loadouts tweaks * Merge conflicts + ordering fix * yerba mate * chocolat * More updates * Add multi-selection support * test h * fikss * a * add tech assistant and hazard suit * huh * Latest changes * add medical loadouts * and science * finish security loadouts * cargo * service done * added wildcards * add command * Move restrictions * Finalising * Fix existing work * Localise next batch * clothing fix * Fix storage names * review * the scooping room * Test fixes * Xamlify * Xamlify this too * Update Resources/Prototypes/Loadouts/Jobs/Medical/paramedic.yml Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com> * Update Resources/Prototypes/Loadouts/loadout_groups.yml Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com> * Update Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com> * Update Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com> * Update Resources/Prototypes/Loadouts/loadout_groups.yml Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com> * Update Resources/Prototypes/Loadouts/Jobs/Security/detective.yml Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com> * Update Resources/Prototypes/Loadouts/loadout_groups.yml Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com> * ben * Margins --------- Co-authored-by: Firewatch <54725557+musicmanvr@users.noreply.github.com> Co-authored-by: Mr. 27 <koolthunder019@gmail.com> Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>
62 lines
2.1 KiB
C#
62 lines
2.1 KiB
C#
#nullable enable
|
|
using Robust.Shared.Console;
|
|
using Robust.Shared.Map;
|
|
|
|
namespace Content.IntegrationTests.Tests.Minds;
|
|
|
|
[TestFixture]
|
|
public sealed partial class MindTests
|
|
{
|
|
[Test]
|
|
public async Task DeleteAllThenGhost()
|
|
{
|
|
var settings = new PoolSettings
|
|
{
|
|
Dirty = true,
|
|
DummyTicker = false,
|
|
Connected = true
|
|
};
|
|
await using var pair = await PoolManager.GetServerClient(settings);
|
|
|
|
// Client is connected with a valid entity & mind
|
|
Assert.That(pair.Client.EntMan.EntityExists(pair.Client.AttachedEntity));
|
|
Assert.That(pair.Server.EntMan.EntityExists(pair.PlayerData?.Mind));
|
|
|
|
// Delete **everything**
|
|
var conHost = pair.Server.ResolveDependency<IConsoleHost>();
|
|
await pair.Server.WaitPost(() => conHost.ExecuteCommand("entities delete"));
|
|
await pair.RunTicksSync(5);
|
|
|
|
Assert.That(pair.Server.EntMan.EntityCount, Is.EqualTo(0));
|
|
|
|
foreach (var ent in pair.Client.EntMan.GetEntities())
|
|
{
|
|
Console.WriteLine(pair.Client.EntMan.ToPrettyString(ent));
|
|
}
|
|
|
|
Assert.That(pair.Client.EntMan.EntityCount, Is.EqualTo(0));
|
|
|
|
// Create a new map.
|
|
int mapId = 1;
|
|
await pair.Server.WaitPost(() => conHost.ExecuteCommand($"addmap {mapId}"));
|
|
await pair.RunTicksSync(5);
|
|
|
|
// Client is not attached to anything
|
|
Assert.That(pair.Client.AttachedEntity, Is.Null);
|
|
Assert.That(pair.PlayerData?.Mind, Is.Null);
|
|
|
|
// Attempt to ghost
|
|
var cConHost = pair.Client.ResolveDependency<IConsoleHost>();
|
|
await pair.Client.WaitPost(() => cConHost.ExecuteCommand("ghost"));
|
|
await pair.RunTicksSync(10);
|
|
|
|
// Client should be attached to a ghost placed on the new map.
|
|
Assert.That(pair.Client.EntMan.EntityExists(pair.Client.AttachedEntity));
|
|
Assert.That(pair.Server.EntMan.EntityExists(pair.PlayerData?.Mind));
|
|
var xform = pair.Client.Transform(pair.Client.AttachedEntity!.Value);
|
|
Assert.That(xform.MapID, Is.EqualTo(new MapId(mapId)));
|
|
|
|
await pair.CleanReturnAsync();
|
|
}
|
|
}
|