Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ resharper_csharp_qualified_using_at_nested_scope = false
resharper_csharp_prefer_qualified_reference = false
resharper_csharp_allow_alias = false

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

[nuget.config]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-docfx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-map-renderer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Get Engine Tag
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Get Engine Tag
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yaml-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# MSbuild binlog files
*.binlog

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

Expand Down
2 changes: 1 addition & 1 deletion BuildChecker/git_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pathlib import Path
from typing import List

SOLUTION_PATH = Path("..") / "SpaceStation14.sln"
SOLUTION_PATH = Path("..") / "SpaceStation14.slnx"
# If this doesn't match the saved version we overwrite them all.
CURRENT_HOOKS_VERSION = "2"
QUIET = len(sys.argv) == 2 and sys.argv[1] == "--quiet"
Expand Down
23 changes: 14 additions & 9 deletions Content.Benchmarks/Content.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\RobustToolbox\MSBuild\Robust.Properties.targets" />
<PropertyGroup>
<!-- Work around https://github.com/dotnet/project-system/issues/4314 -->
<TargetFramework>$(TargetFramework)</TargetFramework>
<OutputPath>..\bin\Content.Benchmarks\</OutputPath>
<IsPackable>false</IsPackable>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>12</LangVersion>
<IsTestingPlatformApplication>false</IsTestingPlatformApplication>
<Nullable>disable</Nullable>
</PropertyGroup>
<Import Project="../MSBuild/Content.props" />
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />

<!-- pin transitive deps -->
<PackageReference Include="System.Management" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Content.Client\Content.Client.csproj" />
<ProjectReference Include="..\Content.Server\Content.Server.csproj" />
<ProjectReference Include="..\Content.Shared\Content.Shared.csproj" />
<ProjectReference Include="..\Content.Tests\Content.Tests.csproj" />
<ProjectReference Include="..\Content.IntegrationTests\Content.IntegrationTests.csproj" />
<ProjectReference Include="..\RobustToolbox\Robust.Benchmarks\Robust.Benchmarks.csproj" />
<ProjectReference Include="..\RobustToolbox\Robust.Client\Robust.Client.csproj" />
<ProjectReference Include="..\RobustToolbox\Robust.Server\Robust.Server.csproj" />
<ProjectReference Include="..\RobustToolbox\Robust.Shared.Maths\Robust.Shared.Maths.csproj" />
<ProjectReference Include="..\RobustToolbox\Robust.Shared\Robust.Shared.csproj" />
</ItemGroup>

<Import Project="..\RobustToolbox\Imports\Lidgren.props" />
<Import Project="..\RobustToolbox\Imports\Client.props" />
<Import Project="..\RobustToolbox\Imports\Server.props" />
<Import Project="..\RobustToolbox\Imports\Shared.props" />
<Import Project="..\RobustToolbox\Imports\Benchmarks.props" />
<Import Project="..\RobustToolbox\Imports\Testing.props" />
</Project>
5 changes: 3 additions & 2 deletions Content.Benchmarks/DeviceNetworkingBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Content.IntegrationTests;
using Content.IntegrationTests.Pair;
Expand All @@ -10,6 +8,9 @@
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.UnitTesting.Pool;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Content.Benchmarks;

Expand Down
17 changes: 9 additions & 8 deletions Content.Client/Administration/UI/BanList/BanListEui.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using System.Linq;
using System.Numerics;
using Content.Client.Administration.UI.BanList.Bans;
using Content.Client.Administration.UI.BanList.RoleBans;
using Content.Client.Eui;
Expand Down Expand Up @@ -73,7 +74,7 @@ private static string FormatDate(DateTimeOffset date)
return date.ToString("MM/dd/yyyy h:mm tt");
}

public static void SetData<T>(IBanListLine<T> line, SharedServerBan ban) where T : SharedServerBan
public static void SetData<T>(IBanListLine<T> line, SharedBan ban) where T : SharedBan
{
line.Reason.Text = ban.Reason;
line.BanTime.Text = FormatDate(ban.BanTime);
Expand All @@ -94,20 +95,20 @@ public static void SetData<T>(IBanListLine<T> line, SharedServerBan ban) where T
line.BanningAdmin.Text = ban.BanningAdminName;
}

