Skip to content

Commit

Permalink
Merge branch 'master' into Goblin-Species
Browse files Browse the repository at this point in the history
  • Loading branch information
ErhardSteinhauer committed Mar 5, 2024
2 parents 6f034cd + 1c1e8da commit 09ef1cf
Show file tree
Hide file tree
Showing 4,789 changed files with 894,978 additions and 1,075,590 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,10 @@ dotnet_naming_symbols.type_parameters_symbols.applicable_kinds = type_parameter
resharper_braces_for_ifelse = required_for_multiline
resharper_keep_existing_attribute_arrangement = true

[*.{csproj,xml,yml,yaml,dll.config,msbuildproj,targets}]
[*.{csproj,xml,yml,yaml,dll.config,msbuildproj,targets,props}]
indent_size = 2

[nuget.config]
indent_size = 2

[{*.yaml,*.yml}]
Expand Down
4 changes: 2 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8="
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
fi
use flake
94 changes: 94 additions & 0 deletions .github/CODEOWNERS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Last match in file takes precedence.

# Sorting by path instead of by who added it one day :(
# this isn't how codeowners rules work pls read the first comment instead of trying to force a sorting order
#/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.*/Toolshed/ @moonheart08
#**/Toolshed/** @moonheart08
#*Command.cs @moonheart08
#/Content.*/Administration/ @moonheart08 @DrSmugleaf @Chief-Engineer
#/Content.*/Station/ @moonheart08
#/Content.*/Maps/ @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/Maps/ @Emisse

#/Resources/Prototypes/Body/ @DrSmugleaf # suffering
#/Resources/Prototypes/Entities/Mobs/Player/ @DrSmugleaf
#/Resources/Prototypes/Entities/Mobs/Species/ @DrSmugleaf
#/Content.*/Body/ @DrSmugleaf
#/Content.YAMLLinter @DrSmugleaf
#/Content.Shared/Damage/ @DrSmugleaf

#/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

# SKREEEE
#/Content.*.Database/ @PJB3005 @DrSmugleaf
#/Content.Shared.Database/Log*.cs @PJB3005 @DrSmugleaf @Chief-Engineer
#/Pow3r/ @PJB3005
#/Content.Server/Power/Pow3r/ @PJB3005

# notafet
#/Content.*/Atmos/ @Partmedia
#/Content.*/Botany/ @Partmedia

#Jezi
#/Content.*/Medical @Jezithyr
#/Content.*/Body @Jezithyr

## Frontier goes here:

