Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #173 from Corvax-Frontier/sh1ntra-backup-MayUpstream
Browse files Browse the repository at this point in the history
Апстрим, аминь
  • Loading branch information
Vonsant authored May 15, 2024
2 parents 37382ee + 3641ad4 commit 5690462
Show file tree
Hide file tree
Showing 2,616 changed files with 259,558 additions and 49,652 deletions.
3 changes: 1 addition & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ indent_style = space
tab_width = 4

# New line preferences
end_of_line = crlf:suggestion
#end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true

Expand Down Expand Up @@ -104,7 +104,6 @@ csharp_preferred_modifier_order = public, private, protected, internal, new, abs

# 'using' directive preferences
csharp_using_directive_placement = outside_namespace:silent
csharp_style_namespace_declarations = file_scoped:suggestion

#### C# Formatting Rules ####

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/[email protected]
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.204

- 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/[email protected]
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.204

- name: Install dependencies
run: dotnet restore
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/conflict-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: Check Merge Conflicts

on:
push:
branches:
- master
pull_request_target:
types:
- opened
- synchronize
- reopened
- ready_for_review

jobs:
Label:
if: github.actor != 'PJBot'
if: ( github.event.pull_request.draft == false ) && ( github.actor != 'PJBot' )
runs-on: ubuntu-latest
steps:
- name: Check for Merge Conflicts
uses: ike709/actions-label-merge-conflict@9eefdd17e10566023c46d2dc6dc04fcb8ec76142
uses: eps1lon/actions-label-merge-conflict@v3.0.0
with:
dirtyLabel: "Merge Conflict"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.204

- 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/[email protected]
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.204

- 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/[email protected]
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.204
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "RobustToolbox"]
path = RobustToolbox
url = https://github.com/DeltaV-Station/RobustToolbox.git
url = https://github.com/space-wizards/RobustToolbox.git
branch = master
[submodule "Secrets"]
path = Secrets
url = [email protected]:corvax-project/secrets.git
branch = master
update = none
update = none
4 changes: 2 additions & 2 deletions Content.Benchmarks/MapLoadBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -46,7 +46,7 @@ public async Task Cleanup()
PoolManager.Shutdown();
}

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" };
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", "Oasis" };

[ParamsSource(nameof(MapsSource))]
public string Map;
Expand Down
2 changes: 1 addition & 1 deletion Content.Benchmarks/SpawnEquipDeleteBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ await _pair.Server.WaitPost(() =>
for (var i = 0; i < N; i++)
{
_entity = server.EntMan.SpawnAttachedTo(Mob, _coords);
_spawnSys.EquipStartingGear(_entity, _gear, null);
_spawnSys.EquipStartingGear(_entity, _gear);
server.EntMan.DeleteEntity(_entity);
}
});
Expand Down
4 changes: 1 addition & 3 deletions Content.Client/Access/IdCardSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Content.Client.Access;

public sealed class IdCardSystem : SharedIdCardSystem
{
}
public sealed class IdCardSystem : SharedIdCardSystem;
6 changes: 3 additions & 3 deletions Content.Client/Access/UI/AgentIDCardBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ private void OnJobChanged(string newJob)
SendMessage(new AgentIDCardJobChangedMessage(newJob));
}

public void OnJobIconChanged(string newJobIcon)
public void OnJobIconChanged(string newJobIconId)
{
SendMessage(new AgentIDCardJobIconChangedMessage(newJobIcon));
SendMessage(new AgentIDCardJobIconChangedMessage(newJobIconId));
}

/// <summary>
Expand All @@ -57,7 +57,7 @@ protected override void UpdateState(BoundUserInterfaceState state)

_window.SetCurrentName(cast.CurrentName);
_window.SetCurrentJob(cast.CurrentJob);
_window.SetAllowedIcons(cast.Icons);
_window.SetAllowedIcons(cast.Icons, cast.CurrentJobIconId);
}

protected override void Dispose(bool disposing)
Expand Down
6 changes: 5 additions & 1 deletion Content.Client/Access/UI/AgentIDCardWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public AgentIDCardWindow(AgentIDCardBoundUserInterface bui)
JobLineEdit.OnFocusExit += e => OnJobChanged?.Invoke(e.Text);
}