private void OnLineIdsClicked<T>(IBanListLine<T> line) where T : SharedServerBan
private void OnLineIdsClicked<T>(IBanListLine<T> line) where T : SharedBan
{
_popup?.Close();
_popup = null;

var ban = line.Ban;
var id = ban.Id == null ? string.Empty : Loc.GetString("ban-list-id", ("id", ban.Id.Value));
var ip = ban.Address == null
var ip = ban.Addresses.Length == 0
? string.Empty
: Loc.GetString("ban-list-ip", ("ip", ban.Address.Value.address));
var hwid = ban.HWId == null ? string.Empty : Loc.GetString("ban-list-hwid", ("hwid", ban.HWId));
var guid = ban.UserId == null
: Loc.GetString("ban-list-ip", ("ip", string.Join(',', ban.Addresses.Select(a => a.address))));
var hwid = ban.HWIds.Length == 0 ? string.Empty : Loc.GetString("ban-list-hwid", ("hwid", string.Join(',', ban.HWIds)));
var guid = ban.UserIds.Length == 0
? string.Empty
: Loc.GetString("ban-list-guid", ("guid", ban.UserId.Value.ToString()));
: Loc.GetString("ban-list-guid", ("guid", string.Join(',', ban.UserIds)));

_popup = new BanListIdsPopup(id, ip, hwid, guid);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public BanListControl()
RobustXamlLoader.Load(this);
}

