forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
2,728 changed files
with
857,940 additions
and
784,786 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 7.0.x | ||
dotnet-version: 8.0.x | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 7.0.x | ||
dotnet-version: 8.0.x | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 7.0.x | ||
dotnet-version: 8.0.x | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 7.0.x | ||
dotnet-version: 8.0.x | ||
|
||
- name: Get Engine Tag | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 7.0.x | ||
dotnet-version: 8.0.x | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
@@ -64,7 +64,7 @@ jobs: | |
|
||
- name: Package client | ||
run: dotnet run --project Content.Packaging client --no-wipe-release | ||
|
||
- name: Update Build Info | ||
run: Tools/gen_build_info.py | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,29 @@ jobs: | |
# TODO | ||
#- name: Get this week's Patreons | ||
# run: Tools/script2dumppatreons > Resources/Credits/Patrons.yml | ||
|
||
# MAKE SURE YOU ENABLED "Allow GitHub Actions to create and approve pull requests" IN YOUR ACTIONS, OTHERWISE IT WILL MOST LIKELY FAIL | ||
|
||
|
||
# For this you can use a pat token of an account with direct push access to the repo if you have protected branches. | ||
# Uncomment this and comment the other line if you do this. | ||
# https://github.com/stefanzweifel/git-auto-commit-action#push-to-protected-branches | ||
|
||
#- name: Commit new credit files | ||
# uses: stefanzweifel/git-auto-commit-action@v4 | ||
# with: | ||
# commit_message: Update Credits | ||
# commit_author: PJBot <[email protected]> | ||
|
||
# This will make a PR | ||
- name: Set current date as env variable | ||
run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV | ||
|
||
- name: Commit new credit files | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
commit_message: Update Credits | ||
commit_author: PJBot <[email protected]> | ||
commit-message: Update Credits | ||
title: Update Credits | ||
body: This is an automated Pull Request. This PR updates the github contributors in the credits section. | ||
author: PJBot <[email protected]> | ||
branch: automated/credits-${{env.NOW}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 7.0.x | ||
dotnet-version: 8.0.x | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
#nullable enable | ||
using System; | ||
using System.Threading.Tasks; | ||
using BenchmarkDotNet.Attributes; | ||
using Content.IntegrationTests; | ||
using Content.IntegrationTests.Pair; | ||
using Content.Shared.Clothing.Components; | ||
using Content.Shared.Item; | ||
using Robust.Server.GameObjects; | ||
using Robust.Shared; | ||
using Robust.Shared.Analyzers; | ||
using Robust.Shared.GameObjects; | ||
using Robust.Shared.Map; | ||
using Robust.Shared.Random; | ||
|
||
namespace Content.Benchmarks; | ||
|
||
[Virtual] | ||
public class EntityQueryBenchmark | ||
{ | ||
public const string Map = "Maps/atlas.yml"; | ||
|
||
private TestPair _pair = default!; | ||
private IEntityManager _entMan = default!; | ||
private MapId _mapId = new MapId(10); | ||
private EntityQuery<ClothingComponent> _clothingQuery; | ||
|
||
[GlobalSetup] | ||
public void Setup() | ||
{ | ||
ProgramShared.PathOffset = "../../../../"; | ||
PoolManager.Startup(null); | ||
|
||
_pair = PoolManager.GetServerClient().GetAwaiter().GetResult(); | ||
_entMan = _pair.Server.ResolveDependency<IEntityManager>(); | ||
|
||
_pair.Server.ResolveDependency<IRobustRandom>().SetSeed(42); | ||
_pair.Server.WaitPost(() => | ||
{ | ||
var success = _entMan.System<MapLoaderSystem>().TryLoad(_mapId, Map, out _); | ||
if (!success) | ||
throw new Exception("Map load failed"); | ||
_pair.Server.MapMan.DoMapInitialize(_mapId); | ||
}).GetAwaiter().GetResult(); | ||
|
||
_clothingQuery = _entMan.GetEntityQuery<ClothingComponent>(); | ||
|
||
// Apparently ~40% of entities are items, and 1 in 6 of those are clothing. | ||
/* | ||
var entCount = _entMan.EntityCount; | ||
var itemCount = _entMan.Count<ItemComponent>(); | ||
var clothingCount = _entMan.Count<ClothingComponent>(); | ||
var itemRatio = (float) itemCount / entCount; | ||
var clothingRatio = (float) clothingCount / entCount; | ||
Console.WriteLine($"Entities: {entCount}. Items: {itemRatio:P2}. Clothing: {clothingRatio:P2}."); | ||
*/ | ||
} | ||
|
||
[GlobalCleanup] | ||
public async Task Cleanup() | ||
{ | ||
await _pair.DisposeAsync(); | ||
PoolManager.Shutdown(); | ||
} | ||
|
||
[Benchmark] | ||
public int HasComponent() | ||
{ | ||
var hashCode = 0; | ||
var enumerator = _entMan.AllEntityQueryEnumerator<ItemComponent>(); | ||
while (enumerator.MoveNext(out var uid, out var _)) | ||
{ | ||
if (_entMan.HasComponent<ClothingComponent>(uid)) | ||
hashCode = HashCode.Combine(hashCode, uid.Id); | ||
} | ||
|
||
return hashCode; | ||
} | ||
|
||
[Benchmark] | ||
public int HasComponentQuery() | ||
{ | ||
var hashCode = 0; | ||
var enumerator = _entMan.AllEntityQueryEnumerator<ItemComponent>(); | ||
while (enumerator.MoveNext(out var uid, out var _)) | ||
{ | ||
if (_clothingQuery.HasComponent(uid)) | ||
hashCode = HashCode.Combine(hashCode, uid.Id); | ||
} | ||
|
||
return hashCode; | ||
} | ||
|
||
[Benchmark] | ||
public int TryGetComponent() | ||
{ | ||
var hashCode = 0; | ||
var enumerator = _entMan.AllEntityQueryEnumerator<ItemComponent>(); | ||
while (enumerator.MoveNext(out var uid, out var _)) | ||
{ | ||
if (_entMan.TryGetComponent(uid, out ClothingComponent? clothing)) | ||
hashCode = HashCode.Combine(hashCode, clothing.GetHashCode()); | ||
} | ||
|
||
return hashCode; | ||
} | ||
|
||
[Benchmark] | ||
public int TryGetComponentQuery() | ||
{ | ||
var hashCode = 0; | ||
var enumerator = _entMan.AllEntityQueryEnumerator<ItemComponent>(); | ||
while (enumerator.MoveNext(out var uid, out var _)) | ||
{ | ||
if (_clothingQuery.TryGetComponent(uid, out var clothing)) | ||
hashCode = HashCode.Combine(hashCode, clothing.GetHashCode()); | ||
} | ||
|
||
return hashCode; | ||
} | ||
|
||
/// <summary> | ||
/// Enumerate all entities with both an item and clothing component. | ||
/// </summary> | ||
[Benchmark] | ||
public int Enumerator() | ||
{ | ||
var hashCode = 0; | ||
var enumerator = _entMan.AllEntityQueryEnumerator<ItemComponent, ClothingComponent>(); | ||
while (enumerator.MoveNext(out var _, out var clothing)) | ||
{ | ||
hashCode = HashCode.Combine(hashCode, clothing.GetHashCode()); | ||
} | ||
|
||
return hashCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTabEntry.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.