Skip to content

Commit

Permalink
Merge branch 'Pirate-Access-Configurator' of https://github.com/Houtb…
Browse files Browse the repository at this point in the history
…lokje/frontier-station-14 into Pirate-Access-Configurator
  • Loading branch information
Houtblokje committed Feb 18, 2025
2 parents 3bce9af + 6a205f6 commit 08b3382
Show file tree
Hide file tree
Showing 46 changed files with 186 additions and 232 deletions.
3 changes: 2 additions & 1 deletion Content.IntegrationTests/PoolManager.Cvars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ private static readonly (string cvar, string value)[] TestCvars =
(CVars.NetBufferSize.Name, "0"),
(CCVars.InteractionRateLimitCount.Name, "9999999"),
(CCVars.InteractionRateLimitPeriod.Name, "0.1"),
(CCVars.GameLobbyDefaultPreset.Name, "secret")// Frontier: Adventure takes ages, default to secret
(CCVars.GameLobbyDefaultPreset.Name, "secret"), // Frontier: Adventure takes ages, default to secret
(CCVars.StaticStorageUI.Name, "true")// Frontier: causes storage test failures
};

public static async Task SetupCVars(RobustIntegrationTest.IntegrationInstance instance, PoolSettings settings)
Expand Down
11 changes: 7 additions & 4 deletions Content.IntegrationTests/Tests/EntityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public sealed class EntityTest
private static readonly ProtoId<EntityCategoryPrototype> SpawnerCategory = "Spawner";

