Skip to content

Commit

Permalink
Merge pull request #373 from lunar-crater-ex/feat-20-03-2023-contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
lunar-crater-ex authored Aug 26, 2023
2 parents 2a7013a + eca0f6e commit dba79f3
Show file tree
Hide file tree
Showing 7,535 changed files with 1,139,647 additions and 1,101,008 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
32 changes: 26 additions & 6 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Last match in file takes precedence.

# Sorting by path instead of by who added it one day :(
/Resources/ConfigPresets/WizardsDen/ @Chief-Engineer

# Moony's Gargantuan List Of Things She Cares About, or MGLOTSCA for short.
# You need to add your name to these entries, not make a new one, if you care about them.
/Content.*/Bql/ @moonheart08
/Content.*/Administration/ @moonheart08 @PaulRitter @DrSmugleaf
/Content.*/Toolshed/ @moonheart08
**/Toolshed/** @moonheart08
*Command.cs @moonheart08
/Content.*/Administration/ @moonheart08 @PaulRitter @DrSmugleaf @Chief-Engineer
/Content.*/Station/ @moonheart08
/Content.*/Maps/ @moonheart08
/Content.*/GameTicking/ @moonheart08
/Resources/ServerInfo/ @moonheart08
/Resources/engineCommandPerms.yml @moonheart08
/Resources/clientCommandPerms.yml @moonheart08
/Content.*/GameTicking/ @moonheart08 @EmoGarbage404
/Resources/ServerInfo/ @moonheart08 @Chief-Engineer
/Resources/ServerInfo/Guidebook/ @moonheart08 @EmoGarbage404
/Resources/engineCommandPerms.yml @moonheart08 @Chief-Engineer
/Resources/clientCommandPerms.yml @moonheart08 @Chief-Engineer
/Resources/Prototypes/species.yml @moonheart08
/Resources/Prototypes/Body/ @moonheart08 @mirrorcult @DrSmugleaf # suffering
/Resources/Prototypes/Maps/ @moonheart08 @Emisse
Expand All @@ -35,6 +41,19 @@
/Content.*/Actions/ @ElectroJr
/Content.*/Explosion/ @ElectroJr

/Content.*/Anomaly/ @EmoGarbage404
/Content.*/Lathe/ @EmoGarbage404
/Content.*/Materials/ @EmoGarbage404
/Content.*/Mech/ @EmoGarbage404
/Content.*/Research/ @EmoGarbage404
/Content.*/Stack/ @EmoGarbage404
/Content.*/Xenoarchaeology/ @EmoGarbage404
/Content.*/Zombies/ @EmoGarbage404
/Resources/Prototypes/Entities/Structures/Specific/anomalies.yml @EmoGarbage404
/Resources/Prototypes/Research/ @EmoGarbage404

/Content.*/Forensics/ @ficcialfaint

/Content.YAMLLinter @PaulRitter @DrSmugleaf
/Content.*/Inventory @PaulRitter
/Content.*/Arcade @PaulRitter
Expand All @@ -50,5 +69,6 @@

# SKREEEE
/Content.*.Database/ @PJB3005 @DrSmugleaf
/Content.Shared.Database/Log*.cs @PJB3005 @DrSmugleaf @Chief-Engineer
/Pow3r/ @PJB3005
/Content.Server/Power/Pow3r/ @PJB3005
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/toolshed-feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Toolshed feature request
about: Suggest a feature for Toolshed (for game admins/developers)
title: "[TOOLSHED REQUEST]"
labels: Toolshed
assignees: moonheart08

---

**Is your feature request related to a problem/bug? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the command you'd like**
A clear and concise description of what you want and what it should do.
If you're a technical user (i.e. programmer) including type signatures is helpful.

**Additional context**
Add any other context or screenshots about the feature request here.
28 changes: 16 additions & 12 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
<!-- The text between the arrows are comments - they will not be visible on your PR. -->

## About the PR
<!-- What does it change? What other things could this impact? -->
<!-- What did you change in this PR? -->

## Why / Balance
<!-- Why was it changed? Link any discussions or issues here. Please discuss how this would affect game balance. -->

**Media**
## Technical details
<!-- If this is a code change, summarize at high level how your new code works. This makes it easier to review. -->

