Skip to content

Commit

Permalink
Merge branch 'new-frontiers-14:master' into oscar-shuttle
Browse files Browse the repository at this point in the history
  • Loading branch information
kennedytcooper authored Aug 19, 2023
2 parents efc8eff + be6d787 commit 7da1e64
Show file tree
Hide file tree
Showing 3,564 changed files with 468,216 additions and 478,587 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
17 changes: 15 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
/Content.*/Administration/ @moonheart08 @PaulRitter @DrSmugleaf @Chief-Engineer
/Content.*/Station/ @moonheart08
/Content.*/Maps/ @moonheart08
/Content.*/GameTicking/ @moonheart08
/Content.*/GameTicking/ @moonheart08 @EmoGarbage404
/Resources/ServerInfo/ @moonheart08 @Chief-Engineer
/Resources/ServerInfo/Guidebook/ @moonheart08
/Resources/ServerInfo/Guidebook/ @moonheart08 @EmoGarbage404
/Resources/engineCommandPerms.yml @moonheart08 @Chief-Engineer
/Resources/clientCommandPerms.yml @moonheart08 @Chief-Engineer
/Resources/Prototypes/species.yml @moonheart08
Expand Down Expand Up @@ -39,6 +39,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 Down
55 changes: 55 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: PR Changelogs
concurrency: commit_action
on:
pull_request_target:
types: [closed]

env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
CHANGELOG_DIR: Resources/Changelog/Changelog.yml
PR_NUMBER: ${{ github.event.number }}

jobs:
changelog:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
permissions:
contents: write
steps:
- name: Checkout Master
uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_TOKEN }}
ref: master

- name: Setup Git
run: |
git config --global user.name "${{ vars.CHANGELOG_USER }}"
git config --global user.email "${{ vars.CHANGELOG_EMAIL }}"
shell: bash

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install Dependencies
run: |
cd "Tools/changelog"
npm install
shell: bash

- name: Generate Changelog
run: |
cd "Tools/changelog"
node changelog.js
shell: bash

- name: Commit Changelog
run: |
git pull origin master
git add *.yml
git commit -m "${{ vars.CHANGELOG_MESSAGE }} (#${{ env.PR_NUMBER }})"
git push
shell: bash
continue-on-error: true
24 changes: 24 additions & 0 deletions .github/workflows/publish-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish Changelog

on:
workflow_dispatch:
schedule:
- cron: '0 10 * * *'

jobs:
publish_changelog:
runs-on: ubuntu-latest
steps:

- name: checkout
uses: actions/checkout@v3
with:
token: ${{secrets.GITHUB_TOKEN}}
ref: master

- name: Publish changelog
run: Tools/actions_changelogs_since_last_run.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.CHANGELOG_DISCORD_WEBHOOK }}
continue-on-error: true
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ jobs:
key: ${{ secrets.CENTCOMM_WIZARDS_BUILDS_PUSH_KEY }}
script: /home/wizards-build-push/push.ps1 ${{ github.sha }}

- 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 (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
Expand Down
1 change: 0 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"build",
"/property:GenerateFullPaths=true", // Ask dotnet build to generate full paths for file names.
"/consoleloggerparameters:NoSummary" // Do not generate summary otherwise it leads to duplicate errors in Problems panel

],
"group": {
"kind": "build",
Expand Down
18 changes: 13 additions & 5 deletions Content.Benchmarks/DeviceNetworkingBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ public class DeviceNetworkingBenchmark


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

await server.WaitPost(() =>
Expand All @@ -73,17 +75,23 @@ 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()
{
Expand Down
4 changes: 4 additions & 0 deletions Content.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ public static void Main(string[] args)

public static async Task MainAsync(string[] args)
{
PoolManager.Startup(typeof(Program).Assembly);
var pair = await PoolManager.GetServerClient();
var gameMaps = pair.Pair.Server.ResolveDependency<IPrototypeManager>().EnumeratePrototypes<GameMapPrototype>().ToList();
MapLoadBenchmark.MapsSource = gameMaps.Select(x => x.ID);
await pair.CleanReturnAsync();

#if DEBUG
Console.ForegroundColor = ConsoleColor.Red;
Expand All @@ -33,6 +35,8 @@ public static async Task MainAsync(string[] args)
var config = Environment.GetEnvironmentVariable("ROBUST_BENCHMARKS_ENABLE_SQL") != null ? DefaultSQLConfig.Instance : null;
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config);
#endif

PoolManager.Shutdown();
}
}
}
11 changes: 11 additions & 0 deletions Content.Client/Access/AccessOverriderSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Content.Shared.Access.Systems;
using JetBrains.Annotations;

namespace Content.Client.Access
{
[UsedImplicitly]
public sealed class AccessOverriderSystem : SharedAccessOverriderSystem
{

}
}
72 changes: 72 additions & 0 deletions Content.Client/Access/UI/AccessOverriderBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.Containers.ItemSlots;
using Robust.Client.GameObjects;
using Robust.Shared.Prototypes;
using static Content.Shared.Access.Components.AccessOverriderComponent;

namespace Content.Client.Access.UI
{
public sealed class AccessOverriderBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
private readonly SharedAccessOverriderSystem _accessOverriderSystem = default!;

private AccessOverriderWindow? _window;

public AccessOverriderBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
_accessOverriderSystem = EntMan.System<SharedAccessOverriderSystem>();
}

protected override void Open()
{
base.Open();

List<string> accessLevels;

if (EntMan.TryGetComponent<AccessOverriderComponent>(Owner, out var accessOverrider))
{
accessLevels = accessOverrider.AccessLevels;
accessLevels.Sort();
}

else
{
accessLevels = new List<string>();
_accessOverriderSystem.Log.Error($"No AccessOverrider component found for {EntMan.ToPrettyString(Owner)}!");
}

_window = new AccessOverriderWindow(this, _prototypeManager, accessLevels)
{
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName
};

_window.PrivilegedIdButton.OnPressed += _ => SendMessage(new ItemSlotButtonPressedEvent(PrivilegedIdCardSlotId));

_window.OnClose += Close;
_window.OpenCentered();
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;

_window?.Dispose();
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
var castState = (AccessOverriderBoundUserInterfaceState) state;
_window?.UpdateState(castState);
}

public void SubmitData(List<string> newAccessList)
{
SendMessage(new WriteToTargetAccessReaderIdMessage(newAccessList));
}
}
}
23 changes: 23 additions & 0 deletions Content.Client/Access/UI/AccessOverriderWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<DefaultWindow xmlns="https://spacestation14.io"
MinSize="650 290">
<BoxContainer Orientation="Vertical">
<GridContainer Columns="2">
<GridContainer Columns="3" HorizontalExpand="True">
<Label Text="{Loc 'access-overrider-window-privileged-id'}" />
<Button Name="PrivilegedIdButton" Access="Public"/>
<Label Name="PrivilegedIdLabel" />
</GridContainer>
</GridContainer>
<Label Name="TargetNameLabel" />
<Control MinSize="0 8"/>
<GridContainer Name="AccessLevelGrid" Columns="5" HorizontalAlignment="Center">

<!-- Access level buttons are added here by the C# code -->

</GridContainer>
<Control MinSize="0 8"/>
<Label Name="MissingPrivilegesLabel" />
<Control MinSize="0 4"/>
<Label Name="MissingPrivilegesText" />
</BoxContainer>
</DefaultWindow>
Loading

0 comments on commit 7da1e64

Please sign in to comment.