# Config files
/Resources/ConfigPresets/* @Cheackraze

# Mapchecker
/.github/mapchecker/* @TsjipTsjip
/.github/workflows/frontier-mapchecker.yml @TsjipTsjip

# All maps
/Resources/Maps/_NF/* @MagnusCrowe
/Resources/Prototypes/_NF/Shipyard/* @MagnusCrowe

# Bluespace Events
/Resources/Maps/_NF/Bluespace/asteroidbunker.yml @MagnusCrowe @FoxxoTrystan
/Resources/Maps/_NF/Bluespace/asteroidvault.yml @MagnusCrowe @FoxxoTrystan

# Shuttles
# McCargo
/Resources/Maps/_NF/Shuttles/mccargo.yml @MagnusCrowe @dvir001
/Resources/Prototypes/_NF/Shipyard/mccargo.yml @MagnusCrowe @dvir001
# McDelivery
/Resources/Maps/_NF/Shuttles/mcdelivery.yml @MagnusCrowe @dvir001
/Resources/Prototypes/_NF/Shipyard/mcdelivery.yml @MagnusCrowe @dvir001
# Hunter
/Resources/Maps/_NF/Shuttles/hunter.yml @MagnusCrowe @FoxxoTrystan
/Resources/Prototypes/_NF/Shipyard/hunter.yml @MagnusCrowe @FoxxoTrystan
# Infiltrator
/Resources/Maps/_NF/Shuttles/infiltrator.yml @MagnusCrowe @FoxxoTrystan
/Resources/Prototypes/_NF/Shipyard/infiltrator.yml @MagnusCrowe @FoxxoTrystan

# Races - Trystan wanted a ping on this
/Resources/Prototypes/Entities/Mobs/Player/* @FoxxoTrystan
/Resources/Prototypes/Entities/Mobs/Species/* @FoxxoTrystan
/Resources/Prototypes/DeltaV/Entities/Mobs/Species/* @FoxxoTrystan
/Resources/Prototypes/DeltaV/Entities/Mobs/Player/* @FoxxoTrystan
/Resources/Prototypes/_Nyano/Entities/Mobs/Species/* @FoxxoTrystan
/Resources/Prototypes/_Nyano/Entities/Mobs/Player/* @FoxxoTrystan
27 changes: 27 additions & 0 deletions .github/workflows/close-master-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Close PR's on master

on:
pull_request_target:
types: [ opened, ready_for_review ]

jobs:
run:
runs-on: ubuntu-latest
if: ${{github.head_ref == 'master' || github.head_ref == 'main' || github.head_ref == 'develop'}}

steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: "Thank you for contributing to the Space Station 14 repository. Unfortunately, it looks like you submitted your pull request from the master branch. We suggest you follow [our git usage documentation](https://docs.spacestation14.com/en/general-development/setup/git-for-the-ss14-developer.html) \n\n You can move your current work from the master branch to another branch by doing `git branch <branch_name` and resetting the master branch."

# If you prefer to just comment on the pr and not close it, uncomment the bellow and comment the above

# - uses: actions/github-script@v7
# with:
# script: |
# github.rest.issues.createComment({
# issue_number: ${{ github.event.number }},
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: "Thank you for contributing to the Space Station 14 repository. Unfortunately, it looks like you submitted your pull request from the master branch. We suggest you follow [our git usage documentation](https://docs.spacestation14.com/en/general-development/setup/git-for-the-ss14-developer.html) \n\n You can move your current work from the master branch to another branch by doing `git branch <branch_name` and resetting the master branch. \n\n This pr won't be automatically closed. However, a maintainer may close it for this reason."
# })
7 changes: 0 additions & 7 deletions .run/Content Server+Client.run.xml

This file was deleted.

7 changes: 7 additions & 0 deletions .run/Content.Server+Client.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Content Server+Client" type="CompoundRunConfigurationType">
<toRun name="Content.Client" type="DotNetProject" />
<toRun name="Content.Server" type="DotNetProject" />
<method v="2" />
</configuration>
</component>
8 changes: 4 additions & 4 deletions Content.Benchmarks/ColorInterpolateBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static Color InterpolateSysVector4(Color a, Color b,
public static Color InterpolateSysVector4In(in Color endPoint1, in Color endPoint2,
float lambda)
{
ref var sva = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(endPoint1));
ref var svb = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(endPoint2));
ref var sva = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(in endPoint1));
ref var svb = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(in endPoint2));

var res = SysVector4.Lerp(svb, sva, lambda);

Expand All @@ -156,8 +156,8 @@ public static Color InterpolateSimd(Color a, Color b,
public static Color InterpolateSimdIn(in Color a, in Color b,
float lambda)
{
var vecA = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(a));
var vecB = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(b));
var vecA = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(in a));
var vecB = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(in b));

vecB = Fma.MultiplyAdd(Sse.Subtract(vecB, vecA), Vector128.Create(lambda), vecA);

Expand Down
2 changes: 1 addition & 1 deletion Content.Benchmarks/Content.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<LangVersion>12</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="BenchmarkDotNet" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Content.Client\Content.Client.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion Content.Benchmarks/DeviceNetworkingBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using Content.IntegrationTests;
using Content.IntegrationTests.Pair;
using Content.IntegrationTests.Tests.DeviceNetwork;
using Content.Server.DeviceNetwork;
using Content.Server.DeviceNetwork.Systems;
using Content.Shared.DeviceNetwork;
using Robust.Shared;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
Expand Down
2 changes: 1 addition & 1 deletion Content.Benchmarks/MapLoadBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async Task Cleanup()
PoolManager.Shutdown();
}

public static readonly string[] MapsSource = { "Empty", "Box", "Aspid", "Bagel", "Dev", "CentComm", "Atlas", "Core", "TestTeg", "Saltern", "Packed", "Omega", "Cluster", "Gemini", "Reach", "Origin", "Meta", "Marathon", "Europa", "MeteorArena", "Fland", "Barratry" };
public static readonly string[] MapsSource = { "Empty", "Box", "Bagel", "Dev", "CentComm", "Atlas", "Core", "TestTeg", "Saltern", "Packed", "Omega", "Cluster", "Reach", "Origin", "Meta", "Marathon", "Europa", "MeteorArena", "Fland", "Barratry" };

[ParamsSource(nameof(MapsSource))]
public string Map;
Expand Down
5 changes: 0 additions & 5 deletions Content.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ internal static class Program

public static void Main(string[] args)
{
MainAsync(args).GetAwaiter().GetResult();
}

public static async Task MainAsync(string[] args)
{
#if DEBUG
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("\nWARNING: YOU ARE RUNNING A DEBUG BUILD, USE A RELEASE BUILD FOR AN ACCURATE BENCHMARK");
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeMana

foreach (var job in jobs)
{
if (!job.SetPreference)
if (!job.OverrideConsoleVisibility.GetValueOrDefault(job.SetPreference))
{
continue;
}
Expand Down
23 changes: 12 additions & 11 deletions Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ private void OnWorldTargetHandleState(EntityUid uid, WorldTargetActionComponent

private void BaseHandleState<T>(EntityUid uid, BaseActionComponent component, BaseActionComponentState state) where T : BaseActionComponent
{
// TODO ACTIONS use auto comp states
component.Icon = state.Icon;
component.IconOn = state.IconOn;
component.IconColor = state.IconColor;
component.Keywords = new HashSet<string>(state.Keywords);
component.Keywords.Clear();
component.Keywords.UnionWith(state.Keywords);
component.Enabled = state.Enabled;
component.Toggled = state.Toggled;
component.Cooldown = state.Cooldown;
Expand All @@ -101,8 +103,7 @@ private void BaseHandleState<T>(EntityUid uid, BaseActionComponent component, Ba
component.ItemIconStyle = state.ItemIconStyle;
component.Sound = state.Sound;

if (_playerManager.LocalPlayer?.ControlledEntity == component.AttachedEntity)
ActionsUpdated?.Invoke();
UpdateAction(uid, component);
}

protected override void UpdateAction(EntityUid? actionId, BaseActionComponent? action = null)
Expand All @@ -111,7 +112,7 @@ protected override void UpdateAction(EntityUid? actionId, BaseActionComponent? a
return;

base.UpdateAction(actionId, action);
if (_playerManager.LocalPlayer?.ControlledEntity != action.AttachedEntity)
if (_playerManager.LocalEntity != action.AttachedEntity)
return;

ActionsUpdated?.Invoke();
Expand Down Expand Up @@ -144,7 +145,7 @@ private void HandleComponentState(EntityUid uid, ActionsComponent component, ref
_added.Add((actionId, action));
}

if (_playerManager.LocalPlayer?.ControlledEntity != uid)
if (_playerManager.LocalEntity != uid)
return;

foreach (var action in _removed)
Expand Down Expand Up @@ -177,23 +178,23 @@ public static int ActionComparer((EntityUid, BaseActionComponent?) a, (EntityUid
protected override void ActionAdded(EntityUid performer, EntityUid actionId, ActionsComponent comp,
BaseActionComponent action)
{
if (_playerManager.LocalPlayer?.ControlledEntity != performer)
if (_playerManager.LocalEntity != performer)
return;

OnActionAdded?.Invoke(actionId);
}

protected override void ActionRemoved(EntityUid performer, EntityUid actionId, ActionsComponent comp, BaseActionComponent action)
{
if (_playerManager.LocalPlayer?.ControlledEntity != performer)
if (_playerManager.LocalEntity != performer)
return;

OnActionRemoved?.Invoke(actionId);
}

public IEnumerable<(EntityUid Id, BaseActionComponent Comp)> GetClientActions()
{
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user)
if (_playerManager.LocalEntity is not { } user)
return Enumerable.Empty<(EntityUid, BaseActionComponent)>();

return GetActions(user);
Expand All @@ -216,7 +217,7 @@ public void UnlinkAllActions()

public void LinkAllActions(ActionsComponent? actions = null)
{
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user ||
if (_playerManager.LocalEntity is not { } user ||
!Resolve(user, ref actions, false))
{
return;
Expand All @@ -233,7 +234,7 @@ public override void Shutdown()

public void TriggerAction(EntityUid actionId, BaseActionComponent action)
{
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user ||
if (_playerManager.LocalEntity is not { } user ||
!TryComp(user, out ActionsComponent? actions))
{
return;
Expand Down Expand Up @@ -261,7 +262,7 @@ public void TriggerAction(EntityUid actionId, BaseActionComponent action)
/// </summary>
public void LoadActionAssignments(string path, bool userData)
{
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user)
if (_playerManager.LocalEntity is not { } user)
return;

var file = new ResPath(path).ToRootedPath();
Expand Down
17 changes: 9 additions & 8 deletions Content.Client/Administration/Managers/ClientAdminManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ public sealed class ClientAdminManager : IClientAdminManager, IClientConGroupImp
[Dependency] private readonly IClientNetManager _netMgr = default!;
[Dependency] private readonly IClientConGroupController _conGroup = default!;
[Dependency] private readonly IResourceManager _res = default!;
[Dependency] private readonly ILogManager _logManager = default!;

private AdminData? _adminData;
private readonly HashSet<string> _availableCommands = new();

private readonly AdminCommandPermissions _localCommandPermissions = new();
private ISawmill _sawmill = default!;

public event Action? AdminStatusUpdated;

Expand Down Expand Up @@ -92,17 +94,17 @@ private void UpdateMessageRx(MsgUpdateAdminStatus message)
}

_availableCommands.UnionWith(message.AvailableCommands);
Logger.DebugS("admin", $"Have {message.AvailableCommands.Length} commands available");
_sawmill.Debug($"Have {message.AvailableCommands.Length} commands available");

_adminData = message.Admin;
if (_adminData != null)
{
var flagsText = string.Join("|", AdminFlagsHelper.FlagsToNames(_adminData.Flags));
Logger.InfoS("admin", $"Updated admin status: {_adminData.Active}/{_adminData.Title}/{flagsText}");
_sawmill.Info($"Updated admin status: {_adminData.Active}/{_adminData.Title}/{flagsText}");
}
else
{
Logger.InfoS("admin", "Updated admin status: Not admin");
_sawmill.Info("Updated admin status: Not admin");
}

AdminStatusUpdated?.Invoke();
Expand All @@ -114,26 +116,25 @@ private void UpdateMessageRx(MsgUpdateAdminStatus message)
void IPostInjectInit.PostInject()
{
_conGroup.Implementation = this;
_sawmill = _logManager.GetSawmill("admin");
}

public AdminData? GetAdminData(EntityUid uid, bool includeDeAdmin = false)
{
return uid == _player.LocalPlayer?.ControlledEntity
? _adminData
: null;
return uid == _player.LocalEntity ? _adminData : null;
}

public AdminData? GetAdminData(ICommonSession session, bool includeDeAdmin = false)
{
if (_player.LocalPlayer?.UserId == session.UserId)
if (_player.LocalUser == session.UserId)
return _adminData;

return null;
}

public AdminData? GetAdminData(bool includeDeAdmin = false)
{
if (_player.LocalPlayer is { Session: { } session })
if (_player.LocalSession is { } session)
return GetAdminData(session, includeDeAdmin);

return null;
Expand Down
Loading

0 comments on commit 09ef1cf

Please sign in to comment.