## Media
<!--
PRs which make ingame changes (adding clothing, items, new features, etc) are required to have media attached that showcase the changes.
Small fixes/refactors are exempt.
Expand All @@ -18,22 +23,21 @@ Check the box below to confirm that you have in fact seen this (put an X in the

- [ ] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase

**Changelog**
## Breaking changes
<!--
Here you can fill out a changelog that will automatically be added to the game when your PR is merged.
Only put changes that are visible and important to the player on the changelog.
Don't consider the entry type suffix (e.g. add) to be "part" of the sentence:
bad: - add: a new tool for engineers
good: - add: added a new tool for engineers
List any breaking changes, including namespace, public class/method/field changes, prototype renames; and provide instructions for fixing them. This will be pasted in #codebase-changes.
-->

Putting a name after the :cl: symbol will change the name that shows in the changelog (otherwise it takes your GitHub username)
Like so: :cl: PJB
**Changelog**
<!--
Make players aware of new features and changes that could affect how they play the game by adding a Changelog entry. Please read the Changelog guidelines located at: https://docs.spacestation14.io/en/getting-started/pr-guideline#changelog
-->

<!--
Make sure to take this Changelog template out of the comment block in order for it to show up.
:cl:
- add: Added fun!
- remove: Removed fun!
- tweak: Changed fun!
- fix: Fixed fun!
-->
2 changes: 1 addition & 1 deletion .github/workflows/build-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
shell: pwsh
run: |
$env:DOTNET_gcServer=1
dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0
dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed
ci-success:
name: Build & Test Debug
needs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
shell: pwsh
run: |
$env:DOTNET_gcServer=1
dotnet test --configuration Tools --no-build Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0
dotnet test --configuration Tools --no-build Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed
ci-success:
name: Build & Test Release
needs:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install dependencies
run: sudo apt-get install -y python3-paramiko

- uses: actions/checkout@v2
with:
submodules: 'recursive'
Expand Down Expand Up @@ -57,8 +60,13 @@ jobs:
key: ${{ secrets.CENTCOMM_WIZARDS_BUILDS_PUSH_KEY }}
script: /home/wizards-build-push/push.ps1 ${{ github.sha }}

- name: Publish changelog
- name: Publish changelog (Discord)
run: Tools/actions_changelogs_since_last_run.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.CHANGELOG_DISCORD_WEBHOOK }}

- name: Publish changelog (RSS)
run: Tools/actions_changelog_rss.py
env:
CHANGELOG_RSS_KEY: ${{ secrets.CHANGELOG_RSS_KEY }}
43 changes: 25 additions & 18 deletions Content.Benchmarks/DeviceNetworkingBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Content.IntegrationTests;
using Content.IntegrationTests.Pair;
using Content.IntegrationTests.Tests.DeviceNetwork;
using Content.Server.DeviceNetwork;
using Content.Server.DeviceNetwork.Systems;
using Robust.Shared;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;

