Fix Build Errors

This commit is contained in:
Coryler
2026-06-29 12:44:07 +02:00
parent da45e22ffe
commit 17e5bb87ab
102 changed files with 339 additions and 332 deletions
+34 -34
View File
@@ -105,40 +105,40 @@ public sealed class CargoTest
public async Task NoStaticPriceAndStackPrice()
{
return; // DeltaV: Disable this stupid test its 100% false positives
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
var protoManager = server.ProtoMan;
var compFact = server.ResolveDependency<IComponentFactory>();
await server.WaitAssertion(() =>
{
var protoIds = protoManager.EnumeratePrototypes<EntityPrototype>()
.Where(p => !p.Abstract)
.Where(p => !pair.IsTestPrototype(p))
.Where(p => p.Components.ContainsKey("StaticPrice"))
.ToList();
foreach (var proto in protoIds)
{
// Sanity check
Assert.That(proto.TryGetComponent<StaticPriceComponent>(out var staticPriceComp, compFact), Is.True);
if (proto.TryGetComponent<StackPriceComponent>(out var stackPriceComp, compFact) && stackPriceComp.Price > 0)
{
Assert.That(staticPriceComp.Price, Is.EqualTo(0),
$"The prototype {proto} has a StackPriceComponent and StaticPriceComponent whose values are not compatible with each other.");
}
if (proto.HasComponent<StackComponent>(compFact))
{
Assert.That(staticPriceComp.Price, Is.EqualTo(0),
$"The prototype {proto} has a StackComponent and StaticPriceComponent whose values are not compatible with each other.");
}
}
});
await pair.CleanReturnAsync();
// await using var pair = await PoolManager.GetServerClient();
// var server = pair.Server;
//
// var protoManager = server.ProtoMan;
// var compFact = server.ResolveDependency<IComponentFactory>();
//
// await server.WaitAssertion(() =>
// {
// var protoIds = protoManager.EnumeratePrototypes<EntityPrototype>()
// .Where(p => !p.Abstract)
// .Where(p => !pair.IsTestPrototype(p))
// .Where(p => p.Components.ContainsKey("StaticPrice"))
// .ToList();
//
// foreach (var proto in protoIds)
// {
// // Sanity check
// Assert.That(proto.TryGetComponent<StaticPriceComponent>(out var staticPriceComp, compFact), Is.True);
//
// if (proto.TryGetComponent<StackPriceComponent>(out var stackPriceComp, compFact) && stackPriceComp.Price > 0)
// {
// Assert.That(staticPriceComp.Price, Is.EqualTo(0),
// $"The prototype {proto} has a StackPriceComponent and StaticPriceComponent whose values are not compatible with each other.");
// }
//
// if (proto.HasComponent<StackComponent>(compFact))
// {
// Assert.That(staticPriceComp.Price, Is.EqualTo(0),
// $"The prototype {proto} has a StackComponent and StaticPriceComponent whose values are not compatible with each other.");
// }
// }
// });
//
// await pair.CleanReturnAsync();
}
/// <summary>
@@ -51,10 +51,10 @@ public sealed class MachineConstruction : InteractionTest
return; // DeltaV - i doubt this will break ever and cbf to change it to something else
// Change it into an autolathe
await InteractUsing("AutolatheMachineCircuitboard");
AssertPrototype(MachineFrame);
await Interact(Manipulator1, Manipulator1, Manipulator1, Manipulator1, Glass, Screw);
AssertPrototype("Autolathe");
// await InteractUsing("AutolatheMachineCircuitboard");
// AssertPrototype(MachineFrame);
// await Interact(Manipulator1, Manipulator1, Manipulator1, Manipulator1, Glass, Screw);
// AssertPrototype("Autolathe");
}
}
@@ -22,22 +22,22 @@ public sealed class GuideEntryPrototypeTests
public async Task Validate(string protoKey)
{
return; // DeltaV - shit broken
await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
var client = pair.Client;
await client.WaitIdleAsync();
var protoMan = client.ResolveDependency<IPrototypeManager>();
var resMan = client.ResolveDependency<IResourceManager>();
var parser = client.ResolveDependency<DocumentParsingManager>();
var proto = protoMan.Index<GuideEntryPrototype>(protoKey);
await client.WaitAssertion(() =>
{
using var reader = resMan.ContentFileReadText(proto.Text);
var text = reader.ReadToEnd();
Assert.That(parser.TryAddMarkup(new Document(), text), $"Failed to parse the guide entry's document.");
});
await pair.CleanReturnAsync();
// await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
// var client = pair.Client;
// await client.WaitIdleAsync();
// var protoMan = client.ResolveDependency<IPrototypeManager>();
// var resMan = client.ResolveDependency<IResourceManager>();
// var parser = client.ResolveDependency<DocumentParsingManager>();
// var proto = protoMan.Index<GuideEntryPrototype>(protoKey);
//
// await client.WaitAssertion(() =>
// {
// using var reader = resMan.ContentFileReadText(proto.Text);
// var text = reader.ReadToEnd();
//
// Assert.That(parser.TryAddMarkup(new Document(), text), $"Failed to parse the guide entry's document.");
// });
//
// await pair.CleanReturnAsync();
}
}
@@ -12,52 +12,52 @@ public sealed partial class MindTests
public async Task DeleteAllThenGhost()
{
return; // DeltaV - stupid fucking test
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.
MapId mapId = default;
await pair.Server.WaitPost(() => pair.Server.System<SharedMapSystem>().CreateMap(out 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(mapId));
await pair.CleanReturnAsync();
// 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.
// MapId mapId = default;
// await pair.Server.WaitPost(() => pair.Server.System<SharedMapSystem>().CreateMap(out 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(mapId));
//
// await pair.CleanReturnAsync();
}
}
@@ -761,8 +761,8 @@ public sealed partial class TraitSystemTest
IPrototypeManager protoMan,
IComponentFactory factory,
EntityUid player,
string? jobId = null,
string? speciesId = null)
string jobId = null,
string speciesId = null)
{
return new TraitConditionContext
{