[Test]
[Ignore("Preventing CI tests from failing")] // Frontier: FIXME - unsure which entities are currently failing
public async Task SpawnAndDeleteAllEntitiesOnDifferentMaps()
{
// This test dirties the pair as it simply deletes ALL entities when done. Overhead of restarting the round
Expand All @@ -40,6 +39,7 @@ await server.WaitPost(() =>
.Where(p => !p.Abstract)
.Where(p => !pair.IsTestPrototype(p))
.Where(p => !p.Components.ContainsKey("MapGrid")) // This will smash stuff otherwise.
.Where(p => !p.Components.ContainsKey("RoomFill")) // This comp can delete all entities, and spawn others // Frontier: upstream #33110 cherrypick
.Select(p => p.ID)
.ToList();

Expand Down Expand Up @@ -82,7 +82,6 @@ await server.WaitPost(() =>
}

[Test]
[Ignore("Preventing CI tests from failing")] // Frontier: FIXME - unsure which entities are currently failing
public async Task SpawnAndDeleteAllEntitiesInTheSameSpot()
{
// This test dirties the pair as it simply deletes ALL entities when done. Overhead of restarting the round
Expand All @@ -103,6 +102,7 @@ await server.WaitPost(() =>
.Where(p => !p.Abstract)
.Where(p => !pair.IsTestPrototype(p))
.Where(p => !p.Components.ContainsKey("MapGrid")) // This will smash stuff otherwise.
.Where(p => !p.Components.ContainsKey("RoomFill")) // This comp can delete all entities, and spawn others // Frontier: upstream #33110 cherrypick
.Select(p => p.ID)
.ToList();
foreach (var protoId in protoIds)
Expand Down Expand Up @@ -141,7 +141,7 @@ await server.WaitPost(() =>
/// all components on every entity.
/// </summary>
[Test]
[Ignore("Preventing CI tests from failing")] // Frontier: FIXME - unsure which entities are currently failing
[Ignore("Preventing CI tests from failing")] // Frontier: FIXME - these take forever to run and fail.
public async Task SpawnAndDirtyAllEntities()
{
// This test dirties the pair as it simply deletes ALL entities when done. Overhead of restarting the round
Expand Down Expand Up @@ -227,7 +227,6 @@ await server.WaitPost(() =>
/// crude test to try catch issues like this, and possibly should just be disabled.
/// </remarks>
[Test]
[Ignore("Preventing CI tests from failing")] // Frontier: FIXME - unsure which entities are currently failing
public async Task SpawnAndDeleteEntityCountTest()
{
var settings = new PoolSettings { Connected = true, Dirty = true };
Expand All @@ -241,6 +240,8 @@ public async Task SpawnAndDeleteEntityCountTest()
"MapGrid",
"StationEvent",
"TimedDespawn",
"TransferMindOnDespawn", // Frontier
"BluespaceErrorRule", // Frontier

// makes an announcement on mapInit.
"AnnounceOnSpawn",
Expand Down Expand Up @@ -348,6 +349,7 @@ public async Task AllComponentsOneToOneDeleteTest()
"DebugExceptionInitialize",
"DebugExceptionStartup",
"GridFill",
"RoomFill", // Frontier: upstream #33110 cherrypick
"Map", // We aren't testing a map entity in this test
"MapGrid",
"Broadphase",
Expand All @@ -360,6 +362,7 @@ public async Task AllComponentsOneToOneDeleteTest()
"BiomeSelection", // Whaddya know, requires config.
"ActivatableUI", // Frontier: Requires enum key
"AlertLevel", // Frontier: requires alert set
"BluespaceErrorRule", // Frontier
};

// TODO TESTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ namespace Content.IntegrationTests.Tests.Internals;
[TestOf(typeof(InternalsSystem))]
public sealed class AutoInternalsTests
{
[Ignore("Not relevant for Frontier")] // Frontier
[Test]
[Ignore("Frontier: Changes to StationSpawningSystem breaks this")] // Frontier
public async Task TestInternalsAutoActivateInSpaceForStationSpawn()
{
await using var pair = await PoolManager.GetServerClient();
Expand All @@ -35,7 +36,7 @@ await server.WaitAssertion(() =>
await pair.CleanReturnAsync();
}

[Ignore("Not relevant for Frontier")] // Frontier
[Test]
public async Task TestInternalsAutoActivateInSpaceForEntitySpawn()
{
await using var pair = await PoolManager.GetServerClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public sealed class StorageInteractionTest : InteractionTest
/// Check that players can interact with items in storage if the storage UI is open
/// </summary>
[Test]
[Ignore("Preventing CI tests from failing")] // Frontier: FIXME - no idea what's actually causing a failure here.
public async Task UiInteractTest()
{
var sys = Server.System<SharedContainerSystem>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Robust.Shared.ContentPack;
using Robust.Shared.IoC;
using Robust.Shared.Reflection;
using Content.Client._NF.CryoSleep; // Frontier

namespace Content.IntegrationTests.Tests.UserInterface;

Expand All @@ -16,13 +17,13 @@ public sealed class UiControlTest
{
typeof(EmotesMenu),
typeof(LateJoinGui),
typeof(CryosleepWakeupWindow), // Frontier: FIXME - refactor this window into EUI(?) pattern, this thing subscribes to events
};

/// <summary>
/// Tests that all windows can be instantiated successfully.
/// </summary>
[Test]
[Ignore("Preventing CI tests from failing")] // Frontier: FIXME - bad Cryosleep UI registration
public async Task TestWindows()
{
var pair = await PoolManager.GetServerClient(new PoolSettings()
Expand Down
55 changes: 25 additions & 30 deletions Content.Server/Procedural/DungeonSystem.Rooms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@ public sealed partial class DungeonSystem
private readonly List<DungeonRoomPrototype> _availableRooms = new();

/// <summary>
/// Gets a random dungeon room matching the specified area and whitelist.
/// Gets a random dungeon room matching the specified area, whitelist and size.
/// </summary>
public DungeonRoomPrototype? GetRoomPrototype(Random random, EntityWhitelist? whitelist = null, Vector2i? size = null)
{
return GetRoomPrototype(random, whitelist, minSize: size, maxSize: size);
}

/// <summary>
/// Gets a random dungeon room matching the specified area and whitelist and size range
/// </summary>
public DungeonRoomPrototype? GetRoomPrototype(Random random,
EntityWhitelist? whitelist = null,
Vector2i? minSize = null,
Vector2i? maxSize = null)
{
// Can never be true.
if (whitelist is { Tags: null })
Expand All @@ -30,7 +41,10 @@ public sealed partial class DungeonSystem

foreach (var proto in _prototype.EnumeratePrototypes<DungeonRoomPrototype>())
{
if (size is not null && proto.Size != size)
if (minSize is not null && (proto.Size.X < minSize.Value.X || proto.Size.Y < minSize.Value.Y))
continue;

if (maxSize is not null && (proto.Size.X > maxSize.Value.X || proto.Size.Y > maxSize.Value.Y))
continue;

if (whitelist == null)
Expand Down Expand Up @@ -130,34 +144,6 @@ public void SpawnRoom(

var finalRoomRotation = roomTransform.Rotation();

// go BRRNNTTT on existing stuff
if (clearExisting)
{
//The Box2 rotation completely breaks the entity calculation from lookup. and before that, there's a 75% chance the spawn room won't remove anything underneath it.
//Therefore, Box2 must be calculated separately for all 4 rotation options.
var point1 = Vector2.Transform(-room.Size / 2, roomTransform);
var point2 = Vector2.Transform(room.Size / 2, roomTransform);
var gridBounds = GetRotatedBox(point1, point2, finalRoomRotation);

entitySet.Clear();
// Polygon skin moment
gridBounds = gridBounds.Enlarged(-0.05f);
_lookup.GetLocalEntitiesIntersecting(gridUid, gridBounds, entitySet, LookupFlags.Uncontained);

foreach (var templateEnt in entitySet)
{
Del(templateEnt);
}

if (TryComp(gridUid, out DecalGridComponent? decalGrid))
{
foreach (var decal in _decals.GetDecalsIntersecting(gridUid, gridBounds, decalGrid))
{
_decals.RemoveDecal(gridUid, decal.Index, decalGrid);
}
}
}

var roomCenter = (room.Offset + room.Size / 2f) * grid.TileSize;
var tileOffset = -roomCenter + grid.TileSizeHalfVector;
_tiles.Clear();
Expand All @@ -183,6 +169,15 @@ public void SpawnRoom(
}

_tiles.Add((rounded, tileRef.Tile));

if (clearExisting)
{
var anchored = _maps.GetAnchoredEntities((gridUid, grid), rounded);
foreach (var ent in anchored)
{
QueueDel(ent);
}
}
}
}

Expand Down
10 changes: 8 additions & 2 deletions Content.Server/Procedural/RoomFillComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ public sealed partial class RoomFillComponent : Component
public bool Rotation = true;

/// <summary>
/// Size of the room to fill.
/// Min size of the possible selected room.
/// </summary>
[DataField]
public Vector2i? Size;
public Vector2i MinSize = new (3, 3);

/// <summary>
/// Max size of the possible selected room.
/// </summary>
[DataField]
public Vector2i MaxSize = new (10, 10);

/// <summary>
/// Rooms allowed for the marker.
Expand Down
6 changes: 1 addition & 5 deletions Content.Server/Procedural/RoomFillSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ public override void Initialize()

private void OnRoomFillMapInit(EntityUid uid, RoomFillComponent component, MapInitEvent args)
{
// Just test things.
if (component.Size == Vector2i.Zero)
return;

var xform = Transform(uid);

if (xform.GridUid != null)
{
var random = new Random();
var room = _dungeon.GetRoomPrototype(random, component.RoomWhitelist, component.Size);
var room = _dungeon.GetRoomPrototype(random, component.RoomWhitelist, component.MinSize, component.MaxSize);

if (room != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ namespace Content.Server.Explosion.Components;
/// Frontier: Triggers on the entity hitting something else as a projectile.
/// </summary>
[RegisterComponent]
public sealed partial class TriggerOnProjectileHitComponent : Component;
public sealed partial class TriggerOnProjectileHitComponent : Component
{
}
4 changes: 2 additions & 2 deletions Content.Shared/CCVar/CCVars.Interactions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Robust.Shared.Configuration;
using Robust.Shared.Configuration;

namespace Content.Shared.CCVar;

Expand Down Expand Up @@ -44,7 +44,7 @@ public sealed partial class CCVars
/// Whether or not the storage UI is static and bound to the hotbar, or unbound and allowed to be dragged anywhere.
/// </summary>
public static readonly CVarDef<bool> StaticStorageUI =
CVarDef.Create("control.static_storage_ui", false, CVar.CLIENTONLY | CVar.ARCHIVE); // Frontier: false
CVarDef.Create("control.static_storage_ui", false, CVar.CLIENTONLY | CVar.ARCHIVE); // Frontier: true<false

/// <summary>
/// Whether or not the storage window uses a transparent or opaque sprite.
Expand Down
8 changes: 1 addition & 7 deletions Content.Shared/Clothing/LoadoutSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public sealed class LoadoutSystem : EntitySystem
[Dependency] private readonly SharedStationSpawningSystem _station = default!;
[Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IDependencyCollection _dependencies = default!; // Frontier

public override void Initialize()
{
Expand Down Expand Up @@ -164,12 +163,7 @@ public void Equip(EntityUid uid, List<ProtoId<StartingGearPrototype>>? startingG
var id = _random.Pick(loadoutGroups);
var proto = _protoMan.Index(id);
var loadout = new RoleLoadout(id);
// Frontier: cache, ensure valid loadouts.
var profile = GetProfile(uid);
var session = _actors.GetSession(uid);
loadout.SetDefault(profile, session, _protoMan, true);
loadout.EnsureValid(profile, session, _dependencies);
// End Frontier
loadout.SetDefault(GetProfile(uid), _actors.GetSession(uid), _protoMan, true);
_station.EquipRoleLoadout(uid, loadout, proto);

GearEquipped(uid);
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Mobs/Systems/MobThresholdSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public bool TryGetIncapThreshold(EntityUid target, [NotNullWhen(true)] out Fixed
MobThresholdsComponent? thresholdComponent = null)
{
threshold = null;
if (!Resolve(target, ref thresholdComponent))
if (!Resolve(target, ref thresholdComponent, logMissing: false)) // Frontier: set logMissing to false
return false;

return TryGetThresholdForState(target, MobState.Critical, out threshold, thresholdComponent)
Expand Down
22 changes: 22 additions & 0 deletions Resources/Changelog/Frontier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7210,3 +7210,25 @@ Entries:
East.
id: 5772
time: '2025-02-15T09:23:15.0000000+00:00'
- author: dvir001
changes:
- type: Tweak
message: >-
Matched the merc magboots stats to the baseline magboots, kept the
sidearm, added to merc loadout.
id: 5773
time: '2025-02-16T14:56:55.0000000+00:00'
- author: dustylens
changes:
- type: Fix
message: Fix missing LV cable on the Comet
id: 5774
time: '2025-02-17T13:29:22.0000000+00:00'
- author: whatston3
changes:
- type: Fix
message: >-
The civilian headset selection should no longer be labeled as
contraband.
id: 5775
time: '2025-02-17T16:47:19.0000000+00:00'
2 changes: 0 additions & 2 deletions Resources/Maps/_NF/Shuttles/Scrap/scrap-crescent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2405,8 +2405,6 @@ entities:
rot: 3.141592653589793 rad
pos: 25.5,20.5
parent: 1
- proto: AirlockScienceLocked
entities:
- uid: 90
components:
- type: Transform
Expand Down
Loading

0 comments on commit 08b3382

Please sign in to comment.