namespace Content.Benchmarks;
Expand All @@ -18,20 +17,22 @@ namespace Content.Benchmarks;
[MemoryDiagnoser]
public class DeviceNetworkingBenchmark
{
private PairTracker _pair = default!;
private TestPair _pair = default!;
private DeviceNetworkTestSystem _deviceNetTestSystem = default!;
private DeviceNetworkSystem _deviceNetworkSystem = default!;
private EntityUid _sourceEntity;
private EntityUid _sourceWirelessEntity;
private List<EntityUid> _targetEntities = new();
private List<EntityUid> _targetWirelessEntities = new();
private readonly List<EntityUid> _targetEntities = new();
private readonly List<EntityUid> _targetWirelessEntities = new();


private NetworkPayload _payload = default!;

[TestPrototypes]
private const string Prototypes = @"
- type: entity
name: DummyNetworkDevice
id: DummyNetworkDevice
name: DummyNetworkDevicePrivate
id: DummyNetworkDevicePrivate
components:
- type: DeviceNetwork
transmitFrequency: 100
Expand All @@ -58,8 +59,8 @@ public class DeviceNetworkingBenchmark
public async Task SetupAsync()
{
ProgramShared.PathOffset = "../../../../";
_pair = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
var server = _pair.Pair.Server;
_pair = await PoolManager.GetServerClient();
var server = _pair.Server;

await server.WaitPost(() =>
{
Expand All @@ -75,23 +76,29 @@ await server.WaitPost(() =>
["testbool"] = true
};

_sourceEntity = entityManager.SpawnEntity("DummyNetworkDevice", MapCoordinates.Nullspace);
_sourceEntity = entityManager.SpawnEntity("DummyNetworkDevicePrivate", MapCoordinates.Nullspace);
_sourceWirelessEntity = entityManager.SpawnEntity("DummyWirelessNetworkDevice", MapCoordinates.Nullspace);

for (var i = 0; i < EntityCount; i++)
{
_targetEntities.Add(entityManager.SpawnEntity("DummyNetworkDevice", MapCoordinates.Nullspace));
_targetEntities.Add(entityManager.SpawnEntity("DummyNetworkDevicePrivate", MapCoordinates.Nullspace));
_targetWirelessEntities.Add(entityManager.SpawnEntity("DummyWirelessNetworkDevice", MapCoordinates.Nullspace));
}
});
}

[GlobalCleanup]
public async Task Cleanup()
{
await _pair.DisposeAsync();
}

[Benchmark(Baseline = true, Description = "Entity Events")]
public async Task EventSentBaseline()
{
var server = _pair.Pair.Server;
var server = _pair.Server;

_pair.Pair.Server.Post(() =>
_pair.Server.Post(() =>
{
foreach (var entity in _targetEntities)
{
Expand All @@ -106,9 +113,9 @@ public async Task EventSentBaseline()
[Benchmark(Description = "Device Net Broadcast No Connection Checks")]
public async Task DeviceNetworkBroadcastNoConnectionChecks()
{
var server = _pair.Pair.Server;
var server = _pair.Server;

_pair.Pair.Server.Post(() =>
_pair.Server.Post(() =>
{
_deviceNetworkSystem.QueuePacket(_sourceEntity, null, _payload, 100);
});
Expand All @@ -120,9 +127,9 @@ public async Task DeviceNetworkBroadcastNoConnectionChecks()
[Benchmark(Description = "Device Net Broadcast Wireless Connection Checks")]
public async Task DeviceNetworkBroadcastWirelessConnectionChecks()
{
var server = _pair.Pair.Server;
var server = _pair.Server;

_pair.Pair.Server.Post(() =>
_pair.Server.Post(() =>
{
_deviceNetworkSystem.QueuePacket(_sourceWirelessEntity, null, _payload, 100);
});
Expand Down
8 changes: 4 additions & 4 deletions Content.Benchmarks/DynamicTreeBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Content.Benchmarks
[Virtual]
public class DynamicTreeBenchmark
{
private static readonly Box2[] _aabbs1 =
private static readonly Box2[] Aabbs1 =
{
((Box2) default).Enlarged(1), //2x2 square
((Box2) default).Enlarged(2), //4x4 square
Expand Down Expand Up @@ -39,11 +39,11 @@ public class DynamicTreeBenchmark
public void Setup()
{
_b2Tree = new B2DynamicTree<int>();
_tree = new DynamicTree<int>((in int value) => _aabbs1[value], capacity: 16);
_tree = new DynamicTree<int>((in int value) => Aabbs1[value], capacity: 16);

for (var i = 0; i < _aabbs1.Length; i++)
for (var i = 0; i < Aabbs1.Length; i++)
{
var aabb = _aabbs1[i];
var aabb = Aabbs1[i];
_b2Tree.CreateProxy(aabb, i);
_tree.Add(i);
}
Expand Down
6 changes: 2 additions & 4 deletions Content.Benchmarks/EntityFetchBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,7 @@ private abstract class EntityStorage<TEntity, TEntityUid> : IEntityStorage<TEnti
public TEntity GetEntity(TEntityUid entityUid)
{
if (!TryGetEntity(entityUid, out var entity))
{
throw new ArgumentException();
}
throw new ArgumentException($"Failed to get entity {entityUid} from storage.");

return entity;
}
Expand All @@ -200,7 +198,7 @@ public TEntity GetEntity(TEntityUid entityUid)
private sealed class GenEntityStorage : EntityStorage<GenEntity, GenEntityUid>
{
private (int generation, GenEntity entity)[] _entities = new (int, GenEntity)[1];
private readonly List<int> _availableSlots = new() {0};
private readonly List<int> _availableSlots = new() { 0 };

public override bool TryGetEntity(GenEntityUid entityUid, out GenEntity entity)
{
Expand Down
6 changes: 3 additions & 3 deletions Content.Benchmarks/EntityManagerGetAllComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Content.Benchmarks
{
[Virtual]
public class EntityManagerGetAllComponents
public partial class EntityManagerGetAllComponents
{
private IEntityManager _entityManager;

Expand Down Expand Up @@ -48,7 +48,7 @@ public void Setup()
var componentFactory = new Mock<IComponentFactory>();
componentFactory.Setup(p => p.GetComponent<DummyComponent>()).Returns(new DummyComponent());
componentFactory.Setup(p => p.GetRegistration(It.IsAny<DummyComponent>())).Returns(dummyReg);
componentFactory.Setup(p => p.GetAllRefTypes()).Returns(new[] {CompIdx.Index<DummyComponent>()});
componentFactory.Setup(p => p.GetAllRefTypes()).Returns(new[] { CompIdx.Index<DummyComponent>() });

IoCManager.RegisterInstance<IComponentFactory>(componentFactory.Object);

Expand Down Expand Up @@ -87,7 +87,7 @@ public int Noop()
return count;
}

private sealed class DummyComponent : Component
private sealed partial class DummyComponent : Component
{
}
}
Expand Down
Loading

0 comments on commit dba79f3

Please sign in to comment.