public void SetAllowedIcons(HashSet<string> icons)
public void SetAllowedIcons(HashSet<string> icons, string currentJobIconId)
{
IconGrid.DisposeAllChildren();

Expand Down Expand Up @@ -79,6 +79,10 @@ public void SetAllowedIcons(HashSet<string> icons)
jobIconButton.AddChild(jobIconTexture);
jobIconButton.OnPressed += _ => _bui.OnJobIconChanged(jobIcon.ID);
IconGrid.AddChild(jobIconButton);

if (jobIconId.Equals(currentJobIconId))
jobIconButton.Pressed = true;

i++;
}
}
Expand Down
5 changes: 5 additions & 0 deletions Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeMana

foreach (var job in jobs)
{
if (job.HideConsoleVisibility) // Frontier
{
continue;
}

if (!job.OverrideConsoleVisibility.GetValueOrDefault(job.SetPreference))
{
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Content.Client.Administration.Components;

[RegisterComponent, NetworkedComponent]
[RegisterComponent]
public sealed partial class HeadstandComponent : SharedHeadstandComponent
{

Expand Down
5 changes: 2 additions & 3 deletions Content.Client/Administration/Components/KillSignComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@

namespace Content.Client.Administration.Components;

[NetworkedComponent, RegisterComponent]
public sealed partial class KillSignComponent : SharedKillSignComponent
{ }
[RegisterComponent]
public sealed partial class KillSignComponent : SharedKillSignComponent;
7 changes: 5 additions & 2 deletions Content.Client/Administration/Managers/ClientAdminManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,15 @@ void IPostInjectInit.PostInject()

public AdminData? GetAdminData(EntityUid uid, bool includeDeAdmin = false)
{
return uid == _player.LocalEntity ? _adminData : null;
if (uid == _player.LocalEntity && (_adminData?.Active ?? includeDeAdmin))
return _adminData;

return null;
}

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

return null;
Expand Down
23 changes: 23 additions & 0 deletions Content.Client/Administration/Systems/AdminVerbSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using Content.Shared.Administration;
using Content.Shared.Administration.Managers;
using Content.Shared.Mind.Components;
using Content.Shared.Verbs;
using Robust.Client.Console;
using Robust.Shared.Utility;
Expand All @@ -11,10 +14,12 @@ sealed class AdminVerbSystem : EntitySystem
{
[Dependency] private readonly IClientConGroupController _clientConGroupController = default!;
[Dependency] private readonly IClientConsoleHost _clientConsoleHost = default!;
[Dependency] private readonly ISharedAdminManager _admin = default!;

public override void Initialize()
{
SubscribeLocalEvent<GetVerbsEvent<Verb>>(AddAdminVerbs);

}

private void AddAdminVerbs(GetVerbsEvent<Verb> args)
Expand All @@ -33,6 +38,24 @@ private void AddAdminVerbs(GetVerbsEvent<Verb> args)
};
args.Verbs.Add(verb);
}

if (!_admin.IsAdmin(args.User))
return;

if (_admin.HasAdminFlag(args.User, AdminFlags.Admin))
args.ExtraCategories.Add(VerbCategory.Admin);

if (_admin.HasAdminFlag(args.User, AdminFlags.Fun) && HasComp<MindContainerComponent>(args.Target))
args.ExtraCategories.Add(VerbCategory.Antag);

if (_admin.HasAdminFlag(args.User, AdminFlags.Debug))
args.ExtraCategories.Add(VerbCategory.Debug);

if (_admin.HasAdminFlag(args.User, AdminFlags.Fun))
args.ExtraCategories.Add(VerbCategory.Smite);

if (_admin.HasAdminFlag(args.User, AdminFlags.Admin))
args.ExtraCategories.Add(VerbCategory.Tricks);
}
}
}
73 changes: 73 additions & 0 deletions Content.Client/Administration/UI/BanPanel/BanPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Net.Sockets;
using Content.Client.Administration.UI.CustomControls;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Content.Shared.Database;
using Content.Shared.Roles;
using Robust.Client.AutoGenerated;
Expand All @@ -11,6 +12,7 @@
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
Expand All @@ -32,8 +34,11 @@ public sealed partial class BanPanel : DefaultWindow
// This is less efficient than just holding a reference to the root control and enumerating children, but you
// have to know how the controls are nested, which makes the code more complicated.
private readonly List<CheckBox> _roleCheckboxes = new();
private readonly ISawmill _banpanelSawmill;