public void SetBans(List<SharedServerBan> bans)
public void SetBans(List<SharedBan> bans)
{
for (var i = Bans.ChildCount - 1; i >= 1; i--)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
namespace Content.Client.Administration.UI.BanList.Bans;

[GenerateTypedNameReferences]
public sealed partial class BanListLine : BoxContainer, IBanListLine<SharedServerBan>
public sealed partial class BanListLine : BoxContainer, IBanListLine<SharedBan>
{
public SharedServerBan Ban { get; }
public SharedBan Ban { get; }

public event Action<BanListLine>? IdsClicked;

public BanListLine(SharedServerBan ban)
public BanListLine(SharedBan ban)
{
RobustXamlLoader.Load(this);

Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Administration/UI/BanList/IBanListLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Content.Client.Administration.UI.BanList;

public interface IBanListLine<T> where T : SharedServerBan
public interface IBanListLine<T> where T : SharedBan
{
T Ban { get; }
Label Reason { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public RoleBanListControl()
RobustXamlLoader.Load(this);
}

public void SetRoleBans(List<SharedServerRoleBan> bans)
public void SetRoleBans(List<SharedBan> bans)
{
for (var i = RoleBans.ChildCount - 1; i >= 1; i--)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
namespace Content.Client.Administration.UI.BanList.RoleBans;

[GenerateTypedNameReferences]
public sealed partial class RoleBanListLine : BoxContainer, IBanListLine<SharedServerRoleBan>
public sealed partial class RoleBanListLine : BoxContainer, IBanListLine<SharedBan>
{
public SharedServerRoleBan Ban { get; }
public SharedBan Ban { get; }

public event Action<RoleBanListLine>? IdsClicked;

public RoleBanListLine(SharedServerRoleBan ban)
public RoleBanListLine(SharedBan ban)
{
RobustXamlLoader.Load(this);

Ban = ban;
IdsHidden.OnPressed += IdsPressed;

BanListEui.SetData(this, ban);
Role.Text = ban.Role;
Role.Text = string.Join(", ", ban.Roles ?? []);
}

private void IdsPressed(ButtonEventArgs buttonEventArgs)
Expand Down
9 changes: 7 additions & 2 deletions Content.Client/Administration/UI/Notes/AdminNotesLine.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private void Refresh()

TimeLabel.Text = Note.CreatedAt.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
ServerLabel.Text = Note.ServerName ?? "Unknown";
RoundLabel.Text = Note.Round == null ? "Unknown round" : "Round " + Note.Round;
RoundLabel.Text = Note.Rounds.Length == 0 ? "Unknown round" : "Round " + string.Join(',', Note.Rounds);
AdminLabel.Text = Note.CreatedByName;
PlaytimeLabel.Text = $"{Note.PlaytimeAtNote.TotalHours: 0.0}h";

Expand Down Expand Up @@ -139,7 +139,12 @@ private string FormatBanMessage()

private string FormatRoleBanMessage()
{
var banMessage = new StringBuilder($"{Loc.GetString("admin-notes-banned-from")} {string.Join(", ", Note.BannedRoles ?? new []{"unknown"})} ");
var rolesText = string.Join(
", ",
// Explicit cast here to avoid sandbox violation.
(IEnumerable<BanRoleDef>?)Note.BannedRoles ?? [new BanRoleDef("what", "unknown")]);

var banMessage = new StringBuilder($"{Loc.GetString("admin-notes-banned-from")} {rolesText} ");
return FormatBanMessageCommon(banMessage);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public AdminNotesLinePopup(SharedAdminNote note, string playerName, bool showDel
IdLabel.Text = Loc.GetString("admin-notes-id", ("id", note.Id));
TypeLabel.Text = Loc.GetString("admin-notes-type", ("type", note.NoteType));
SeverityLabel.Text = Loc.GetString("admin-notes-severity", ("severity", note.NoteSeverity ?? NoteSeverity.None));
RoundIdLabel.Text = note.Round == null
RoundIdLabel.Text = note.Rounds.Length == 0
? Loc.GetString("admin-notes-round-id-unknown")
: Loc.GetString("admin-notes-round-id", ("id", note.Round));
: Loc.GetString("admin-notes-round-id", ("id", string.Join(',', note.Rounds)));
CreatedByLabel.Text = Loc.GetString("admin-notes-created-by", ("author", note.CreatedByName));
CreatedAtLabel.Text = Loc.GetString("admin-notes-created-at", ("date", note.CreatedAt.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")));
EditedByLabel.Text = Loc.GetString("admin-notes-last-edited-by", ("author", note.EditedByName));
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Cargo/UI/BountyEntry.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Serilog;

namespace Content.Client.Cargo.UI;

Expand Down
20 changes: 9 additions & 11 deletions Content.Client/Content.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Work around https://github.com/dotnet/project-system/issues/4314 -->
<TargetFramework>$(TargetFramework)</TargetFramework>
<LangVersion>12</LangVersion>
<IsPackable>false</IsPackable>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>..\bin\Content.Client\</OutputPath>
<OutputType Condition="'$(FullRelease)' != 'True'">Exe</OutputType>
<WarningsAsErrors>RA0032;nullable</WarningsAsErrors>
<Nullable>enable</Nullable>
<Configurations>Debug;Release;Tools;DebugOpt</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<Import Project="../MSBuild/Content.props" />
<ItemGroup>
<PackageReference Include="Nett" />
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All" />
<PackageReference Include="SixLabors.ImageSharp" />
<PackageReference Include="Pidgin" />
<PackageReference Include="Robust.Shared.AuthLib" />
</ItemGroup>

<Import Project="..\RobustToolbox\Imports\Lidgren.props" />
<Import Project="..\RobustToolbox\Imports\Client.props" />
<Import Project="..\RobustToolbox\Imports\Shared.props" />

<ItemGroup>
<ProjectReference Include="..\RobustToolbox\Lidgren.Network\Lidgren.Network.csproj" />
<ProjectReference Include="..\RobustToolbox\Robust.Shared.Maths\Robust.Shared.Maths.csproj" />
<ProjectReference Include="..\RobustToolbox\Robust.Shared\Robust.Shared.csproj" />
<ProjectReference Include="..\RobustToolbox\Robust.Client\Robust.Client.csproj" />
<ProjectReference Include="..\Content.Shared\Content.Shared.csproj" />
</ItemGroup>
<Import Project="..\RobustToolbox\MSBuild\Robust.Properties.targets" />
Expand Down
11 changes: 7 additions & 4 deletions Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,21 @@ public sealed class EntryPoint : GameClient
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
[Dependency] private readonly ClientsidePlaytimeTrackingManager _clientsidePlaytimeManager = default!;

public override void Init()
public override void PreInit()
{
ClientContentIoC.Register();
ClientContentIoC.Register(Dependencies);

foreach (var callback in TestingCallbacks)
{
var cast = (ClientModuleTestingCallbacks) callback;
cast.ClientBeforeIoC?.Invoke();
}
}

IoCManager.BuildGraph();
IoCManager.InjectDependencies(this);
public override void Init()
{
Dependencies.BuildGraph();
Dependencies.InjectDependencies(this);

_contentLoc.Initialize();
_componentFactory.DoAutoRegistrations();
Expand Down
6 changes: 3 additions & 3 deletions Content.Client/IoC/ClientContentIoC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
using Content.Client.Players.RateLimiting;
using Content.Shared.Administration.Managers;
using Content.Shared.Chat;
using Content.Shared.IoC;
using Content.Shared.Players.PlayTimeTracking;
using Content.Shared.Players.RateLimiting;

namespace Content.Client.IoC
{
internal static class ClientContentIoC
{
public static void Register()
public static void Register(IDependencyCollection collection)
{
var collection = IoCManager.Instance!;

SharedContentIoC.Register(collection);
collection.Register<IParallaxManager, ParallaxManager>();
collection.Register<GeneratedParallaxCache>();
collection.Register<IChatManager, ChatManager>();
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Numerics;
using Content.Client.UserInterface.Controls;
using Prometheus;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
Expand Down
Loading
Loading