Skip to content

Commit

Permalink
Merge branch 'Workbench-Team:arumoon-server' into arumoon-server
Browse files Browse the repository at this point in the history
  • Loading branch information
DjfjdfofdjfjD committed Jul 9, 2023
2 parents b6287cc + 715fc7f commit 45d4aac
Show file tree
Hide file tree
Showing 816 changed files with 25,017 additions and 16,873 deletions.
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 }}
10 changes: 4 additions & 6 deletions Content.Benchmarks/DeviceNetworkingBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Content.IntegrationTests;
Expand All @@ -9,7 +8,6 @@
using Robust.Shared;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;

namespace Content.Benchmarks;
Expand All @@ -23,8 +21,8 @@ public class DeviceNetworkingBenchmark
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!;
Expand Down Expand Up @@ -58,7 +56,7 @@ public class DeviceNetworkingBenchmark
public async Task SetupAsync()
{
ProgramShared.PathOffset = "../../../../";
_pair = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
_pair = await PoolManager.GetServerClient(new PoolSettings { NoClient = true, ExtraPrototypes = Prototypes });
var server = _pair.Pair.Server;

await server.WaitPost(() =>
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
2 changes: 1 addition & 1 deletion Content.Benchmarks/EntityManagerGetAllComponents.cs
Original file line number Diff line number Diff line change
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
5 changes: 3 additions & 2 deletions Content.Benchmarks/MapLoadBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ public async Task Cleanup()

public static IEnumerable<string> MapsSource { get; set; }

[ParamsSource(nameof(MapsSource))] public string Map;
[ParamsSource(nameof(MapsSource))]
public string Map;

public static Dictionary<string, string> Paths;
public Dictionary<string, string> Paths;

[Benchmark]
public async Task LoadMap()
Expand Down
8 changes: 4 additions & 4 deletions Content.Benchmarks/NetSerializerIntBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public class NetSerializerIntBenchmark
{
private MemoryStream _writeStream;
private MemoryStream _readStream;
private ushort _x16 = 5;
private uint _x32 = 5;
private ulong _x64 = 5;
private readonly ushort _x16 = 5;
private readonly uint _x32 = 5;
private readonly ulong _x64 = 5;
private ushort _read16;
private uint _read32;
private ulong _read64;
Expand All @@ -24,7 +24,7 @@ public void Setup()
{
_writeStream = new MemoryStream(64);
_readStream = new MemoryStream();
_readStream.Write(new byte[]{0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8});
_readStream.Write(new byte[] { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8 });
}

[Benchmark]
Expand Down
Loading

0 comments on commit 45d4aac

Please sign in to comment.