[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly ILogManager _logManager = default!;

private enum TabNumbers
{
Expand Down Expand Up @@ -65,6 +70,7 @@ public BanPanel()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_banpanelSawmill = _logManager.GetSawmill("admin.banpanel");
PlayerList.OnSelectionChanged += OnPlayerSelectionChanged;
PlayerNameLine.OnFocusExit += _ => OnPlayerNameChanged();
PlayerCheckbox.OnPressed += _ =>
Expand Down Expand Up @@ -104,6 +110,11 @@ public BanPanel()
};
SubmitButton.OnPressed += SubmitButtonOnOnPressed;

IpCheckbox.Pressed = _cfg.GetCVar(CCVars.ServerBanIpBanDefault);
HwidCheckbox.Pressed = _cfg.GetCVar(CCVars.ServerBanHwidBanDefault);
LastConnCheckbox.Pressed = _cfg.GetCVar(CCVars.ServerBanUseLastDetails);
EraseCheckbox.Pressed = _cfg.GetCVar(CCVars.ServerBanErasePlayer);

SeverityOption.AddItem(Loc.GetString("admin-note-editor-severity-none"), (int) NoteSeverity.None);
SeverityOption.AddItem(Loc.GetString("admin-note-editor-severity-low"), (int) NoteSeverity.Minor);
SeverityOption.AddItem(Loc.GetString("admin-note-editor-severity-medium"), (int) NoteSeverity.Medium);
Expand Down Expand Up @@ -175,6 +186,39 @@ private void CreateRoleGroup(string roleName, IEnumerable<string> roleList, Colo
c.Pressed = args.Pressed;
}
}

if (args.Pressed)
{
if (!Enum.TryParse(_cfg.GetCVar(CCVars.DepartmentBanDefaultSeverity), true, out NoteSeverity newSeverity))
{
_banpanelSawmill
.Warning("Departmental role ban severity could not be parsed from config!");
return;
}
SeverityOption.SelectId((int) newSeverity);
}
else
{
foreach (var childContainer in RolesContainer.Children)
{
if (childContainer is Container)
{
foreach (var child in childContainer.Children)
{
if (child is CheckBox { Pressed: true })
return;
}
}
}

if (!Enum.TryParse(_cfg.GetCVar(CCVars.RoleBanDefaultSeverity), true, out NoteSeverity newSeverity))
{
_banpanelSawmill
.Warning("Role ban severity could not be parsed from config!");
return;
}
SeverityOption.SelectId((int) newSeverity);
}
};
outerContainer.AddChild(innerContainer);
foreach (var role in roleList)
Expand Down Expand Up @@ -353,6 +397,35 @@ private void OnTypeChanged()
{
TypeOption.ModulateSelfOverride = null;
Tabs.SetTabVisible((int) TabNumbers.Roles, TypeOption.SelectedId == (int) Types.Role);
NoteSeverity? newSeverity = null;
switch (TypeOption.SelectedId)
{
case (int)Types.Server:
if (Enum.TryParse(_cfg.GetCVar(CCVars.ServerBanDefaultSeverity), true, out NoteSeverity serverSeverity))
newSeverity = serverSeverity;
else
{
_banpanelSawmill
.Warning("Server ban severity could not be parsed from config!");
}

break;
case (int) Types.Role:

if (Enum.TryParse(_cfg.GetCVar(CCVars.RoleBanDefaultSeverity), true, out NoteSeverity roleSeverity))
{
newSeverity = roleSeverity;
}
else
{
_banpanelSawmill
.Warning("Role ban severity could not be parsed from config!");
}
break;
}

if (newSeverity != null)
SeverityOption.SelectId((int) newSeverity.Value);
}

private void UpdateSubmitEnabled()
Expand Down
Loading

0 comments on commit 5690462

Please sign in to comment.