diff --git a/.github/workflows/conflict-labeler.yml b/.github/workflows/labeler-conflict.yml
similarity index 100%
rename from .github/workflows/conflict-labeler.yml
rename to .github/workflows/labeler-conflict.yml
diff --git a/.github/workflows/labeler-size.yml b/.github/workflows/labeler-size.yml
new file mode 100644
index 00000000000..418faed79b8
--- /dev/null
+++ b/.github/workflows/labeler-size.yml
@@ -0,0 +1,21 @@
+name: "Labels: Size"
+on: pull_request_target
+jobs:
+ size-label:
+ runs-on: ubuntu-latest
+ steps:
+ - name: size-label
+ uses: "pascalgn/size-label-action@v0.5.5"
+ env:
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
+ with:
+ # Custom size configuration
+ # DeltaV: changed to powers of 4
+ sizes: >
+ {
+ "0": "XS",
+ "16": "S",
+ "64": "M",
+ "256": "L",
+ "1024": "XL"
+ }
diff --git a/.github/workflows/labeler-untriaged.yml b/.github/workflows/labeler-untriaged.yml
index 22554d05650..ec1d194851c 100644
--- a/.github/workflows/labeler-untriaged.yml
+++ b/.github/workflows/labeler-untriaged.yml
@@ -3,6 +3,8 @@
on:
issues:
types: [opened]
+ pull_request_target:
+ types: [opened]
jobs:
add_label:
diff --git a/Content.Client/Administration/UI/Notes/NoteEdit.xaml b/Content.Client/Administration/UI/Notes/NoteEdit.xaml
index 506abac540c..72b2c55ce8d 100644
--- a/Content.Client/Administration/UI/Notes/NoteEdit.xaml
+++ b/Content.Client/Administration/UI/Notes/NoteEdit.xaml
@@ -8,6 +8,7 @@
+
diff --git a/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs b/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs
index 6f314f79542..a412e47396b 100644
--- a/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs
+++ b/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs
@@ -17,6 +17,17 @@ public sealed partial class NoteEdit : FancyWindow
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IClientConsoleHost _console = default!;
+ private enum Multipliers
+ {
+ Minutes,
+ Hours,
+ Days,
+ Weeks,
+ Months,
+ Years,
+ Centuries
+ }
+
public event Action? SubmitPressed;
public NoteEdit(SharedAdminNote? note, string playerName, bool canCreate, bool canEdit)
@@ -31,6 +42,20 @@ public NoteEdit(SharedAdminNote? note, string playerName, bool canCreate, bool c
ResetSubmitButton();
+ // It's weird to use minutes as the IDs, but it works and makes sense kind of :)
+ ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-minutes"), (int) Multipliers.Minutes);
+ ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-hours"), (int) Multipliers.Hours);
+ ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-days"), (int) Multipliers.Days);
+ ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-weeks"), (int) Multipliers.Weeks);
+ ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-months"), (int) Multipliers.Months);
+ ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-years"), (int) Multipliers.Years);
+ ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-centuries"), (int) Multipliers.Centuries);
+ ExpiryLengthDropdown.OnItemSelected += OnLengthChanged;
+
+ ExpiryLengthDropdown.SelectId((int) Multipliers.Weeks);
+
+ ExpiryLineEdit.OnTextChanged += OnTextChanged;
+
TypeOption.AddItem(Loc.GetString("admin-note-editor-type-note"), (int) NoteType.Note);
TypeOption.AddItem(Loc.GetString("admin-note-editor-type-message"), (int) NoteType.Message);
TypeOption.AddItem(Loc.GetString("admin-note-editor-type-watchlist"), (int) NoteType.Watchlist);
@@ -172,8 +197,9 @@ private void UpdatePermanentCheckboxFields()
{
ExpiryLabel.Visible = !PermanentCheckBox.Pressed;
ExpiryLineEdit.Visible = !PermanentCheckBox.Pressed;
+ ExpiryLengthDropdown.Visible = !PermanentCheckBox.Pressed;
- ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty;
+ ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? 1.ToString() : string.Empty;
}
private void OnSecretPressed(BaseButton.ButtonEventArgs _)
@@ -187,6 +213,16 @@ private void OnSeverityChanged(OptionButton.ItemSelectedEventArgs args)
SeverityOption.SelectId(args.Id);
}
+ private void OnLengthChanged(OptionButton.ItemSelectedEventArgs args)
+ {
+ ExpiryLengthDropdown.SelectId(args.Id);
+ }
+
+ private void OnTextChanged(HistoryLineEdit.LineEditEventArgs args)
+ {
+ ParseExpiryTime();
+ }
+
private void OnSubmitButtonPressed(BaseButton.ButtonEventArgs args)
{
if (!ParseExpiryTime())
@@ -263,13 +299,24 @@ private bool ParseExpiryTime()
return true;
}
- if (string.IsNullOrWhiteSpace(ExpiryLineEdit.Text) || !DateTime.TryParse(ExpiryLineEdit.Text, out var result) || DateTime.UtcNow > result)
+ if (string.IsNullOrWhiteSpace(ExpiryLineEdit.Text) || !uint.TryParse(ExpiryLineEdit.Text, out var inputInt))
{
ExpiryLineEdit.ModulateSelfOverride = Color.Red;
return false;
}
- ExpiryTime = result.ToUniversalTime();
+ var mult = ExpiryLengthDropdown.SelectedId switch
+ {
+ (int) Multipliers.Minutes => TimeSpan.FromMinutes(1).TotalMinutes,
+ (int) Multipliers.Hours => TimeSpan.FromHours(1).TotalMinutes,
+ (int) Multipliers.Days => TimeSpan.FromDays(1).TotalMinutes,
+ (int) Multipliers.Weeks => TimeSpan.FromDays(7).TotalMinutes,
+ (int) Multipliers.Months => TimeSpan.FromDays(30).TotalMinutes,
+ (int) Multipliers.Years => TimeSpan.FromDays(365).TotalMinutes,
+ (int) Multipliers.Centuries => TimeSpan.FromDays(36525).TotalMinutes,
+ _ => throw new ArgumentOutOfRangeException(nameof(ExpiryLengthDropdown.SelectedId), "Multiplier out of range :(")
+ };
+ ExpiryTime = DateTime.UtcNow.AddMinutes(inputInt * mult);
ExpiryLineEdit.ModulateSelfOverride = null;
return true;
}
diff --git a/Content.Client/Alerts/ClientAlertsSystem.cs b/Content.Client/Alerts/ClientAlertsSystem.cs
index 525ef1f018f..c5ec254c0cc 100644
--- a/Content.Client/Alerts/ClientAlertsSystem.cs
+++ b/Content.Client/Alerts/ClientAlertsSystem.cs
@@ -2,6 +2,7 @@
using Content.Shared.Alert;
using JetBrains.Annotations;
using Robust.Client.Player;
+using Robust.Shared.GameStates;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
@@ -24,8 +25,7 @@ public override void Initialize()
SubscribeLocalEvent(OnPlayerAttached);
SubscribeLocalEvent(OnPlayerDetached);
-
- SubscribeLocalEvent(ClientAlertsHandleState);
+ SubscribeLocalEvent(OnHandleState);
}
protected override void LoadPrototypes()
{
@@ -47,17 +47,22 @@ public IReadOnlyDictionary? ActiveAlerts
}
}
- protected override void AfterShowAlert(Entity alerts)
+ private void OnHandleState(Entity alerts, ref ComponentHandleState args)
{
+ if (args.Current is not AlertComponentState cast)
+ return;
+
+ alerts.Comp.Alerts = cast.Alerts;
+
UpdateHud(alerts);
}
- protected override void AfterClearAlert(Entity alerts)
+ protected override void AfterShowAlert(Entity alerts)
{
UpdateHud(alerts);
}
- private void ClientAlertsHandleState(Entity alerts, ref AfterAutoHandleStateEvent args)
+ protected override void AfterClearAlert(Entity alerts)
{
UpdateHud(alerts);
}
diff --git a/Content.Client/Clothing/ClientClothingSystem.cs b/Content.Client/Clothing/ClientClothingSystem.cs
index 3462fc92360..46f879e8156 100644
--- a/Content.Client/Clothing/ClientClothingSystem.cs
+++ b/Content.Client/Clothing/ClientClothingSystem.cs
@@ -58,6 +58,7 @@ public override void Initialize()
base.Initialize();
SubscribeLocalEvent(OnGetVisuals);
+ SubscribeLocalEvent(OnInventoryTemplateUpdated);
SubscribeLocalEvent(OnVisualsChanged);
SubscribeLocalEvent(OnDidUnequip);
@@ -70,11 +71,7 @@ private void OnAppearanceUpdate(EntityUid uid, InventoryComponent component, ref
if (args.Sprite == null)
return;
- var enumerator = _inventorySystem.GetSlotEnumerator((uid, component));
- while (enumerator.NextItem(out var item, out var slot))
- {
- RenderEquipment(uid, item, slot.Name, component);
- }
+ UpdateAllSlots(uid, component);
// No clothing equipped -> make sure the layer is hidden, though this should already be handled by on-unequip.
if (args.Sprite.LayerMapTryGet(HumanoidVisualLayers.StencilMask, out var layer))
@@ -84,6 +81,23 @@ private void OnAppearanceUpdate(EntityUid uid, InventoryComponent component, ref
}
}
+ private void OnInventoryTemplateUpdated(Entity ent, ref InventoryTemplateUpdated args)
+ {
+ UpdateAllSlots(ent.Owner, clothing: ent.Comp);
+ }
+
+ private void UpdateAllSlots(
+ EntityUid uid,
+ InventoryComponent? inventoryComponent = null,
+ ClothingComponent? clothing = null)
+ {
+ var enumerator = _inventorySystem.GetSlotEnumerator((uid, inventoryComponent));
+ while (enumerator.NextItem(out var item, out var slot))
+ {
+ RenderEquipment(uid, item, slot.Name, inventoryComponent, clothingComponent: clothing);
+ }
+ }
+
private void OnGetVisuals(EntityUid uid, ClothingComponent item, GetEquipmentVisualsEvent args)
{
if (!TryComp(args.Equipee, out InventoryComponent? inventory))
diff --git a/Content.Client/Commands/ShowHealthBarsCommand.cs b/Content.Client/Commands/ShowHealthBarsCommand.cs
index 0811f966637..6ea9d06c8c3 100644
--- a/Content.Client/Commands/ShowHealthBarsCommand.cs
+++ b/Content.Client/Commands/ShowHealthBarsCommand.cs
@@ -1,6 +1,8 @@
+using Content.Shared.Damage.Prototypes;
using Content.Shared.Overlays;
using Robust.Client.Player;
using Robust.Shared.Console;
+using Robust.Shared.Prototypes;
using System.Linq;
namespace Content.Client.Commands;
@@ -34,7 +36,7 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var showHealthBarsComponent = new ShowHealthBarsComponent
{
- DamageContainers = args.ToList(),
+ DamageContainers = args.Select(arg => new ProtoId(arg)).ToList(),
HealthStatusIcon = null,
NetSyncEnabled = false
};
diff --git a/Content.Client/Effects/ColorFlashEffectSystem.cs b/Content.Client/Effects/ColorFlashEffectSystem.cs
index 956c9465244..b584aa9ad1b 100644
--- a/Content.Client/Effects/ColorFlashEffectSystem.cs
+++ b/Content.Client/Effects/ColorFlashEffectSystem.cs
@@ -124,6 +124,10 @@ private void OnColorFlashEffect(ColorFlashEffectEvent ev)
continue;
}
+ var targetEv = new GetFlashEffectTargetEvent(ent);
+ RaiseLocalEvent(ent, ref targetEv);
+ ent = targetEv.Target;
+
EnsureComp(ent, out comp);
comp.NetSyncEnabled = false;
comp.Color = sprite.Color;
@@ -132,3 +136,9 @@ private void OnColorFlashEffect(ColorFlashEffectEvent ev)
}
}
}
+
+///
+/// Raised on an entity to change the target for a color flash effect.
+///
+[ByRefEvent]
+public record struct GetFlashEffectTargetEvent(EntityUid Target);
diff --git a/Content.Client/Inventory/ClientInventorySystem.cs b/Content.Client/Inventory/ClientInventorySystem.cs
index 87cea4e3d2f..dce401eefda 100644
--- a/Content.Client/Inventory/ClientInventorySystem.cs
+++ b/Content.Client/Inventory/ClientInventorySystem.cs
@@ -235,9 +235,23 @@ public void UIInventoryAltActivateItem(string slot, EntityUid uid)
EntityManager.RaisePredictiveEvent(new InteractInventorySlotEvent(GetNetEntity(item.Value), altInteract: true));
}
+ protected override void UpdateInventoryTemplate(Entity ent)
+ {
+ base.UpdateInventoryTemplate(ent);
+
+ if (TryComp(ent, out InventorySlotsComponent? inventorySlots))
+ {
+ foreach (var slot in ent.Comp.Slots)
+ {
+ if (inventorySlots.SlotData.TryGetValue(slot.Name, out var slotData))
+ slotData.SlotDef = slot;
+ }
+ }
+ }
+
public sealed class SlotData
{
- public readonly SlotDefinition SlotDef;
+ public SlotDefinition SlotDef;
public EntityUid? HeldEntity => Container?.ContainedEntity;
public bool Blocked;
public bool Highlighted;
diff --git a/Content.Client/Overlays/EquipmentHudSystem.cs b/Content.Client/Overlays/EquipmentHudSystem.cs
index c7578b6793f..502a1f36274 100644
--- a/Content.Client/Overlays/EquipmentHudSystem.cs
+++ b/Content.Client/Overlays/EquipmentHudSystem.cs
@@ -14,6 +14,7 @@ public abstract class EquipmentHudSystem : EntitySystem where T : IComponent
{
[Dependency] private readonly IPlayerManager _player = default!;
+ [ViewVariables]
protected bool IsActive;
protected virtual SlotFlags TargetSlots => ~SlotFlags.POCKET;
@@ -102,7 +103,7 @@ protected virtual void OnRefreshComponentHud(EntityUid uid, T component, Refresh
args.Components.Add(component);
}
- private void RefreshOverlay(EntityUid uid)
+ protected void RefreshOverlay(EntityUid uid)
{
if (uid != _player.LocalSession?.AttachedEntity)
return;
diff --git a/Content.Client/Overlays/ShowHealthBarsSystem.cs b/Content.Client/Overlays/ShowHealthBarsSystem.cs
index 1eb712a8988..b23209ff202 100644
--- a/Content.Client/Overlays/ShowHealthBarsSystem.cs
+++ b/Content.Client/Overlays/ShowHealthBarsSystem.cs
@@ -21,9 +21,16 @@ public override void Initialize()
{
base.Initialize();
+ SubscribeLocalEvent(OnHandleState);
+
_overlay = new(EntityManager, _prototype);
}
+ private void OnHandleState(Entity ent, ref AfterAutoHandleStateEvent args)
+ {
+ RefreshOverlay(ent);
+ }
+
protected override void UpdateInternal(RefreshEquipmentHudEvent component)
{
base.UpdateInternal(component);
diff --git a/Content.Client/Overlays/ShowHealthIconsSystem.cs b/Content.Client/Overlays/ShowHealthIconsSystem.cs
index 8c22c78f17c..b4d845e4217 100644
--- a/Content.Client/Overlays/ShowHealthIconsSystem.cs
+++ b/Content.Client/Overlays/ShowHealthIconsSystem.cs
@@ -17,6 +17,7 @@ public sealed class ShowHealthIconsSystem : EquipmentHudSystem DamageContainers = new();
public override void Initialize()
@@ -24,6 +25,7 @@ public override void Initialize()
base.Initialize();
SubscribeLocalEvent(OnGetStatusIconsEvent);
+ SubscribeLocalEvent(OnHandleState);
}
protected override void UpdateInternal(RefreshEquipmentHudEvent component)
@@ -43,6 +45,11 @@ protected override void DeactivateInternal()
DamageContainers.Clear();
}
+ private void OnHandleState(Entity ent, ref AfterAutoHandleStateEvent args)
+ {
+ RefreshOverlay(ent);
+ }
+
private void OnGetStatusIconsEvent(Entity entity, ref GetStatusIconsEvent args)
{
if (!IsActive)
diff --git a/Content.Client/Overlays/ShowThirstIconsSystem.cs b/Content.Client/Overlays/ShowThirstIconsSystem.cs
index 44be1f7a67f..9fc64165c56 100644
--- a/Content.Client/Overlays/ShowThirstIconsSystem.cs
+++ b/Content.Client/Overlays/ShowThirstIconsSystem.cs
@@ -22,6 +22,6 @@ private void OnGetStatusIconsEvent(EntityUid uid, ThirstComponent component, ref
return;
if (_thirst.TryGetStatusIconPrototype(component, out var iconPrototype))
- ev.StatusIcons.Add(iconPrototype!);
+ ev.StatusIcons.Add(iconPrototype);
}
}
diff --git a/Content.Client/Physics/Controllers/MoverController.cs b/Content.Client/Physics/Controllers/MoverController.cs
index c97110b208e..d2ac0cdefdc 100644
--- a/Content.Client/Physics/Controllers/MoverController.cs
+++ b/Content.Client/Physics/Controllers/MoverController.cs
@@ -1,9 +1,12 @@
+using Content.Shared.Alert;
+using Content.Shared.CCVar;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Movement.Systems;
using Robust.Client.GameObjects;
using Robust.Client.Physics;
using Robust.Client.Player;
+using Robust.Shared.Configuration;
using Robust.Shared.Physics.Components;
using Robust.Shared.Player;
using Robust.Shared.Timing;
@@ -14,6 +17,8 @@ public sealed class MoverController : SharedMoverController
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
+ [Dependency] private readonly AlertsSystem _alerts = default!;
+ [Dependency] private readonly IConfigurationManager _cfg = default!;
public override void Initialize()
{
@@ -135,4 +140,15 @@ protected override bool CanSound()
{
return _timing is { IsFirstTimePredicted: true, InSimulation: true };
}
+
+ public override void SetSprinting(Entity entity, ushort subTick, bool walking)
+ {
+ // Logger.Info($"[{_gameTiming.CurTick}/{subTick}] Sprint: {enabled}");
+ base.SetSprinting(entity, subTick, walking);
+
+ if (walking && _cfg.GetCVar(CCVars.ToggleWalk))
+ _alerts.ShowAlert(entity, WalkingAlert, showCooldown: false, autoRemove: false);
+ else
+ _alerts.ClearAlert(entity, WalkingAlert);
+ }
}
diff --git a/Content.Client/Polymorph/Systems/ChameleonProjectorSystem.cs b/Content.Client/Polymorph/Systems/ChameleonProjectorSystem.cs
index 4acbf540f06..8ba09c66170 100644
--- a/Content.Client/Polymorph/Systems/ChameleonProjectorSystem.cs
+++ b/Content.Client/Polymorph/Systems/ChameleonProjectorSystem.cs
@@ -1,8 +1,10 @@
+using Content.Client.Effects;
using Content.Client.Smoking;
using Content.Shared.Chemistry.Components;
using Content.Shared.Polymorph.Components;
using Content.Shared.Polymorph.Systems;
using Robust.Client.GameObjects;
+using Robust.Shared.Player;
namespace Content.Client.Polymorph.Systems;
@@ -24,6 +26,7 @@ public override void Initialize()
SubscribeLocalEvent(OnStartup);
SubscribeLocalEvent(OnShutdown);
+ SubscribeLocalEvent(OnGetFlashEffectTargetEvent);
}
private void OnHandleState(Entity ent, ref AfterAutoHandleStateEvent args)
@@ -52,4 +55,9 @@ private void OnShutdown(Entity ent, ref ComponentSh
if (_spriteQuery.TryComp(ent, out var sprite))
sprite.Visible = ent.Comp.WasVisible;
}
+
+ private void OnGetFlashEffectTargetEvent(Entity ent, ref GetFlashEffectTargetEvent args)
+ {
+ args.Target = ent.Comp.Disguise;
+ }
}
diff --git a/Content.Client/Silicons/Borgs/BorgMenu.xaml.cs b/Content.Client/Silicons/Borgs/BorgMenu.xaml.cs
index f6a861aa057..b8f0e69c022 100644
--- a/Content.Client/Silicons/Borgs/BorgMenu.xaml.cs
+++ b/Content.Client/Silicons/Borgs/BorgMenu.xaml.cs
@@ -131,7 +131,8 @@ private void UpdateModulePanel()
_modules.Clear();
foreach (var module in chassis.ModuleContainer.ContainedEntities)
{
- var control = new BorgModuleControl(module, _entity);
+ var moduleComponent = _entity.GetComponent(module);
+ var control = new BorgModuleControl(module, _entity, !moduleComponent.DefaultModule);
control.RemoveButtonPressed += () =>
{
RemoveModuleButtonPressed?.Invoke(module);
diff --git a/Content.Client/Silicons/Borgs/BorgModuleControl.xaml.cs b/Content.Client/Silicons/Borgs/BorgModuleControl.xaml.cs
index d5cf05ba63e..245425524ca 100644
--- a/Content.Client/Silicons/Borgs/BorgModuleControl.xaml.cs
+++ b/Content.Client/Silicons/Borgs/BorgModuleControl.xaml.cs
@@ -9,7 +9,7 @@ public sealed partial class BorgModuleControl : PanelContainer
{
public Action? RemoveButtonPressed;
- public BorgModuleControl(EntityUid entity, IEntityManager entityManager)
+ public BorgModuleControl(EntityUid entity, IEntityManager entityManager, bool canRemove)
{
RobustXamlLoader.Load(this);
@@ -20,6 +20,7 @@ public BorgModuleControl(EntityUid entity, IEntityManager entityManager)
{
RemoveButtonPressed?.Invoke();
};
+ RemoveButton.Visible = canRemove;
}
}
diff --git a/Content.Client/Silicons/Borgs/BorgSelectTypeMenu.xaml b/Content.Client/Silicons/Borgs/BorgSelectTypeMenu.xaml
new file mode 100644
index 00000000000..f51c2f53fd0
--- /dev/null
+++ b/Content.Client/Silicons/Borgs/BorgSelectTypeMenu.xaml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Content.Client/Silicons/Borgs/BorgSelectTypeMenu.xaml.cs b/Content.Client/Silicons/Borgs/BorgSelectTypeMenu.xaml.cs
new file mode 100644
index 00000000000..e1fbd376b54
--- /dev/null
+++ b/Content.Client/Silicons/Borgs/BorgSelectTypeMenu.xaml.cs
@@ -0,0 +1,81 @@
+using System.Linq;
+using Content.Client.UserInterface.Controls;
+using Content.Client.UserInterface.Systems.Guidebook;
+using Content.Shared.Guidebook;
+using Content.Shared.Silicons.Borgs;
+using Content.Shared.Silicons.Borgs.Components;
+using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface.Controls;
+using Robust.Client.UserInterface.XAML;
+using Robust.Shared.Prototypes;
+
+namespace Content.Client.Silicons.Borgs;
+
+///
+/// Menu used by borgs to select their type.
+///
+///
+///
+[GenerateTypedNameReferences]
+public sealed partial class BorgSelectTypeMenu : FancyWindow
+{
+ [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+
+ private BorgTypePrototype? _selectedBorgType;
+
+ public event Action>? ConfirmedBorgType;
+
+ [ValidatePrototypeId]
+ private static readonly List> GuidebookEntries = new() { "Cyborgs", "Robotics" };
+
+ public BorgSelectTypeMenu()
+ {
+ RobustXamlLoader.Load(this);
+ IoCManager.InjectDependencies(this);
+
+ var group = new ButtonGroup();
+ foreach (var borgType in _prototypeManager.EnumeratePrototypes().OrderBy(PrototypeName))
+ {
+ var button = new Button
+ {
+ Text = PrototypeName(borgType),
+ Group = group,
+ };
+ button.OnPressed += _ =>
+ {
+ _selectedBorgType = borgType;
+ UpdateInformation(borgType);
+ };
+ SelectionsContainer.AddChild(button);
+ }
+
+ ConfirmTypeButton.OnPressed += ConfirmButtonPressed;
+ HelpGuidebookIds = GuidebookEntries;
+ }
+
+ private void UpdateInformation(BorgTypePrototype prototype)
+ {
+ _selectedBorgType = prototype;
+
+ InfoContents.Visible = true;
+ InfoPlaceholder.Visible = false;
+ ConfirmTypeButton.Disabled = false;
+
+ NameLabel.Text = PrototypeName(prototype);
+ DescriptionLabel.Text = Loc.GetString($"borg-type-{prototype.ID}-desc");
+ ChassisView.SetPrototype(prototype.DummyPrototype);
+ }
+
+ private void ConfirmButtonPressed(BaseButton.ButtonEventArgs obj)
+ {
+ if (_selectedBorgType == null)
+ return;
+
+ ConfirmedBorgType?.Invoke(_selectedBorgType);
+ }
+
+ private static string PrototypeName(BorgTypePrototype prototype)
+ {
+ return Loc.GetString($"borg-type-{prototype.ID}-name");
+ }
+}
diff --git a/Content.Client/Silicons/Borgs/BorgSelectTypeUserInterface.cs b/Content.Client/Silicons/Borgs/BorgSelectTypeUserInterface.cs
new file mode 100644
index 00000000000..8c76fade8c9
--- /dev/null
+++ b/Content.Client/Silicons/Borgs/BorgSelectTypeUserInterface.cs
@@ -0,0 +1,30 @@
+using Content.Shared.Silicons.Borgs.Components;
+using JetBrains.Annotations;
+using Robust.Client.UserInterface;
+
+namespace Content.Client.Silicons.Borgs;
+
+///
+/// User interface used by borgs to select their type.
+///
+///
+///
+///
+[UsedImplicitly]
+public sealed class BorgSelectTypeUserInterface : BoundUserInterface
+{
+ [ViewVariables]
+ private BorgSelectTypeMenu? _menu;
+
+ public BorgSelectTypeUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
+ {
+ }
+
+ protected override void Open()
+ {
+ base.Open();
+
+ _menu = this.CreateWindow();
+ _menu.ConfirmedBorgType += prototype => SendMessage(new BorgSelectTypeMessage(prototype));
+ }
+}
diff --git a/Content.Client/Silicons/Borgs/BorgSwitchableTypeSystem.cs b/Content.Client/Silicons/Borgs/BorgSwitchableTypeSystem.cs
new file mode 100644
index 00000000000..d94562e374b
--- /dev/null
+++ b/Content.Client/Silicons/Borgs/BorgSwitchableTypeSystem.cs
@@ -0,0 +1,85 @@
+using Content.Shared.Movement.Components;
+using Content.Shared.Silicons.Borgs;
+using Content.Shared.Silicons.Borgs.Components;
+using Robust.Client.GameObjects;
+
+namespace Content.Client.Silicons.Borgs;
+
+///
+/// Client side logic for borg type switching. Sets up primarily client-side visual information.
+///
+///
+///
+public sealed class BorgSwitchableTypeSystem : SharedBorgSwitchableTypeSystem
+{
+ [Dependency] private readonly BorgSystem _borgSystem = default!;
+ [Dependency] private readonly AppearanceSystem _appearance = default!;
+
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ SubscribeLocalEvent(AfterStateHandler);
+ SubscribeLocalEvent(OnComponentStartup);
+ }
+
+ private void OnComponentStartup(Entity ent, ref ComponentStartup args)
+ {
+ UpdateEntityAppearance(ent);
+ }
+
+ private void AfterStateHandler(Entity ent, ref AfterAutoHandleStateEvent args)
+ {
+ UpdateEntityAppearance(ent);
+ }
+
+ protected override void UpdateEntityAppearance(
+ Entity entity,
+ BorgTypePrototype prototype)
+ {
+ // Begin DeltaV Code
+ if (prototype.ClientComponents is {} add)
+ EntityManager.AddComponents(entity, add);
+ // End DeltaV Code
+ if (TryComp(entity, out SpriteComponent? sprite))
+ {
+ sprite.LayerSetState(BorgVisualLayers.Body, prototype.SpriteBodyState);
+ sprite.LayerSetState(BorgVisualLayers.LightStatus, prototype.SpriteToggleLightState);
+ }
+
+ if (TryComp(entity, out BorgChassisComponent? chassis))
+ {
+ _borgSystem.SetMindStates(
+ (entity.Owner, chassis),
+ prototype.SpriteHasMindState,
+ prototype.SpriteNoMindState);
+
+ if (TryComp(entity, out AppearanceComponent? appearance))
+ {
+ // Queue update so state changes apply.
+ _appearance.QueueUpdate(entity, appearance);
+ }
+ }
+
+ if (prototype.SpriteBodyMovementState is { } movementState)
+ {
+ var spriteMovement = EnsureComp(entity);
+ spriteMovement.NoMovementLayers.Clear();
+ spriteMovement.NoMovementLayers["movement"] = new PrototypeLayerData
+ {
+ State = prototype.SpriteBodyState,
+ };
+ spriteMovement.MovementLayers.Clear();
+ spriteMovement.MovementLayers["movement"] = new PrototypeLayerData
+ {
+ State = movementState,
+ };
+ }
+ else
+ {
+ RemComp(entity);
+ }
+
+ base.UpdateEntityAppearance(entity, prototype);
+ }
+}
diff --git a/Content.Client/Silicons/Borgs/BorgSystem.cs b/Content.Client/Silicons/Borgs/BorgSystem.cs
index e92ce5cc777..387a56384e9 100644
--- a/Content.Client/Silicons/Borgs/BorgSystem.cs
+++ b/Content.Client/Silicons/Borgs/BorgSystem.cs
@@ -92,4 +92,18 @@ private void OnMMIAppearanceChanged(EntityUid uid, MMIComponent component, ref A
sprite.LayerSetState(MMIVisualLayers.Base, state);
}
}
+
+ ///
+ /// Sets the sprite states used for the borg "is there a mind or not" indication.
+ ///
+ /// The entity and component to modify.
+ /// The state to use if the borg has a mind.
+ /// The state to use if the borg has no mind.
+ ///
+ ///
+ public void SetMindStates(Entity borg, string hasMindState, string noMindState)
+ {
+ borg.Comp.HasMindState = hasMindState;
+ borg.Comp.NoMindState = noMindState;
+ }
}
diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml
new file mode 100644
index 00000000000..32d611e7717
--- /dev/null
+++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml.cs b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs
similarity index 86%
rename from Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml.cs
rename to Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs
index fc53cc72ae6..7df02434160 100644
--- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml.cs
+++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs
@@ -10,20 +10,17 @@
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
[GenerateTypedNameReferences]
- public sealed partial class GhostRolesEntry : BoxContainer
+ public sealed partial class GhostRoleButtonsBox : BoxContainer
{
private SpriteSystem _spriteSystem;
public event Action? OnRoleSelected;
public event Action? OnRoleFollow;
- public GhostRolesEntry(string name, string description, bool hasAccess, FormattedMessage? reason, IEnumerable roles, SpriteSystem spriteSystem)
+ public GhostRoleButtonsBox(bool hasAccess, FormattedMessage? reason, IEnumerable roles, SpriteSystem spriteSystem)
{
RobustXamlLoader.Load(this);
_spriteSystem = spriteSystem;
- Title.Text = name;
- Description.SetMessage(description);
-
foreach (var role in roles)
{
var button = new GhostRoleEntryButtons(role);
diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml
index ffde5d69f76..05c52deef16 100644
--- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml
+++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml
@@ -1,15 +1,15 @@
+ Orientation="Horizontal"
+ HorizontalAlignment="Stretch">
+ HorizontalExpand="True"
+ SizeFlagsStretchRatio="3"/>
+ HorizontalExpand="True"/>
diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleInfoBox.xaml b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleInfoBox.xaml
new file mode 100644
index 00000000000..e24455bdf52
--- /dev/null
+++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleInfoBox.xaml
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleInfoBox.xaml.cs b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleInfoBox.xaml.cs
new file mode 100644
index 00000000000..705a9f0bb8c
--- /dev/null
+++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleInfoBox.xaml.cs
@@ -0,0 +1,18 @@
+using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface.Controls;
+using Robust.Client.UserInterface.XAML;
+
+namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
+{
+ [GenerateTypedNameReferences]
+ public sealed partial class GhostRoleInfoBox : BoxContainer
+ {
+ public GhostRoleInfoBox(string name, string description)
+ {
+ RobustXamlLoader.Load(this);
+
+ Title.Text = name;
+ Description.SetMessage(description);
+ }
+ }
+}
diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml
deleted file mode 100644
index d9ed1728107..00000000000
--- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEui.cs b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEui.cs
index 6b183362e56..1cf1e55103d 100644
--- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEui.cs
+++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEui.cs
@@ -5,7 +5,6 @@
using Content.Shared.Ghost.Roles;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
-using Robust.Shared.Utility;
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
@@ -77,6 +76,13 @@ public override void HandleState(EuiStateBase state)
if (state is not GhostRolesEuiState ghostState)
return;
+
+ // We must save BodyVisible state, so all Collapsible boxes will not close
+ // on adding new ghost role.
+ // Save the current state of each Collapsible box being visible or not
+ _window.SaveCollapsibleBoxesStates();
+
+ // Clearing the container before adding new roles
_window.ClearEntries();
var entityManager = IoCManager.Resolve();
@@ -84,28 +90,32 @@ public override void HandleState(EuiStateBase state)
var spriteSystem = sysManager.GetEntitySystem();
var requirementsManager = IoCManager.Resolve();
+ // TODO: role.Requirements value doesn't work at all as an equality key, this must be fixed
+ // Grouping roles
var groupedRoles = ghostState.GhostRoles.GroupBy(
role => (role.Name, role.Description, role.Requirements));
+
+ // Add a new entry for each role group
foreach (var group in groupedRoles)
{
var name = group.Key.Name;
var description = group.Key.Description;
- bool hasAccess = true;
- FormattedMessage? reason;
-
- if (!requirementsManager.CheckRoleRequirements(group.Key.Requirements, null, out reason))
- {
- hasAccess = false;
- }
+ var hasAccess = requirementsManager.CheckRoleRequirements(
+ group.Key.Requirements,
+ null,
+ out var reason);
+ // Adding a new role
_window.AddEntry(name, description, hasAccess, reason, group, spriteSystem);
}
+ // Restore the Collapsible box state if it is saved
+ _window.RestoreCollapsibleBoxesStates();
+
+ // Close the rules window if it is no longer needed
var closeRulesWindow = ghostState.GhostRoles.All(role => role.Identifier != _windowRulesId);
if (closeRulesWindow)
- {
_windowRules?.Close();
- }
}
}
}
diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesWindow.xaml.cs b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesWindow.xaml.cs
index 2e7c99641b7..627ecfe987a 100644
--- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesWindow.xaml.cs
+++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesWindow.xaml.cs
@@ -1,7 +1,10 @@
+using System.Linq;
using Content.Shared.Ghost.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
+using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
+using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
@@ -12,20 +15,86 @@ public sealed partial class GhostRolesWindow : DefaultWindow
public event Action? OnRoleRequestButtonClicked;
public event Action? OnRoleFollow;
+ private Dictionary<(string name, string description), Collapsible> _collapsibleBoxes = new();
+ private HashSet<(string name, string description)> _uncollapsedStates = new();
+
+ public GhostRolesWindow()
+ {
+ RobustXamlLoader.Load(this);
+ }
+
public void ClearEntries()
{
NoRolesMessage.Visible = true;
EntryContainer.DisposeAllChildren();
+ _collapsibleBoxes.Clear();
+ }
+
+ public void SaveCollapsibleBoxesStates()
+ {
+ _uncollapsedStates.Clear();
+ foreach (var (key, collapsible) in _collapsibleBoxes)
+ {
+ if (collapsible.BodyVisible)
+ {
+ _uncollapsedStates.Add(key);
+ }
+ }
+ }
+
+ public void RestoreCollapsibleBoxesStates()
+ {
+ foreach (var (key, collapsible) in _collapsibleBoxes)
+ {
+ collapsible.BodyVisible = _uncollapsedStates.Contains(key);
+ }
}
public void AddEntry(string name, string description, bool hasAccess, FormattedMessage? reason, IEnumerable roles, SpriteSystem spriteSystem)
{
NoRolesMessage.Visible = false;
- var entry = new GhostRolesEntry(name, description, hasAccess, reason, roles, spriteSystem);
- entry.OnRoleSelected += OnRoleRequestButtonClicked;
- entry.OnRoleFollow += OnRoleFollow;
- EntryContainer.AddChild(entry);
+ var ghostRoleInfos = roles.ToList();
+ var rolesCount = ghostRoleInfos.Count;
+
+ var info = new GhostRoleInfoBox(name, description);
+ var buttons = new GhostRoleButtonsBox(hasAccess, reason, ghostRoleInfos, spriteSystem);
+ buttons.OnRoleSelected += OnRoleRequestButtonClicked;
+ buttons.OnRoleFollow += OnRoleFollow;
+
+ EntryContainer.AddChild(info);
+
+ if (rolesCount > 1)
+ {
+ var buttonHeading = new CollapsibleHeading(Loc.GetString("ghost-roles-window-available-button", ("rolesCount", rolesCount)));
+
+ buttonHeading.AddStyleClass(ContainerButton.StyleClassButton);
+ buttonHeading.Label.HorizontalAlignment = HAlignment.Center;
+ buttonHeading.Label.HorizontalExpand = true;
+
+ var body = new CollapsibleBody
+ {
+ Margin = new Thickness(0, 5, 0, 0),
+ };
+
+ // TODO: Add Requirements to this key when it'll be fixed and work as an equality key in GhostRolesEui
+ var key = (name, description);
+
+ var collapsible = new Collapsible(buttonHeading, body)
+ {
+ Orientation = BoxContainer.LayoutOrientation.Vertical,
+ Margin = new Thickness(0, 0, 0, 8),
+ };
+
+ body.AddChild(buttons);
+
+ EntryContainer.AddChild(collapsible);
+ _collapsibleBoxes.Add(key, collapsible);
+ }
+ else
+ {
+ EntryContainer.AddChild(buttons);
+ }
}
}
}
diff --git a/Content.Client/Weapons/Ranged/Systems/GunSystem.cs b/Content.Client/Weapons/Ranged/Systems/GunSystem.cs
index 1af471f28a3..710ee7c7cbf 100644
--- a/Content.Client/Weapons/Ranged/Systems/GunSystem.cs
+++ b/Content.Client/Weapons/Ranged/Systems/GunSystem.cs
@@ -157,7 +157,7 @@ public override void Update(float frameTime)
var useKey = gun.UseKey ? EngineKeyFunctions.Use : EngineKeyFunctions.UseSecondary;
- if (_inputSystem.CmdStates.GetState(useKey) != BoundKeyState.Down)
+ if (_inputSystem.CmdStates.GetState(useKey) != BoundKeyState.Down && !gun.BurstActivated)
{
if (gun.ShotCounter != 0)
EntityManager.RaisePredictiveEvent(new RequestStopShootEvent { Gun = GetNetEntity(gunUid) });
diff --git a/Content.Server/Abilities/Mime/MimePowersSystem.cs b/Content.Server/Abilities/Mime/MimePowersSystem.cs
index 2839952e165..9467b72fcab 100644
--- a/Content.Server/Abilities/Mime/MimePowersSystem.cs
+++ b/Content.Server/Abilities/Mime/MimePowersSystem.cs
@@ -165,8 +165,8 @@ public void RetakeVow(EntityUid uid, MimePowersComponent? mimePowers = null)
mimePowers.ReadyToRepent = false;
mimePowers.VowBroken = false;
AddComp(uid);
- _alertsSystem.ClearAlert(uid, mimePowers.VowAlert);
- _alertsSystem.ShowAlert(uid, mimePowers.VowBrokenAlert);
+ _alertsSystem.ClearAlert(uid, mimePowers.VowBrokenAlert);
+ _alertsSystem.ShowAlert(uid, mimePowers.VowAlert);
_actionsSystem.AddAction(uid, ref mimePowers.InvisibleWallActionEntity, mimePowers.InvisibleWallAction, uid);
}
}
diff --git a/Content.Server/Administration/Toolshed/TagCommand.cs b/Content.Server/Administration/Toolshed/TagCommand.cs
index e1cf53e1b1a..4c6f790e493 100644
--- a/Content.Server/Administration/Toolshed/TagCommand.cs
+++ b/Content.Server/Administration/Toolshed/TagCommand.cs
@@ -25,6 +25,16 @@ public IEnumerable> List([PipedArgument] IEnumerable With(
+ [CommandInvocationContext] IInvocationContext ctx,
+ [PipedArgument] IEnumerable entities,
+ [CommandArgument] ValueRef> tag)
+ {
+ _tag ??= GetSys();
+ return entities.Where(e => _tag.HasTag(e, tag.Evaluate(ctx)!));
+ }
+
[CommandImplementation("add")]
public EntityUid Add(
[CommandInvocationContext] IInvocationContext ctx,
diff --git a/Content.Server/Alert/ServerAlertsSystem.cs b/Content.Server/Alert/ServerAlertsSystem.cs
index b7b80f73210..5af2b062188 100644
--- a/Content.Server/Alert/ServerAlertsSystem.cs
+++ b/Content.Server/Alert/ServerAlertsSystem.cs
@@ -1,7 +1,19 @@
using Content.Shared.Alert;
+using Robust.Shared.GameStates;
namespace Content.Server.Alert;
internal sealed class ServerAlertsSystem : AlertsSystem
{
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ SubscribeLocalEvent(OnGetState);
+ }
+
+ private void OnGetState(Entity alerts, ref ComponentGetState args)
+ {
+ args.State = new AlertComponentState(alerts.Comp.Alerts);
+ }
}
diff --git a/Content.Server/Antag/AntagSelectionSystem.cs b/Content.Server/Antag/AntagSelectionSystem.cs
index 224629ff2e5..610c0ad182a 100644
--- a/Content.Server/Antag/AntagSelectionSystem.cs
+++ b/Content.Server/Antag/AntagSelectionSystem.cs
@@ -55,6 +55,8 @@ public override void Initialize()
{
base.Initialize();
+ Log.Level = LogLevel.Debug;
+
SubscribeLocalEvent(OnTakeGhostRole);
SubscribeLocalEvent(OnObjectivesTextGetInfo);
@@ -360,6 +362,8 @@ public void MakeAntag(Entity ent, ICommonSession? sessi
_role.MindAddRoles(curMind.Value, def.MindRoles, null, true);
ent.Comp.SelectedMinds.Add((curMind.Value, Name(player)));
SendBriefing(session, def.Briefing);
+
+ Log.Debug($"Selected {ToPrettyString(curMind)} as antagonist: {ToPrettyString(ent)}");
}
var afterEv = new AfterAntagEntitySelectedEvent(session, player, ent, def);
diff --git a/Content.Server/Botany/Systems/PlantHolderSystem.cs b/Content.Server/Botany/Systems/PlantHolderSystem.cs
index 34d6a75bf25..271acb606a4 100644
--- a/Content.Server/Botany/Systems/PlantHolderSystem.cs
+++ b/Content.Server/Botany/Systems/PlantHolderSystem.cs
@@ -680,7 +680,10 @@ public bool DoHarvest(EntityUid plantholder, EntityUid user, PlantHolderComponen
if (TryComp(user, out var hands))
{
if (!_botany.CanHarvest(component.Seed, hands.ActiveHandEntity))
+ {
+ _popup.PopupCursor(Loc.GetString("plant-holder-component-ligneous-cant-harvest-message"), user);
return false;
+ }
}
else if (!_botany.CanHarvest(component.Seed))
{
diff --git a/Content.Server/CartridgeLoader/CartridgeLoaderSystem.cs b/Content.Server/CartridgeLoader/CartridgeLoaderSystem.cs
index cd422328c3e..81f60d41faf 100644
--- a/Content.Server/CartridgeLoader/CartridgeLoaderSystem.cs
+++ b/Content.Server/CartridgeLoader/CartridgeLoaderSystem.cs
@@ -422,6 +422,7 @@ private void OnUiMessage(EntityUid uid, CartridgeLoaderComponent component, Cart
{
var cartridgeEvent = args.MessageEvent;
cartridgeEvent.LoaderUid = GetNetEntity(uid);
+ cartridgeEvent.Actor = args.Actor;
RelayEvent(component, cartridgeEvent, true);
}
diff --git a/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs b/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs
index c5c45daa5bd..eb2039604af 100644
--- a/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs
+++ b/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs
@@ -13,6 +13,7 @@
using Content.Shared.Interaction;
using Content.Shared.Mobs.Components;
using Content.Shared.Stacks;
+using Content.Shared.Nutrition.EntitySystems;
namespace Content.Server.Chemistry.EntitySystems;
@@ -20,6 +21,7 @@ public sealed class InjectorSystem : SharedInjectorSystem
{
[Dependency] private readonly BloodstreamSystem _blood = default!;
[Dependency] private readonly ReactiveSystem _reactiveSystem = default!;
+ [Dependency] private readonly OpenableSystem _openable = default!;
public override void Initialize()
{
@@ -31,13 +33,14 @@ public override void Initialize()
private bool TryUseInjector(Entity injector, EntityUid target, EntityUid user)
{
+ var isOpenOrIgnored = injector.Comp.IgnoreClosed || !_openable.IsClosed(target);
// Handle injecting/drawing for solutions
if (injector.Comp.ToggleState == InjectorToggleMode.Inject)
{
- if (SolutionContainers.TryGetInjectableSolution(target, out var injectableSolution, out _))
+ if (isOpenOrIgnored && SolutionContainers.TryGetInjectableSolution(target, out var injectableSolution, out _))
return TryInject(injector, target, injectableSolution.Value, user, false);
- if (SolutionContainers.TryGetRefillableSolution(target, out var refillableSolution, out _))
+ if (isOpenOrIgnored && SolutionContainers.TryGetRefillableSolution(target, out var refillableSolution, out _))
return TryInject(injector, target, refillableSolution.Value, user, true);
if (TryComp(target, out var bloodstream))
@@ -58,7 +61,7 @@ private bool TryUseInjector(Entity injector, EntityUid target
}
// Draw from an object (food, beaker, etc)
- if (SolutionContainers.TryGetDrawableSolution(target, out var drawableSolution, out _))
+ if (isOpenOrIgnored && SolutionContainers.TryGetDrawableSolution(target, out var drawableSolution, out _))
return TryDraw(injector, target, drawableSolution.Value, user);
Popup.PopupEntity(Loc.GetString("injector-component-cannot-draw-message",
diff --git a/Content.Server/Clothing/Systems/CursedMaskSystem.cs b/Content.Server/Clothing/Systems/CursedMaskSystem.cs
index 825e85e2c60..86d4e801a8b 100644
--- a/Content.Server/Clothing/Systems/CursedMaskSystem.cs
+++ b/Content.Server/Clothing/Systems/CursedMaskSystem.cs
@@ -51,7 +51,8 @@ protected override void TryTakeover(Entity ent, EntityUid w
}
var npcFaction = EnsureComp(wearer);
- ent.Comp.OldFactions = npcFaction.Factions;
+ ent.Comp.OldFactions.Clear();
+ ent.Comp.OldFactions.UnionWith(npcFaction.Factions);
_npcFaction.ClearFactions((wearer, npcFaction), false);
_npcFaction.AddFaction((wearer, npcFaction), ent.Comp.CursedMaskFaction);
diff --git a/Content.Server/Database/ServerDbBase.cs b/Content.Server/Database/ServerDbBase.cs
index c85b774e381..3806241e345 100644
--- a/Content.Server/Database/ServerDbBase.cs
+++ b/Content.Server/Database/ServerDbBase.cs
@@ -512,16 +512,23 @@ public abstract Task> GetServerRoleBansAsync(IPAddress? a
public async Task EditServerRoleBan(int id, string reason, NoteSeverity severity, DateTimeOffset? expiration, Guid editedBy, DateTimeOffset editedAt)
{
await using var db = await GetDb();
+ var roleBanDetails = await db.DbContext.RoleBan
+ .Where(b => b.Id == id)
+ .Select(b => new { b.BanTime, b.PlayerUserId })
+ .SingleOrDefaultAsync();
- var ban = await db.DbContext.RoleBan.SingleOrDefaultAsync(b => b.Id == id);
- if (ban is null)
+ if (roleBanDetails == default)
return;
- ban.Severity = severity;
- ban.Reason = reason;
- ban.ExpirationTime = expiration?.UtcDateTime;
- ban.LastEditedById = editedBy;
- ban.LastEditedAt = editedAt.UtcDateTime;
- await db.DbContext.SaveChangesAsync();
+
+ await db.DbContext.RoleBan
+ .Where(b => b.BanTime == roleBanDetails.BanTime && b.PlayerUserId == roleBanDetails.PlayerUserId)
+ .ExecuteUpdateAsync(setters => setters
+ .SetProperty(b => b.Severity, severity)
+ .SetProperty(b => b.Reason, reason)
+ .SetProperty(b => b.ExpirationTime, expiration.HasValue ? expiration.Value.UtcDateTime : (DateTime?)null)
+ .SetProperty(b => b.LastEditedById, editedBy)
+ .SetProperty(b => b.LastEditedAt, editedAt.UtcDateTime)
+ );
}
#endregion
diff --git a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs
index 1987613763b..950795fc05e 100644
--- a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs
+++ b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs
@@ -41,6 +41,8 @@ public override void Initialize()
{
base.Initialize();
+ Log.Level = LogLevel.Debug;
+
SubscribeLocalEvent(AfterEntitySelected);
SubscribeLocalEvent(OnObjectivesTextPrepend);
}
@@ -53,6 +55,7 @@ protected override void Added(EntityUid uid, TraitorRuleComponent component, Gam
private void AfterEntitySelected(Entity ent, ref AfterAntagEntitySelectedEvent args)
{
+ Log.Debug($"AfterAntagEntitySelected {ToPrettyString(ent)}");
MakeTraitor(args.EntityUid, ent);
}
@@ -78,14 +81,22 @@ public string[] GenerateTraitorCodewords(TraitorRuleComponent component)
public bool MakeTraitor(EntityUid traitor, TraitorRuleComponent component)
{
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - start");
+
//Grab the mind if it wasn't provided
if (!_mindSystem.TryGetMind(traitor, out var mindId, out var mind))
+ {
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - failed, no Mind found");
return false;
+ }
var briefing = "";
if (component.GiveCodewords)
+ {
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - added codewords flufftext to briefing");
briefing = Loc.GetString("traitor-role-codewords-short", ("codewords", string.Join(", ", component.Codewords)));
+ }
var issuer = _random.Pick(_prototypeManager.Index(component.ObjectiveIssuers).Values);
@@ -94,6 +105,7 @@ public bool MakeTraitor(EntityUid traitor, TraitorRuleComponent component)
if (component.GiveUplink)
{
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Uplink start");
// Calculate the amount of currency on the uplink.
var startingBalance = component.StartingBalance;
if (_jobs.MindTryGetJob(mindId, out var prototype))
@@ -105,18 +117,27 @@ public bool MakeTraitor(EntityUid traitor, TraitorRuleComponent component)
}
// Choose and generate an Uplink, and return the uplink code if applicable
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Uplink request start");
var uplinkParams = RequestUplink(traitor, startingBalance, briefing);
code = uplinkParams.Item1;
briefing = uplinkParams.Item2;
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Uplink request completed");
}
string[]? codewords = null;
if (component.GiveCodewords)
+ {
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - set codewords from component");
codewords = component.Codewords;
+ }
if (component.GiveBriefing)
+ {
_antag.SendBriefing(traitor, GenerateBriefing(codewords, code, issuer), null, component.GreetSoundNotification);
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Sent the Briefing");
+ }
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Adding TraitorMind");
component.TraitorMinds.Add(mindId);
// Assign briefing
@@ -126,9 +147,14 @@ public bool MakeTraitor(EntityUid traitor, TraitorRuleComponent component)
_roleSystem.MindHasRole(mindId, out var traitorRole);
if (traitorRole is not null)
{
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Add traitor briefing components");
AddComp(traitorRole.Value.Owner);
Comp(traitorRole.Value.Owner).Briefing = briefing;
}
+ else
+ {
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - did not get traitor briefing");
+ }
// Send codewords to only the traitor client
var color = TraitorCodewordColor; // Fall back to a dark red Syndicate color if a prototype is not found
@@ -137,9 +163,11 @@ public bool MakeTraitor(EntityUid traitor, TraitorRuleComponent component)
_roleCodewordSystem.SetRoleCodewords(codewordComp, "traitor", component.Codewords.ToList(), color);
// Change the faction
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Change faction");
_npcFaction.RemoveFaction(traitor, component.NanoTrasenFaction, false);
_npcFaction.AddFaction(traitor, component.SyndicateFaction);
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Finished");
return true;
}
@@ -148,10 +176,12 @@ public bool MakeTraitor(EntityUid traitor, TraitorRuleComponent component)
var pda = _uplink.FindUplinkTarget(traitor);
Note[]? code = null;
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Uplink add");
var uplinked = _uplink.AddUplink(traitor, startingBalance, pda, true);
if (pda is not null && uplinked)
{
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Uplink is PDA");
// Codes are only generated if the uplink is a PDA
code = EnsureComp(pda.Value).Code;
@@ -163,6 +193,7 @@ public bool MakeTraitor(EntityUid traitor, TraitorRuleComponent component)
}
else if (pda is null && uplinked)
{
+ Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Uplink is implant");
briefing += "\n" + Loc.GetString("traitor-role-uplink-implant-short");
}
@@ -172,7 +203,8 @@ public bool MakeTraitor(EntityUid traitor, TraitorRuleComponent component)
// TODO: AntagCodewordsComponent
private void OnObjectivesTextPrepend(EntityUid uid, TraitorRuleComponent comp, ref ObjectivesTextPrependEvent args)
{
- args.Text += "\n" + Loc.GetString("traitor-round-end-codewords", ("codewords", string.Join(", ", comp.Codewords)));
+ if(comp.GiveCodewords)
+ args.Text += "\n" + Loc.GetString("traitor-round-end-codewords", ("codewords", string.Join(", ", comp.Codewords)));
}
// TODO: figure out how to handle this? add priority to briefing event?
diff --git a/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs b/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs
index c3d41cead6d..26fa5ca3cc8 100644
--- a/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs
+++ b/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs
@@ -122,8 +122,7 @@ private void OnVapeInteraction(Entity entity, ref AfterInteractEv
private void OnVapeDoAfter(Entity entity, ref VapeDoAfterEvent args)
{
- if (args.Handled
- || args.Args.Target == null)
+ if (args.Cancelled || args.Handled || args.Args.Target == null)
return;
var environment = _atmos.GetContainingMixture(args.Args.Target.Value, true, true);
diff --git a/Content.Server/Nyanotrasen/Psionics/Glimmer/PassiveGlimmerReductionSystem.cs b/Content.Server/Nyanotrasen/Psionics/Glimmer/PassiveGlimmerReductionSystem.cs
index f0da85ce453..27769721ffd 100644
--- a/Content.Server/Nyanotrasen/Psionics/Glimmer/PassiveGlimmerReductionSystem.cs
+++ b/Content.Server/Nyanotrasen/Psionics/Glimmer/PassiveGlimmerReductionSystem.cs
@@ -1,7 +1,7 @@
using Robust.Shared.Random;
using Robust.Shared.Timing;
using Robust.Shared.Configuration;
-using Content.Shared.CCVar;
+using Content.Shared.DeltaV.CCVars;
using Content.Shared.Psionics.Glimmer;
using Content.Shared.GameTicking;
using Content.Server.CartridgeLoader.Cartridges;
@@ -34,7 +34,7 @@ public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent(OnRoundRestartCleanup);
- _cfg.OnValueChanged(CCVars.GlimmerLostPerSecond, UpdatePassiveGlimmer, true);
+ _cfg.OnValueChanged(DCCVars.GlimmerLostPerSecond, UpdatePassiveGlimmer, true);
}
private void OnRoundRestartCleanup(RoundRestartCleanupEvent args)
diff --git a/Content.Server/Nyanotrasen/Psionics/PsionicsSystem.cs b/Content.Server/Nyanotrasen/Psionics/PsionicsSystem.cs
index 6519d519aa9..fa078159741 100644
--- a/Content.Server/Nyanotrasen/Psionics/PsionicsSystem.cs
+++ b/Content.Server/Nyanotrasen/Psionics/PsionicsSystem.cs
@@ -4,8 +4,8 @@
using Content.Shared.Psionics.Glimmer;
using Content.Shared.Weapons.Melee.Events;
using Content.Shared.Damage.Events;
+using Content.Shared.DeltaV.CCVars;
using Content.Shared.IdentityManagement;
-using Content.Shared.CCVar;
using Content.Server.Abilities.Psionics;
using Content.Server.Chat.Systems;
using Content.Server.Electrocution;
@@ -137,7 +137,7 @@ public bool TryMakePsionic(Entity ent)
if (HasComp(ent))
return false;
- if (!_cfg.GetCVar(CCVars.PsionicRollsEnabled))
+ if (!_cfg.GetCVar(DCCVars.PsionicRollsEnabled))
return false;
var warn = CompOrNull(ent)?.Warn ?? true;
diff --git a/Content.Server/Polymorph/Systems/PolymorphSystem.cs b/Content.Server/Polymorph/Systems/PolymorphSystem.cs
index daff200982d..c9a71c53584 100644
--- a/Content.Server/Polymorph/Systems/PolymorphSystem.cs
+++ b/Content.Server/Polymorph/Systems/PolymorphSystem.cs
@@ -199,6 +199,9 @@ private void OnDestruction(Entity ent, ref Destructi
var targetTransformComp = Transform(uid);
+ if (configuration.PolymorphSound != null)
+ _audio.PlayPvs(configuration.PolymorphSound, targetTransformComp.Coordinates);
+
var child = Spawn(configuration.Entity, _transform.GetMapCoordinates(uid, targetTransformComp), rotation: _transform.GetWorldRotation(uid));
MakeSentientCommand.MakeSentient(child, EntityManager);
@@ -288,6 +291,9 @@ private void OnDestruction(Entity ent, ref Destructi
var uidXform = Transform(uid);
var parentXform = Transform(parent);
+ if (component.Configuration.ExitPolymorphSound != null)
+ _audio.PlayPvs(component.Configuration.ExitPolymorphSound, uidXform.Coordinates);
+
_transform.SetParent(parent, parentXform, uidXform.ParentUid);
_transform.SetCoordinates(parent, parentXform, uidXform.Coordinates, uidXform.LocalRotation);
diff --git a/Content.Server/Procedural/DungeonJob/DungeonJob.PostGenBiome.cs b/Content.Server/Procedural/DungeonJob/DungeonJob.PostGenBiome.cs
index 65f6d2d14f9..fdadcb7849d 100644
--- a/Content.Server/Procedural/DungeonJob/DungeonJob.PostGenBiome.cs
+++ b/Content.Server/Procedural/DungeonJob/DungeonJob.PostGenBiome.cs
@@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Content.Server.Parallax;
+using Content.Shared.Maps;
using Content.Shared.Parallax.Biomes;
using Content.Shared.Procedural;
using Content.Shared.Procedural.PostGeneration;
@@ -15,27 +16,35 @@ public sealed partial class DungeonJob
///
private async Task PostGen(BiomeDunGen dunGen, DungeonData data, Dungeon dungeon, HashSet reservedTiles, Random random)
{
- if (_entManager.TryGetComponent(_gridUid, out BiomeComponent? biomeComp))
+ if (!_prototype.TryIndex(dunGen.BiomeTemplate, out var indexedBiome))
return;
- biomeComp = _entManager.AddComponent(_gridUid);
var biomeSystem = _entManager.System();
- biomeSystem.SetTemplate(_gridUid, biomeComp, _prototype.Index(dunGen.BiomeTemplate));
+
var seed = random.Next();
var xformQuery = _entManager.GetEntityQuery();
- foreach (var node in dungeon.RoomTiles)
+ var tiles = _maps.GetAllTilesEnumerator(_gridUid, _grid);
+ while (tiles.MoveNext(out var tileRef))
{
+ var node = tileRef.Value.GridIndices;
+
if (reservedTiles.Contains(node))
continue;
+
+ if (dunGen.TileMask is not null)
+ {
+ if (!dunGen.TileMask.Contains(((ContentTileDefinition) _tileDefManager[tileRef.Value.Tile.TypeId]).ID))
+ continue;
+ }
// Need to set per-tile to override data.
- if (biomeSystem.TryGetTile(node, biomeComp.Layers, seed, _grid, out var tile))
+ if (biomeSystem.TryGetTile(node, indexedBiome.Layers, seed, _grid, out var tile))
{
_maps.SetTile(_gridUid, _grid, node, tile.Value);
}
- if (biomeSystem.TryGetDecals(node, biomeComp.Layers, seed, _grid, out var decals))
+ if (biomeSystem.TryGetDecals(node, indexedBiome.Layers, seed, _grid, out var decals))
{
foreach (var decal in decals)
{
@@ -43,7 +52,7 @@ private async Task PostGen(BiomeDunGen dunGen, DungeonData data, Dungeon dungeon
}
}
- if (biomeSystem.TryGetEntity(node, biomeComp, _grid, out var entityProto))
+ if (tile is not null && biomeSystem.TryGetEntity(node, indexedBiome.Layers, tile.Value, seed, _grid, out var entityProto))
{
var ent = _entManager.SpawnEntity(entityProto, new EntityCoordinates(_gridUid, node + _grid.TileSizeHalfVector));
var xform = xformQuery.Get(ent);
@@ -61,7 +70,5 @@ private async Task PostGen(BiomeDunGen dunGen, DungeonData data, Dungeon dungeon
if (!ValidateResume())
return;
}
-
- biomeComp.Enabled = false;
}
}
diff --git a/Content.Server/Research/Disk/ResearchDiskSystem.cs b/Content.Server/Research/Disk/ResearchDiskSystem.cs
index d32c49ce6fe..4d65c19f6e2 100644
--- a/Content.Server/Research/Disk/ResearchDiskSystem.cs
+++ b/Content.Server/Research/Disk/ResearchDiskSystem.cs
@@ -31,6 +31,7 @@ private void OnAfterInteract(EntityUid uid, ResearchDiskComponent component, Aft
_research.ModifyServerPoints(args.Target.Value, component.Points, server);
_popupSystem.PopupEntity(Loc.GetString("research-disk-inserted", ("points", component.Points)), args.Target.Value, args.User);
EntityManager.QueueDeleteEntity(uid);
+ args.Handled = true;
}
private void OnMapInit(EntityUid uid, ResearchDiskComponent component, MapInitEvent args)
diff --git a/Content.Server/Silicons/Borgs/BorgSwitchableTypeSystem.cs b/Content.Server/Silicons/Borgs/BorgSwitchableTypeSystem.cs
new file mode 100644
index 00000000000..d1a32a6a5ba
--- /dev/null
+++ b/Content.Server/Silicons/Borgs/BorgSwitchableTypeSystem.cs
@@ -0,0 +1,82 @@
+using Content.Server.Inventory;
+using Content.Server.Radio.Components;
+using Content.Shared.Inventory;
+using Content.Shared.Silicons.Borgs;
+using Content.Shared.Silicons.Borgs.Components;
+using Robust.Shared.Prototypes;
+using Robust.Shared.Utility;
+
+namespace Content.Server.Silicons.Borgs;
+
+///
+/// Server-side logic for borg type switching. Handles more heavyweight and server-specific switching logic.
+///
+public sealed class BorgSwitchableTypeSystem : SharedBorgSwitchableTypeSystem
+{
+ [Dependency] private readonly BorgSystem _borgSystem = default!;
+ [Dependency] private readonly ServerInventorySystem _inventorySystem = default!;
+
+ protected override void SelectBorgModule(Entity ent, ProtoId borgType)
+ {
+ var prototype = Prototypes.Index(borgType);
+
+ // Assign radio channels
+ string[] radioChannels = [.. ent.Comp.InherentRadioChannels, .. prototype.RadioChannels];
+ if (TryComp(ent, out IntrinsicRadioTransmitterComponent? transmitter))
+ transmitter.Channels = [.. radioChannels];
+
+ if (TryComp(ent, out ActiveRadioComponent? activeRadio))
+ activeRadio.Channels = [.. radioChannels];
+
+ // Borg transponder for the robotics console
+ if (TryComp(ent, out BorgTransponderComponent? transponder))
+ {
+ _borgSystem.SetTransponderSprite(
+ (ent.Owner, transponder),
+ new SpriteSpecifier.Rsi(new ResPath("Mobs/Silicon/chassis.rsi"), prototype.SpriteBodyState));
+
+ _borgSystem.SetTransponderName(
+ (ent.Owner, transponder),
+ Loc.GetString($"borg-type-{borgType}-transponder"));
+ }
+
+ // Configure modules
+ if (TryComp(ent, out BorgChassisComponent? chassis))
+ {
+ var chassisEnt = (ent.Owner, chassis);
+ _borgSystem.SetMaxModules(
+ chassisEnt,
+ prototype.ExtraModuleCount + prototype.DefaultModules.Length);
+
+ _borgSystem.SetModuleWhitelist(chassisEnt, prototype.ModuleWhitelist);
+
+ foreach (var module in prototype.DefaultModules)
+ {
+ var moduleEntity = Spawn(module);
+ var borgModule = Comp(moduleEntity);
+ _borgSystem.SetBorgModuleDefault((moduleEntity, borgModule), true);
+ _borgSystem.InsertModule(chassisEnt, moduleEntity);
+ }
+ }
+
+ // Configure special components
+ if (Prototypes.TryIndex(ent.Comp.SelectedBorgType, out var previousPrototype))
+ {
+ if (previousPrototype.AddComponents is { } removeComponents)
+ EntityManager.RemoveComponents(ent, removeComponents);
+ }
+
+ if (prototype.AddComponents is { } addComponents)
+ {
+ EntityManager.AddComponents(ent, addComponents);
+ }
+
+ // Configure inventory template (used for hat spacing)
+ if (TryComp(ent, out InventoryComponent? inventory))
+ {
+ _inventorySystem.SetTemplateId((ent.Owner, inventory), prototype.InventoryTemplateId);
+ }
+
+ base.SelectBorgModule(ent, borgType);
+ }
+}
diff --git a/Content.Server/Silicons/Borgs/BorgSystem.Modules.cs b/Content.Server/Silicons/Borgs/BorgSystem.Modules.cs
index d5a429db030..f95a5807360 100644
--- a/Content.Server/Silicons/Borgs/BorgSystem.Modules.cs
+++ b/Content.Server/Silicons/Borgs/BorgSystem.Modules.cs
@@ -2,6 +2,7 @@
using Content.Shared.Hands.Components;
using Content.Shared.Interaction.Components;
using Content.Shared.Silicons.Borgs.Components;
+using Content.Shared.Whitelist;
using Robust.Shared.Containers;
namespace Content.Server.Silicons.Borgs;
@@ -300,6 +301,24 @@ public bool CanInsertModule(EntityUid uid, EntityUid module, BorgChassisComponen
return true;
}
+ ///
+ /// Check if a module can be removed from a borg.
+ ///
+ /// The borg that the module is being removed from.
+ /// The module to remove from the borg.
+ /// The user attempting to remove the module.
+ /// True if the module can be removed.
+ public bool CanRemoveModule(
+ Entity borg,
+ Entity module,
+ EntityUid? user = null)
+ {
+ if (module.Comp.DefaultModule)
+ return false;
+
+ return true;
+ }
+
///
/// Installs and activates all modules currently inside the borg's module container
///
@@ -369,4 +388,24 @@ public void UninstallModule(EntityUid uid, EntityUid module, BorgChassisComponen
var ev = new BorgModuleUninstalledEvent(uid);
RaiseLocalEvent(module, ref ev);
}
+
+ ///
+ /// Sets .
+ ///
+ /// The borg to modify.
+ /// The new max module count.
+ public void SetMaxModules(Entity ent, int maxModules)
+ {
+ ent.Comp.MaxModules = maxModules;
+ }
+
+ ///
+ /// Sets .
+ ///
+ /// The borg to modify.
+ /// The new module whitelist.
+ public void SetModuleWhitelist(Entity ent, EntityWhitelist? whitelist)
+ {
+ ent.Comp.ModuleWhitelist = whitelist;
+ }
}
diff --git a/Content.Server/Silicons/Borgs/BorgSystem.Transponder.cs b/Content.Server/Silicons/Borgs/BorgSystem.Transponder.cs
index 781f847be35..b4ba1400441 100644
--- a/Content.Server/Silicons/Borgs/BorgSystem.Transponder.cs
+++ b/Content.Server/Silicons/Borgs/BorgSystem.Transponder.cs
@@ -8,6 +8,7 @@
using Content.Server.DeviceNetwork.Components;
using Content.Server.DeviceNetwork.Systems;
using Content.Server.Explosion.Components;
+using Robust.Shared.Utility;
namespace Content.Server.Silicons.Borgs;
@@ -134,4 +135,20 @@ private bool CheckEmagged(EntityUid uid, string name)
return false;
}
+
+ ///
+ /// Sets .
+ ///
+ public void SetTransponderSprite(Entity ent, SpriteSpecifier sprite)
+ {
+ ent.Comp.Sprite = sprite;
+ }
+
+ ///
+ /// Sets .
+ ///
+ public void SetTransponderName(Entity ent, string name)
+ {
+ ent.Comp.Name = name;
+ }
}
diff --git a/Content.Server/Silicons/Borgs/BorgSystem.Ui.cs b/Content.Server/Silicons/Borgs/BorgSystem.Ui.cs
index d0e9f80e364..40c2c3bf332 100644
--- a/Content.Server/Silicons/Borgs/BorgSystem.Ui.cs
+++ b/Content.Server/Silicons/Borgs/BorgSystem.Ui.cs
@@ -82,6 +82,9 @@ private void OnRemoveModuleBuiMessage(EntityUid uid, BorgChassisComponent compon
if (!component.ModuleContainer.Contains(module))
return;
+ if (!CanRemoveModule((uid, component), (module, Comp(module)), args.Actor))
+ return;
+
_adminLog.Add(LogType.Action, LogImpact.Medium,
$"{ToPrettyString(args.Actor):player} removed module {ToPrettyString(module)} from borg {ToPrettyString(uid)}");
_container.Remove(module, component.ModuleContainer);
diff --git a/Content.Server/Silicons/Borgs/BorgSystem.cs b/Content.Server/Silicons/Borgs/BorgSystem.cs
index bd85282a0f5..ff204bfa8ce 100644
--- a/Content.Server/Silicons/Borgs/BorgSystem.cs
+++ b/Content.Server/Silicons/Borgs/BorgSystem.cs
@@ -129,7 +129,7 @@ private void OnChassisInteractUsing(EntityUid uid, BorgChassisComponent componen
if (module != null && CanInsertModule(uid, used, component, module, args.User))
{
- _container.Insert(used, component.ModuleContainer);
+ InsertModule((uid, component), used);
_adminLog.Add(LogType.Action, LogImpact.Low,
$"{ToPrettyString(args.User):player} installed module {ToPrettyString(used)} into borg {ToPrettyString(uid)}");
args.Handled = true;
@@ -137,6 +137,19 @@ private void OnChassisInteractUsing(EntityUid uid, BorgChassisComponent componen
}
}
+ ///
+ /// Inserts a new module into a borg, the same as if a player inserted it manually.
+ ///
+ ///
+ /// This does not run checks to see if the borg is actually allowed to be inserted, such as whitelists.
+ ///
+ /// The borg to insert into.
+ /// The module to insert.
+ public void InsertModule(Entity ent, EntityUid module)
+ {
+ _container.Insert(module, ent.Comp.ModuleContainer);
+ }
+
// todo: consider transferring over the ghost role? managing that might suck.
protected override void OnInserted(EntityUid uid, BorgChassisComponent component, EntInsertedIntoContainerMessage args)
{
diff --git a/Content.Server/Silicons/Laws/SiliconLawEui.cs b/Content.Server/Silicons/Laws/SiliconLawEui.cs
index d5a5c4f4091..9fd639e9b3d 100644
--- a/Content.Server/Silicons/Laws/SiliconLawEui.cs
+++ b/Content.Server/Silicons/Laws/SiliconLawEui.cs
@@ -1,4 +1,4 @@
-using Content.Server.Administration.Managers;
+using Content.Server.Administration.Managers;
using Content.Server.EUI;
using Content.Shared.Administration;
using Content.Shared.Eui;
@@ -52,8 +52,8 @@ public override void HandleMessage(EuiMessageBase msg)
return;
var player = _entityManager.GetEntity(message.Target);
-
- _siliconLawSystem.SetLaws(message.Laws, player);
+ if (_entityManager.TryGetComponent(player, out var playerProviderComp))
+ _siliconLawSystem.SetLaws(message.Laws, player, playerProviderComp.LawUploadSound);
}
private bool IsAllowed()
diff --git a/Content.Server/Silicons/Laws/SiliconLawSystem.cs b/Content.Server/Silicons/Laws/SiliconLawSystem.cs
index 0070beb6ef9..9a361132a5c 100644
--- a/Content.Server/Silicons/Laws/SiliconLawSystem.cs
+++ b/Content.Server/Silicons/Laws/SiliconLawSystem.cs
@@ -21,6 +21,8 @@
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Toolshed;
+using Robust.Shared.Audio;
+using Robust.Shared.GameObjects;
namespace Content.Server.Silicons.Laws;
@@ -113,7 +115,7 @@ private void OnIonStormLaws(EntityUid uid, SiliconLawProviderComponent component
component.Lawset = args.Lawset;
// gotta tell player to check their laws
- NotifyLawsChanged(uid);
+ NotifyLawsChanged(uid, component.LawUploadSound);
// new laws may allow antagonist behaviour so make it clear for admins
if (TryComp(uid, out var emag))
@@ -149,14 +151,11 @@ protected override void OnGotEmagged(EntityUid uid, EmagSiliconLawComponent comp
return;
base.OnGotEmagged(uid, component, ref args);
- NotifyLawsChanged(uid);
+ NotifyLawsChanged(uid, component.EmaggedSound);
EnsureEmaggedRole(uid, component);
_stunSystem.TryParalyze(uid, component.StunTime, true);
- if (!_mind.TryGetMind(uid, out var mindId, out _))
- return;
- _roles.MindPlaySound(mindId, component.EmaggedSound);
}
private void OnEmagMindAdded(EntityUid uid, EmagSiliconLawComponent component, MindAddedMessage args)
@@ -237,7 +236,7 @@ public SiliconLawset GetLaws(EntityUid uid, SiliconLawBoundComponent? component
return ev.Laws;
}
- public void NotifyLawsChanged(EntityUid uid)
+ public void NotifyLawsChanged(EntityUid uid, SoundSpecifier? cue = null)
{
if (!TryComp(uid, out var actor))
return;
@@ -245,6 +244,9 @@ public void NotifyLawsChanged(EntityUid uid)
var msg = Loc.GetString("laws-update-notify");
var wrappedMessage = Loc.GetString("chat-manager-server-wrap-message", ("message", msg));
_chatManager.ChatMessageToOne(ChatChannel.Server, msg, wrappedMessage, default, false, actor.PlayerSession.Channel, colorOverride: Color.Red);
+
+ if (cue != null && _mind.TryGetMind(uid, out var mindId, out _))
+ _roles.MindPlaySound(mindId, cue);
}
///
@@ -269,7 +271,7 @@ public SiliconLawset GetLawset(ProtoId lawset)
///
/// Set the laws of a silicon entity while notifying the player.
///
- public void SetLaws(List newLaws, EntityUid target)
+ public void SetLaws(List newLaws, EntityUid target, SoundSpecifier? cue = null)
{
if (!TryComp(target, out var component))
return;
@@ -278,7 +280,7 @@ public void SetLaws(List newLaws, EntityUid target)
component.Lawset = new SiliconLawset();
component.Lawset.Laws = newLaws;
- NotifyLawsChanged(target);
+ NotifyLawsChanged(target, cue);
}
protected override void OnUpdaterInsert(Entity ent, ref EntInsertedIntoContainerMessage args)
@@ -292,9 +294,7 @@ protected override void OnUpdaterInsert(Entity ent,
while (query.MoveNext(out var update))
{
- SetLaws(lawset, update);
- if (provider.LawUploadSound != null && _mind.TryGetMind(update, out var mindId, out _))
- _roles.MindPlaySound(mindId, provider.LawUploadSound);
+ SetLaws(lawset, update, provider.LawUploadSound);
}
}
}
diff --git a/Content.Server/Silicons/StationAi/StationAiSystem.cs b/Content.Server/Silicons/StationAi/StationAiSystem.cs
index 846497387d2..a10833dc63b 100644
--- a/Content.Server/Silicons/StationAi/StationAiSystem.cs
+++ b/Content.Server/Silicons/StationAi/StationAiSystem.cs
@@ -1,10 +1,11 @@
using System.Linq;
using Content.Server.Chat.Managers;
-using Content.Server.Chat.Systems;
using Content.Shared.Chat;
+using Content.Shared.Mind;
+using Content.Shared.Roles;
using Content.Shared.Silicons.StationAi;
using Content.Shared.StationAi;
-using Robust.Shared.Audio.Systems;
+using Robust.Shared.Audio;
using Robust.Shared.Map.Components;
using Robust.Shared.Player;
@@ -14,6 +15,8 @@ public sealed class StationAiSystem : SharedStationAiSystem
{
[Dependency] private readonly IChatManager _chats = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
+ [Dependency] private readonly SharedMindSystem _mind = default!;
+ [Dependency] private readonly SharedRoleSystem _roles = default!;
private readonly HashSet> _ais = new();
@@ -43,6 +46,19 @@ public override bool SetWhitelistEnabled(Entity ent
return true;
}
+ public override void AnnounceIntellicardUsage(EntityUid uid, SoundSpecifier? cue = null)
+ {
+ if (!TryComp(uid, out var actor))
+ return;
+
+ var msg = Loc.GetString("ai-consciousness-download-warning");
+ var wrappedMessage = Loc.GetString("chat-manager-server-wrap-message", ("message", msg));
+ _chats.ChatMessageToOne(ChatChannel.Server, msg, wrappedMessage, default, false, actor.PlayerSession.Channel, colorOverride: Color.Red);
+
+ if (cue != null && _mind.TryGetMind(uid, out var mindId, out _))
+ _roles.MindPlaySound(mindId, cue);
+ }
+
private void AnnounceSnip(EntityUid entity)
{
var xform = Transform(entity);
diff --git a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs
index 1ada60e1d64..f828139ed6f 100644
--- a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs
+++ b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs
@@ -196,7 +196,8 @@ public void SwitchOn(EntityUid uid, EmitterComponent component)
if (TryComp(uid, out var apcReceiver))
{
apcReceiver.Load = component.PowerUseActive;
- PowerOn(uid, component);
+ if (apcReceiver.Powered)
+ PowerOn(uid, component);
}
// Do not directly PowerOn().
// OnReceivedPowerChanged will get fired due to DrawRate change which will turn it on.
diff --git a/Content.Server/StationEvents/EventManagerSystem.cs b/Content.Server/StationEvents/EventManagerSystem.cs
index cde25d2762b..49059deeefe 100644
--- a/Content.Server/StationEvents/EventManagerSystem.cs
+++ b/Content.Server/StationEvents/EventManagerSystem.cs
@@ -3,6 +3,7 @@
using Content.Server.RoundEnd;
using Content.Server.StationEvents.Components;
using Content.Shared.CCVar;
+using Content.Shared.DeltaV.CCVars; // DeltaV
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
@@ -272,7 +273,7 @@ private bool CanRun(EntityPrototype prototype, StationEventComponent stationEven
// Nyano - Summary: - Begin modified code block: check for glimmer events.
// This could not be cleanly done anywhere else.
- if (_configurationManager.GetCVar(CCVars.GlimmerEnabled) &&
+ if (_configurationManager.GetCVar(DCCVars.GlimmerEnabled) &&
prototype.TryGetComponent(out var glimmerEvent) &&
(_glimmer.Glimmer < glimmerEvent.MinimumGlimmer ||
_glimmer.Glimmer > glimmerEvent.MaximumGlimmer))
diff --git a/Content.Server/Thief/Systems/ThiefBeaconSystem.cs b/Content.Server/Thief/Systems/ThiefBeaconSystem.cs
index de1c3d2e6d1..4c65ba5c449 100644
--- a/Content.Server/Thief/Systems/ThiefBeaconSystem.cs
+++ b/Content.Server/Thief/Systems/ThiefBeaconSystem.cs
@@ -20,7 +20,6 @@ public sealed class ThiefBeaconSystem : EntitySystem
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly MindSystem _mind = default!;
[Dependency] private readonly SharedRoleSystem _roles = default!;
-
public override void Initialize()
{
base.Initialize();
diff --git a/Content.Server/Voting/Managers/VoteManager.cs b/Content.Server/Voting/Managers/VoteManager.cs
index 04e31916482..10b975fdcac 100644
--- a/Content.Server/Voting/Managers/VoteManager.cs
+++ b/Content.Server/Voting/Managers/VoteManager.cs
@@ -24,7 +24,6 @@
using Robust.Shared.Timing;
using Robust.Shared.Utility;
-
namespace Content.Server.Voting.Managers
{
public sealed partial class VoteManager : IVoteManager
@@ -40,7 +39,7 @@ public sealed partial class VoteManager : IVoteManager
[Dependency] private readonly IGameMapManager _gameMapManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
- [Dependency] private readonly ISharedPlaytimeManager _playtimeManager = default!;
+ [Dependency] private readonly ISharedPlaytimeManager _playtimeManager = default!;
private int _nextVoteId = 1;
@@ -282,7 +281,7 @@ private void SendSingleUpdate(VoteReg v, ICommonSession player)
}
// Admin always see the vote count, even if the vote is set to hide it.
- if (_adminMgr.HasAdminFlag(player, AdminFlags.Moderator))
+ if (v.DisplayVotes || _adminMgr.HasAdminFlag(player, AdminFlags.Moderator))
{
msg.DisplayVotes = true;
}
diff --git a/Content.Server/Weapons/Ranged/Systems/GunSystem.AutoFire.cs b/Content.Server/Weapons/Ranged/Systems/GunSystem.AutoFire.cs
index 8b993245948..06051d9d2ff 100644
--- a/Content.Server/Weapons/Ranged/Systems/GunSystem.AutoFire.cs
+++ b/Content.Server/Weapons/Ranged/Systems/GunSystem.AutoFire.cs
@@ -1,3 +1,4 @@
+using Content.Shared.Damage;
using Content.Shared.Weapons.Ranged.Components;
using Content.Server.Power.Components; // Frontier
using Content.Server.Power.EntitySystems; // Frontier
@@ -5,6 +6,7 @@
using Content.Shared.Examine; // Frontier
using Content.Shared.Power; // Frontier
using Content.Server.Popups; // Frontier
+using Robust.Shared.Map;
namespace Content.Server.Weapons.Ranged.Systems;
@@ -20,17 +22,28 @@ public override void Update(float frameTime)
*/
// Automatic firing without stopping if the AutoShootGunComponent component is exist and enabled
- var query = EntityQueryEnumerator();
+ var query = EntityQueryEnumerator();
- while (query.MoveNext(out var uid, out var autoShoot, out var gun))
+ while (query.MoveNext(out var uid, out var gun))
{
- if (!autoShoot.Enabled)
- continue;
-
if (gun.NextFire > Timing.CurTime)
continue;
- AttemptShoot(uid, gun);
+ if (TryComp(uid, out AutoShootGunComponent? autoShoot))
+ {
+ if (!autoShoot.Enabled)
+ continue;
+
+ AttemptShoot(uid, gun);
+ }
+ else if (gun.BurstActivated)
+ {
+ var parent = _transform.GetParentUid(uid);
+ if (HasComp(parent))
+ AttemptShoot(parent, uid, gun, gun.ShootCoordinates ?? new EntityCoordinates(uid, gun.DefaultDirection));
+ else
+ AttemptShoot(uid, gun);
+ }
}
}
diff --git a/Content.Server/Weather/WeatherSystem.cs b/Content.Server/Weather/WeatherSystem.cs
index dbee62a72fc..ec377809133 100644
--- a/Content.Server/Weather/WeatherSystem.cs
+++ b/Content.Server/Weather/WeatherSystem.cs
@@ -4,6 +4,7 @@
using Robust.Shared.Console;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
+using System.Linq;
namespace Content.Server.Weather;
@@ -85,6 +86,7 @@ private CompletionResult WeatherCompletion(IConsoleShell shell, string[] args)
return CompletionResult.FromHintOptions(CompletionHelper.MapIds(EntityManager), "Map Id");
var a = CompletionHelper.PrototypeIDs(true, ProtoMan);
- return CompletionResult.FromHintOptions(a, Loc.GetString("cmd-weather-hint"));
+ var b = a.Concat(new[] { new CompletionOption("null", Loc.GetString("cmd-weather-null")) });
+ return CompletionResult.FromHintOptions(b, Loc.GetString("cmd-weather-hint"));
}
}
diff --git a/Content.Shared/Alert/AlertsComponent.cs b/Content.Shared/Alert/AlertsComponent.cs
index 05b11e19efb..16827e9cdff 100644
--- a/Content.Shared/Alert/AlertsComponent.cs
+++ b/Content.Shared/Alert/AlertsComponent.cs
@@ -1,4 +1,5 @@
using Robust.Shared.GameStates;
+using Robust.Shared.Serialization;
namespace Content.Shared.Alert;
@@ -6,12 +7,23 @@ namespace Content.Shared.Alert;
/// Handles the icons on the right side of the screen.
/// Should only be used for player-controlled entities.
///
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
+// Component is not AutoNetworked due to supporting clientside-only alerts.
+// Component state is handled manually to avoid the server overwriting the client list.
+[RegisterComponent, NetworkedComponent]
public sealed partial class AlertsComponent : Component
{
[ViewVariables]
- [AutoNetworkedField]
public Dictionary Alerts = new();
public override bool SendOnlyToOwner => true;
}
+
+[Serializable, NetSerializable]
+public sealed class AlertComponentState : ComponentState
+{
+ public Dictionary Alerts { get; }
+ public AlertComponentState(Dictionary alerts)
+ {
+ Alerts = alerts;
+ }
+}
diff --git a/Content.Shared/CCVar/CCVars.Accessibility.cs b/Content.Shared/CCVar/CCVars.Accessibility.cs
new file mode 100644
index 00000000000..8eb61f0806d
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Accessibility.cs
@@ -0,0 +1,41 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// Chat window opacity slider, controlling the alpha of the chat window background.
+ /// Goes from to 0 (completely transparent) to 1 (completely opaque)
+ ///
+ public static readonly CVarDef ChatWindowOpacity =
+ CVarDef.Create("accessibility.chat_window_transparency", 0.85f, CVar.CLIENTONLY | CVar.ARCHIVE);
+
+ ///
+ /// Toggle for visual effects that may potentially cause motion sickness.
+ /// Where reasonable, effects affected by this CVar should use an alternate effect.
+ /// Please do not use this CVar as a bandaid for effects that could otherwise be made accessible without issue.
+ ///
+ public static readonly CVarDef ReducedMotion =
+ CVarDef.Create("accessibility.reduced_motion", false, CVar.CLIENTONLY | CVar.ARCHIVE);
+
+ public static readonly CVarDef ChatEnableColorName =
+ CVarDef.Create("accessibility.enable_color_name",
+ true,
+ CVar.CLIENTONLY | CVar.ARCHIVE,
+ "Toggles displaying names with individual colors.");
+
+ ///
+ /// Screen shake intensity slider, controlling the intensity of the CameraRecoilSystem.
+ /// Goes from 0 (no recoil at all) to 1 (regular amounts of recoil)
+ ///
+ public static readonly CVarDef ScreenShakeIntensity =
+ CVarDef.Create("accessibility.screen_shake_intensity", 1f, CVar.CLIENTONLY | CVar.ARCHIVE);
+
+ ///
+ /// A generic toggle for various visual effects that are color sensitive.
+ /// As of 2/16/24, only applies to progress bar colors.
+ ///
+ public static readonly CVarDef AccessibilityColorblindFriendly =
+ CVarDef.Create("accessibility.colorblind_friendly", false, CVar.CLIENTONLY | CVar.ARCHIVE);
+}
diff --git a/Content.Shared/CCVar/CCVars.Admin.Ahelp.cs b/Content.Shared/CCVar/CCVars.Admin.Ahelp.cs
new file mode 100644
index 00000000000..48f3965bb5c
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Admin.Ahelp.cs
@@ -0,0 +1,39 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// Ahelp rate limit values are accounted in periods of this size (seconds).
+ /// After the period has passed, the count resets.
+ ///
+ ///
+ public static readonly CVarDef AhelpRateLimitPeriod =
+ CVarDef.Create("ahelp.rate_limit_period", 2f, CVar.SERVERONLY);
+
+ ///
+ /// How many ahelp messages are allowed in a single rate limit period.
+ ///
+ ///
+ public static readonly CVarDef AhelpRateLimitCount =
+ CVarDef.Create("ahelp.rate_limit_count", 10, CVar.SERVERONLY);
+
+ ///
+ /// Should the administrator's position be displayed in ahelp.
+ /// If it is is false, only the admin's ckey will be displayed in the ahelp.
+ ///
+ ///
+ ///
+ public static readonly CVarDef AhelpAdminPrefix =
+ CVarDef.Create("ahelp.admin_prefix", false, CVar.SERVERONLY);
+
+ ///
+ /// Should the administrator's position be displayed in the webhook.
+ /// If it is is false, only the admin's ckey will be displayed in webhook.
+ ///
+ ///
+ ///
+ public static readonly CVarDef AhelpAdminPrefixWebhook =
+ CVarDef.Create("ahelp.admin_prefix_webhook", false, CVar.SERVERONLY);
+}
diff --git a/Content.Shared/CCVar/CCVars.Admin.Logs.cs b/Content.Shared/CCVar/CCVars.Admin.Logs.cs
new file mode 100644
index 00000000000..862456ddfdd
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Admin.Logs.cs
@@ -0,0 +1,42 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// Controls if admin logs are enabled. Highly recommended to shut this off for development.
+ ///
+ public static readonly CVarDef AdminLogsEnabled =
+ CVarDef.Create("adminlogs.enabled", true, CVar.SERVERONLY);
+
+ public static readonly CVarDef AdminLogsQueueSendDelay =
+ CVarDef.Create("adminlogs.queue_send_delay_seconds", 5f, CVar.SERVERONLY);
+
+ ///
+ /// When to skip the waiting time to save in-round admin logs, if no admin logs are currently being saved
+ ///
+ public static readonly CVarDef AdminLogsQueueMax =
+ CVarDef.Create("adminlogs.queue_max", 5000, CVar.SERVERONLY);
+
+ ///
+ /// When to skip the waiting time to save pre-round admin logs, if no admin logs are currently being saved
+ ///
+ public static readonly CVarDef AdminLogsPreRoundQueueMax =
+ CVarDef.Create("adminlogs.pre_round_queue_max", 5000, CVar.SERVERONLY);
+
+ ///
+ /// When to start dropping logs
+ ///
+ public static readonly CVarDef AdminLogsDropThreshold =
+ CVarDef.Create("adminlogs.drop_threshold", 20000, CVar.SERVERONLY);
+
+ ///
+ /// How many logs to send to the client at once
+ ///
+ public static readonly CVarDef AdminLogsClientBatchSize =
+ CVarDef.Create("adminlogs.client_batch_size", 1000, CVar.SERVERONLY);
+
+ public static readonly CVarDef AdminLogsServerName =
+ CVarDef.Create("adminlogs.server_name", "unknown", CVar.SERVERONLY);
+}
diff --git a/Content.Shared/CCVar/CCVars.Admin.Rules.cs b/Content.Shared/CCVar/CCVars.Admin.Rules.cs
new file mode 100644
index 00000000000..7385104364b
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Admin.Rules.cs
@@ -0,0 +1,18 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// Time that players have to wait before rules can be accepted.
+ ///
+ public static readonly CVarDef RulesWaitTime =
+ CVarDef.Create("rules.time", 45f, CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Don't show rules to localhost/loopback interface.
+ ///
+ public static readonly CVarDef RulesExemptLocal =
+ CVarDef.Create("rules.exempt_local", true, CVar.SERVERONLY);
+}
diff --git a/Content.Shared/CCVar/CCVars.Admin.cs b/Content.Shared/CCVar/CCVars.Admin.cs
new file mode 100644
index 00000000000..28bebfbe8a6
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Admin.cs
@@ -0,0 +1,163 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ public static readonly CVarDef AdminAnnounceLogin =
+ CVarDef.Create("admin.announce_login", true, CVar.SERVERONLY);
+
+ public static readonly CVarDef AdminAnnounceLogout =
+ CVarDef.Create("admin.announce_logout", true, CVar.SERVERONLY);
+
+ ///
+ /// The token used to authenticate with the admin API. Leave empty to disable the admin API. This is a secret! Do not share!
+ ///
+ public static readonly CVarDef AdminApiToken =
+ CVarDef.Create("admin.api_token", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL);
+
+ ///
+ /// Should users be able to see their own notes? Admins will be able to see and set notes regardless
+ ///
+ public static readonly CVarDef SeeOwnNotes =
+ CVarDef.Create("admin.see_own_notes", false, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
+
+ ///
+ /// Should the server play a quick sound to the active admins whenever a new player joins?
+ ///
+ public static readonly CVarDef AdminNewPlayerJoinSound =
+ CVarDef.Create("admin.new_player_join_sound", false, CVar.SERVERONLY);
+
+ ///
+ /// The amount of days before the note starts fading. It will slowly lose opacity until it reaches stale. Set to 0 to disable.
+ ///
+ public static readonly CVarDef NoteFreshDays =
+ CVarDef.Create("admin.note_fresh_days", 91.31055, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
+
+ ///
+ /// The amount of days before the note completely fades, and can only be seen by admins if they press "see more notes". Set to 0
+ /// if you want the note to immediately disappear without fading.
+ ///
+ public static readonly CVarDef NoteStaleDays =
+ CVarDef.Create("admin.note_stale_days", 365.2422, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
+
+ ///
+ /// How much time does the user have to wait in seconds before confirming that they saw an admin message?
+ ///
+ public static readonly CVarDef MessageWaitTime =
+ CVarDef.Create("admin.message_wait_time", 3f, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
+
+ ///
+ /// Default severity for role bans
+ ///
+ public static readonly CVarDef RoleBanDefaultSeverity =
+ CVarDef.Create("admin.role_ban_default_severity", "medium", CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Default severity for department bans
+ ///
+ public static readonly CVarDef DepartmentBanDefaultSeverity =
+ CVarDef.Create("admin.department_ban_default_severity", "medium", CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Default severity for server bans
+ ///
+ public static readonly CVarDef ServerBanDefaultSeverity =
+ CVarDef.Create("admin.server_ban_default_severity", "High", CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Whether a server ban will ban the player's ip by default.
+ ///
+ public static readonly CVarDef ServerBanIpBanDefault =
+ CVarDef.Create("admin.server_ban_ip_ban_default", true, CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Whether a server ban will ban the player's hardware id by default.
+ ///
+ public static readonly CVarDef ServerBanHwidBanDefault =
+ CVarDef.Create("admin.server_ban_hwid_ban_default", true, CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Whether to use details from last connection for ip/hwid in the BanPanel.
+ ///
+ public static readonly CVarDef ServerBanUseLastDetails =
+ CVarDef.Create("admin.server_ban_use_last_details", true, CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Whether to erase a player's chat messages and their entity from the game when banned.
+ ///
+ public static readonly CVarDef ServerBanErasePlayer =
+ CVarDef.Create("admin.server_ban_erase_player", false, CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Minimum players sharing a connection required to create an alert. -1 to disable the alert.
+ ///
+ ///
+ /// If you set this to 0 or 1 then it will alert on every connection, so probably don't do that.
+ ///
+ public static readonly CVarDef AdminAlertMinPlayersSharingConnection =
+ CVarDef.Create("admin.alert.min_players_sharing_connection", -1, CVar.SERVERONLY);
+
+ ///
+ /// Minimum explosion intensity to create an admin alert message. -1 to disable the alert.
+ ///
+ public static readonly CVarDef AdminAlertExplosionMinIntensity =
+ CVarDef.Create("admin.alert.explosion_min_intensity", 60, CVar.SERVERONLY);
+
+ ///
+ /// Minimum particle accelerator strength to create an admin alert message.
+ ///
+ public static readonly CVarDef AdminAlertParticleAcceleratorMinPowerState =
+ CVarDef.Create("admin.alert.particle_accelerator_min_power_state", 5, CVar.SERVERONLY); // strength 4
+
+ ///
+ /// Should the ban details in admin channel include PII? (IP, HWID, etc)
+ ///
+ public static readonly CVarDef AdminShowPIIOnBan =
+ CVarDef.Create("admin.show_pii_onban", false, CVar.SERVERONLY);
+
+ ///
+ /// If an admin joins a round by reading up or using the late join button, automatically
+ /// de-admin them.
+ ///
+ public static readonly CVarDef AdminDeadminOnJoin =
+ CVarDef.Create("admin.deadmin_on_join", false, CVar.SERVERONLY);
+
+ ///
+ /// Overrides the name the client sees in ahelps. Set empty to disable.
+ ///
+ public static readonly CVarDef AdminAhelpOverrideClientName =
+ CVarDef.Create("admin.override_adminname_in_client_ahelp", string.Empty, CVar.SERVERONLY);
+
+ ///
+ /// The threshold of minutes to appear as a "new player" in the ahelp menu
+ /// If 0, appearing as a new player is disabled.
+ ///
+ public static readonly CVarDef NewPlayerThreshold =
+ CVarDef.Create("admin.new_player_threshold", 0, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
+
+ ///
+ /// How long an admin client can go without any input before being considered AFK.
+ ///
+ public static readonly CVarDef AdminAfkTime =
+ CVarDef.Create("admin.afk_time", 600f, CVar.SERVERONLY);
+
+ ///
+ /// If true, admins are able to connect even if
+ /// would otherwise block regular players.
+ ///
+ public static readonly CVarDef AdminBypassMaxPlayers =
+ CVarDef.Create("admin.bypass_max_players", true, CVar.SERVERONLY);
+
+ ///
+ /// Determine if custom rank names are used.
+ /// If it is false, it'd use the actual rank name regardless of the individual's title.
+ ///
+ ///
+ ///
+ public static readonly CVarDef AdminUseCustomNamesAdminRank =
+ CVarDef.Create("admin.use_custom_names_admin_rank", true, CVar.SERVERONLY);
+
+ public static readonly CVarDef BanHardwareIds =
+ CVarDef.Create("ban.hardware_ids", true, CVar.SERVERONLY);
+}
diff --git a/Content.Shared/CCVar/CCVars.Atmos.cs b/Content.Shared/CCVar/CCVars.Atmos.cs
new file mode 100644
index 00000000000..cc1069b4fc8
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Atmos.cs
@@ -0,0 +1,153 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// Whether gas differences will move entities.
+ ///
+ public static readonly CVarDef SpaceWind =
+ CVarDef.Create("atmos.space_wind", false, CVar.SERVERONLY);
+
+ ///
+ /// Divisor from maxForce (pressureDifference * 2.25f) to force applied on objects.
+ ///
+ public static readonly CVarDef SpaceWindPressureForceDivisorThrow =
+ CVarDef.Create("atmos.space_wind_pressure_force_divisor_throw", 15f, CVar.SERVERONLY);
+
+ ///
+ /// Divisor from maxForce (pressureDifference * 2.25f) to force applied on objects.
+ ///
+ public static readonly CVarDef SpaceWindPressureForceDivisorPush =
+ CVarDef.Create("atmos.space_wind_pressure_force_divisor_push", 2500f, CVar.SERVERONLY);
+
+ ///
+ /// The maximum velocity (not force) that may be applied to an object by atmospheric pressure differences.
+ /// Useful to prevent clipping through objects.
+ ///
+ public static readonly CVarDef SpaceWindMaxVelocity =
+ CVarDef.Create("atmos.space_wind_max_velocity", 30f, CVar.SERVERONLY);
+
+ ///
+ /// The maximum force that may be applied to an object by pushing (i.e. not throwing) atmospheric pressure differences.
+ /// A "throwing" atmospheric pressure difference ignores this limit, but not the max. velocity limit.
+ ///
+ public static readonly CVarDef SpaceWindMaxPushForce =
+ CVarDef.Create("atmos.space_wind_max_push_force", 20f, CVar.SERVERONLY);
+
+ ///
+ /// Whether monstermos tile equalization is enabled.
+ ///
+ public static readonly CVarDef MonstermosEqualization =
+ CVarDef.Create("atmos.monstermos_equalization", true, CVar.SERVERONLY);
+
+ ///
+ /// Whether monstermos explosive depressurization is enabled.
+ /// Needs to be enabled to work.
+ ///
+ public static readonly CVarDef MonstermosDepressurization =
+ CVarDef.Create("atmos.monstermos_depressurization", true, CVar.SERVERONLY);
+
+ ///
+ /// Whether monstermos explosive depressurization will rip tiles..
+ /// Needs and to be enabled to work.
+ /// WARNING: This cvar causes MAJOR contrast issues, and usually tends to make any spaced scene look very cluttered.
+ /// This not only usually looks strange, but can also reduce playability for people with impaired vision. Please think twice before enabling this on your server.
+ /// Also looks weird on slow spacing for unrelated reasons. If you do want to enable this, you should probably turn on instaspacing.
+ ///
+ public static readonly CVarDef MonstermosRipTiles =
+ CVarDef.Create("atmos.monstermos_rip_tiles", false, CVar.SERVERONLY);
+
+ ///
+ /// Whether explosive depressurization will cause the grid to gain an impulse.
+ /// Needs and to be enabled to work.
+ ///
+ public static readonly CVarDef AtmosGridImpulse =
+ CVarDef.Create("atmos.grid_impulse", false, CVar.SERVERONLY);
+
+ ///
+ /// What fraction of air from a spaced tile escapes every tick.
+ /// 1.0 for instant spacing, 0.2 means 20% of remaining air lost each time
+ ///
+ public static readonly CVarDef AtmosSpacingEscapeRatio =
+ CVarDef.Create("atmos.mmos_spacing_speed", 0.15f, CVar.SERVERONLY);
+
+ ///
+ /// Minimum amount of air allowed on a spaced tile before it is reset to 0 immediately in kPa
+ /// Since the decay due to SpacingEscapeRatio follows a curve, it would never reach 0.0 exactly
+ /// unless we truncate it somewhere.
+ ///
+ public static readonly CVarDef AtmosSpacingMinGas =
+ CVarDef.Create("atmos.mmos_min_gas", 2.0f, CVar.SERVERONLY);
+
+ ///
+ /// How much wind can go through a single tile before that tile doesn't depressurize itself
+ /// (I.e spacing is limited in large rooms heading into smaller spaces)
+ ///
+ public static readonly CVarDef AtmosSpacingMaxWind =
+ CVarDef.Create("atmos.mmos_max_wind", 500f, CVar.SERVERONLY);
+
+ ///
+ /// Whether atmos superconduction is enabled.
+ ///
+ /// Disabled by default, superconduction is awful.
+ public static readonly CVarDef Superconduction =
+ CVarDef.Create("atmos.superconduction", false, CVar.SERVERONLY);
+
+ ///
+ /// Heat loss per tile due to radiation at 20 degC, in W.
+ ///
+ public static readonly CVarDef SuperconductionTileLoss =
+ CVarDef.Create("atmos.superconduction_tile_loss", 30f, CVar.SERVERONLY);
+
+ ///
+ /// Whether excited groups will be processed and created.
+ ///
+ public static readonly CVarDef ExcitedGroups =
+ CVarDef.Create("atmos.excited_groups", true, CVar.SERVERONLY);
+
+ ///
+ /// Whether all tiles in an excited group will clear themselves once being exposed to space.
+ /// Similar to , without none of the tile ripping or
+ /// things being thrown around very violently.
+ /// Needs to be enabled to work.
+ ///
+ public static readonly CVarDef ExcitedGroupsSpaceIsAllConsuming =
+ CVarDef.Create("atmos.excited_groups_space_is_all_consuming", false, CVar.SERVERONLY);
+
+ ///
+ /// Maximum time in milliseconds that atmos can take processing.
+ ///
+ public static readonly CVarDef AtmosMaxProcessTime =
+ CVarDef.Create("atmos.max_process_time", 3f, CVar.SERVERONLY);
+
+ ///
+ /// Atmos tickrate in TPS. Atmos processing will happen every 1/TPS seconds.
+ ///
+ public static readonly CVarDef AtmosTickRate =
+ CVarDef.Create("atmos.tickrate", 15f, CVar.SERVERONLY);
+
+ ///
+ /// Scale factor for how fast things happen in our atmosphere
+ /// simulation compared to real life. 1x means pumps run at 1x
+ /// speed. Players typically expect things to happen faster
+ /// in-game.
+ ///
+ public static readonly CVarDef AtmosSpeedup =
+ CVarDef.Create("atmos.speedup", 8f, CVar.SERVERONLY);
+
+ ///
+ /// Like atmos.speedup, but only for gas and reaction heat values. 64x means
+ /// gases heat up and cool down 64x faster than real life.
+ ///
+ public static readonly CVarDef AtmosHeatScale =
+ CVarDef.Create("atmos.heat_scale", 8f, CVar.SERVERONLY);
+
+ ///
+ /// Maximum explosion radius for explosions caused by bursting a gas tank ("max caps").
+ /// Setting this to zero disables the explosion but still allows the tank to burst and leak.
+ ///
+ public static readonly CVarDef AtmosTankFragment =
+ CVarDef.Create("atmos.max_explosion_range", 26f, CVar.SERVERONLY);
+}
diff --git a/Content.Shared/CCVar/CCVars.Audio.cs b/Content.Shared/CCVar/CCVars.Audio.cs
new file mode 100644
index 00000000000..4d9e7c44315
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Audio.cs
@@ -0,0 +1,61 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// How long we'll wait until re-sampling nearby objects for ambience. Should be pretty fast, but doesn't have to match the tick rate.
+ ///
+ public static readonly CVarDef AmbientCooldown =
+ CVarDef.Create("ambience.cooldown", 0.1f, CVar.ARCHIVE | CVar.CLIENTONLY);
+
+ ///
+ /// How large of a range to sample for ambience.
+ ///
+ public static readonly CVarDef AmbientRange =
+ CVarDef.Create("ambience.range", 8f, CVar.REPLICATED | CVar.SERVER);
+
+ ///
+ /// Maximum simultaneous ambient sounds.
+ ///
+ public static readonly CVarDef MaxAmbientSources =
+ CVarDef.Create("ambience.max_sounds", 16, CVar.ARCHIVE | CVar.CLIENTONLY);
+
+ ///
+ /// The minimum value the user can set for ambience.max_sounds
+ ///
+ public static readonly CVarDef MinMaxAmbientSourcesConfigured =
+ CVarDef.Create("ambience.min_max_sounds_configured", 16, CVar.REPLICATED | CVar.SERVER | CVar.CHEAT);
+
+ ///
+ /// The maximum value the user can set for ambience.max_sounds
+ ///
+ public static readonly CVarDef MaxMaxAmbientSourcesConfigured =
+ CVarDef.Create("ambience.max_max_sounds_configured", 64, CVar.REPLICATED | CVar.SERVER | CVar.CHEAT);
+
+ ///
+ /// Ambience volume.
+ ///
+ public static readonly CVarDef AmbienceVolume =
+ CVarDef.Create("ambience.volume", 1.5f, CVar.ARCHIVE | CVar.CLIENTONLY);
+
+ ///
+ /// Ambience music volume.
+ ///
+ public static readonly CVarDef AmbientMusicVolume =
+ CVarDef.Create("ambience.music_volume", 1.5f, CVar.ARCHIVE | CVar.CLIENTONLY);
+
+ ///
+ /// Lobby / round end music volume.
+ ///
+ public static readonly CVarDef LobbyMusicVolume =
+ CVarDef.Create("ambience.lobby_music_volume", 0.50f, CVar.ARCHIVE | CVar.CLIENTONLY);
+
+ ///
+ /// UI volume.
+ ///
+ public static readonly CVarDef InterfaceVolume =
+ CVarDef.Create("audio.interface_volume", 0.50f, CVar.ARCHIVE | CVar.CLIENTONLY);
+
+}
diff --git a/Content.Shared/CCVar/CCVars.Chat.Looc.cs b/Content.Shared/CCVar/CCVars.Chat.Looc.cs
new file mode 100644
index 00000000000..84ee2c28072
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Chat.Looc.cs
@@ -0,0 +1,26 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ public static readonly CVarDef LoocEnabled =
+ CVarDef.Create("looc.enabled", true, CVar.NOTIFY | CVar.REPLICATED);
+
+ public static readonly CVarDef AdminLoocEnabled =
+ CVarDef.Create("looc.enabled_admin", true, CVar.NOTIFY);
+
+ ///
+ /// True: Dead players can use LOOC
+ /// False: Dead player LOOC gets redirected to dead chat
+ ///
+ public static readonly CVarDef DeadLoocEnabled =
+ CVarDef.Create("looc.enabled_dead", false, CVar.NOTIFY | CVar.REPLICATED);
+
+ ///
+ /// True: Crit players can use LOOC
+ /// False: Crit player LOOC gets redirected to dead chat
+ ///
+ public static readonly CVarDef CritLoocEnabled =
+ CVarDef.Create("looc.enabled_crit", false, CVar.NOTIFY | CVar.REPLICATED);
+}
diff --git a/Content.Shared/CCVar/CCVars.Chat.Ooc.cs b/Content.Shared/CCVar/CCVars.Chat.Ooc.cs
new file mode 100644
index 00000000000..ba5e41053b6
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Chat.Ooc.cs
@@ -0,0 +1,27 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ public static readonly CVarDef
+ OocEnabled = CVarDef.Create("ooc.enabled", true, CVar.NOTIFY | CVar.REPLICATED);
+
+ public static readonly CVarDef AdminOocEnabled =
+ CVarDef.Create("ooc.enabled_admin", true, CVar.NOTIFY);
+
+ ///
+ /// If true, whenever OOC is disabled the Discord OOC relay will also be disabled.
+ ///
+ public static readonly CVarDef DisablingOOCDisablesRelay =
+ CVarDef.Create("ooc.disabling_ooc_disables_relay", true, CVar.SERVERONLY);
+
+ ///
+ /// Whether or not OOC chat should be enabled during a round.
+ ///
+ public static readonly CVarDef OocEnableDuringRound =
+ CVarDef.Create("ooc.enable_during_round", false, CVar.NOTIFY | CVar.REPLICATED | CVar.SERVER);
+
+ public static readonly CVarDef ShowOocPatronColor =
+ CVarDef.Create("ooc.show_ooc_patron_color", true, CVar.ARCHIVE | CVar.REPLICATED | CVar.CLIENT);
+}
diff --git a/Content.Shared/CCVar/CCVars.Chat.cs b/Content.Shared/CCVar/CCVars.Chat.cs
new file mode 100644
index 00000000000..139a82372a2
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Chat.cs
@@ -0,0 +1,68 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// Chat rate limit values are accounted in periods of this size (seconds).
+ /// After the period has passed, the count resets.
+ ///
+ ///
+ public static readonly CVarDef ChatRateLimitPeriod =
+ CVarDef.Create("chat.rate_limit_period", 2f, CVar.SERVERONLY);
+
+ ///
+ /// How many chat messages are allowed in a single rate limit period.
+ ///
+ ///
+ /// The total rate limit throughput per second is effectively
+ /// divided by .
+ ///
+ ///
+ public static readonly CVarDef ChatRateLimitCount =
+ CVarDef.Create("chat.rate_limit_count", 10, CVar.SERVERONLY);
+
+ ///
+ /// Minimum delay (in seconds) between notifying admins about chat message rate limit violations.
+ /// A negative value disables admin announcements.
+ ///
+ public static readonly CVarDef ChatRateLimitAnnounceAdminsDelay =
+ CVarDef.Create("chat.rate_limit_announce_admins_delay", 15, CVar.SERVERONLY);
+
+ public static readonly CVarDef ChatMaxMessageLength =
+ CVarDef.Create("chat.max_message_length", 1000, CVar.SERVER | CVar.REPLICATED);
+
+ public static readonly CVarDef ChatMaxAnnouncementLength =
+ CVarDef.Create("chat.max_announcement_length", 256, CVar.SERVER | CVar.REPLICATED);
+
+ public static readonly CVarDef ChatSanitizerEnabled =
+ CVarDef.Create("chat.chat_sanitizer_enabled", true, CVar.SERVERONLY);
+
+ public static readonly CVarDef ChatShowTypingIndicator =
+ CVarDef.Create("chat.show_typing_indicator", true, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
+
+ public static readonly CVarDef ChatEnableFancyBubbles =
+ CVarDef.Create("chat.enable_fancy_bubbles",
+ true,
+ CVar.CLIENTONLY | CVar.ARCHIVE,
+ "Toggles displaying fancy speech bubbles, which display the speaking character's name.");
+
+ public static readonly CVarDef ChatFancyNameBackground =
+ CVarDef.Create("chat.fancy_name_background",
+ false,
+ CVar.CLIENTONLY | CVar.ARCHIVE,
+ "Toggles displaying a background under the speaking character's name.");
+
+ ///
+ /// A message broadcast to each player that joins the lobby.
+ /// May be changed by admins ingame through use of the "set-motd" command.
+ /// In this case the new value, if not empty, is broadcast to all connected players and saved between rounds.
+ /// May be requested by any player through use of the "get-motd" command.
+ ///
+ public static readonly CVarDef MOTD =
+ CVarDef.Create("chat.motd",
+ "",
+ CVar.SERVER | CVar.SERVERONLY | CVar.ARCHIVE,
+ "A message broadcast to each player that joins the lobby.");
+}
diff --git a/Content.Shared/CCVar/CCVars.Config.cs b/Content.Shared/CCVar/CCVars.Config.cs
new file mode 100644
index 00000000000..4e11f09ee7c
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Config.cs
@@ -0,0 +1,35 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ // These are server-only for now since I don't foresee a client use yet,
+ // and I don't wanna have to start coming up with like .client suffixes and stuff like that.
+
+ ///
+ /// Configuration presets to load during startup.
+ /// Multiple presets can be separated by comma and are loaded in order.
+ ///
+ ///
+ /// Loaded presets must be located under the ConfigPresets/ resource directory and end with the .toml extension.
+ /// Only the file name (without extension) must be given for this variable.
+ ///
+ public static readonly CVarDef ConfigPresets =
+ CVarDef.Create("config.presets", "", CVar.SERVERONLY);
+
+ ///
+ /// Whether to load the preset development CVars.
+ /// This disables some things like lobby to make development easier.
+ /// Even when true, these are only loaded if the game is compiled with DEVELOPMENT set.
+ ///
+ public static readonly CVarDef ConfigPresetDevelopment =
+ CVarDef.Create("config.preset_development", true, CVar.SERVERONLY);
+
+ ///
+ /// Whether to load the preset debug CVars.
+ /// Even when true, these are only loaded if the game is compiled with DEBUG set.
+ ///
+ public static readonly CVarDef ConfigPresetDebug =
+ CVarDef.Create("config.preset_debug", true, CVar.SERVERONLY);
+}
diff --git a/Content.Shared/CCVar/CCVars.Console.cs b/Content.Shared/CCVar/CCVars.Console.cs
new file mode 100644
index 00000000000..e670b9f836e
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Console.cs
@@ -0,0 +1,15 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ public static readonly CVarDef ConsoleLoginLocal =
+ CVarDef.Create("console.loginlocal", true, CVar.ARCHIVE | CVar.SERVERONLY);
+
+ ///
+ /// Automatically log in the given user as host, equivalent to the promotehost command.
+ ///
+ public static readonly CVarDef ConsoleLoginHostUser =
+ CVarDef.Create("console.login_host_user", "", CVar.ARCHIVE | CVar.SERVERONLY);
+}
diff --git a/Content.Shared/CCVar/CCVars.Crewmanifest.cs b/Content.Shared/CCVar/CCVars.Crewmanifest.cs
new file mode 100644
index 00000000000..d6251886b95
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Crewmanifest.cs
@@ -0,0 +1,24 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// Setting this allows a crew manifest to be opened from any window
+ /// that has a crew manifest button, and sends the correct message.
+ /// If this is false, only in-game entities will allow you to see
+ /// the crew manifest, if the functionality is coded in.
+ /// Having administrator priveledge ignores this, but will still
+ /// hide the button in UI windows.
+ ///
+ public static readonly CVarDef CrewManifestWithoutEntity =
+ CVarDef.Create("crewmanifest.no_entity", true, CVar.REPLICATED);
+
+ ///
+ /// Setting this allows the crew manifest to be viewed from 'unsecure'
+ /// entities, such as the PDA.
+ ///
+ public static readonly CVarDef CrewManifestUnsecure =
+ CVarDef.Create("crewmanifest.unsecure", true, CVar.REPLICATED);
+}
diff --git a/Content.Shared/CCVar/CCVars.Database.cs b/Content.Shared/CCVar/CCVars.Database.cs
new file mode 100644
index 00000000000..c549bd7e033
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Database.cs
@@ -0,0 +1,77 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+#if DEBUG
+ private const int DefaultSqliteDelay = 1;
+#else
+ private const int DefaultSqliteDelay = 0;
+#endif
+
+ public static readonly CVarDef DatabaseEngine =
+ CVarDef.Create("database.engine", "sqlite", CVar.SERVERONLY);
+
+ public static readonly CVarDef DatabaseSqliteDbPath =
+ CVarDef.Create("database.sqlite_dbpath", "preferences.db", CVar.SERVERONLY);
+
+ ///
+ /// Milliseconds to asynchronously delay all SQLite database acquisitions with.
+ ///
+ ///
+ /// Defaults to 1 on DEBUG, 0 on RELEASE.
+ /// This is intended to help catch .Result deadlock bugs that only happen on postgres
+ /// (because SQLite is not actually asynchronous normally)
+ ///
+ public static readonly CVarDef DatabaseSqliteDelay =
+ CVarDef.Create("database.sqlite_delay", DefaultSqliteDelay, CVar.SERVERONLY);
+
+ ///
+ /// Amount of concurrent SQLite database operations.
+ ///
+ ///
+ /// Note that SQLite is not a properly asynchronous database and also has limited read/write concurrency.
+ /// Increasing this number may allow more concurrent reads, but it probably won't matter much.
+ /// SQLite operations are normally ran on the thread pool, which may cause thread pool starvation if the concurrency is too high.
+ ///
+ public static readonly CVarDef DatabaseSqliteConcurrency =
+ CVarDef.Create("database.sqlite_concurrency", 3, CVar.SERVERONLY);
+
+ public static readonly CVarDef DatabasePgHost =
+ CVarDef.Create("database.pg_host", "localhost", CVar.SERVERONLY);
+
+ public static readonly CVarDef DatabasePgPort =
+ CVarDef.Create("database.pg_port", 5432, CVar.SERVERONLY);
+
+ public static readonly CVarDef DatabasePgDatabase =
+ CVarDef.Create("database.pg_database", "ss14", CVar.SERVERONLY);
+
+ public static readonly CVarDef DatabasePgUsername =
+ CVarDef.Create("database.pg_username", "postgres", CVar.SERVERONLY);
+
+ public static readonly CVarDef DatabasePgPassword =
+ CVarDef.Create("database.pg_password", "", CVar.SERVERONLY | CVar.CONFIDENTIAL);
+
+ ///
+ /// Max amount of concurrent Postgres database operations.
+ ///
+ public static readonly CVarDef DatabasePgConcurrency =
+ CVarDef.Create("database.pg_concurrency", 8, CVar.SERVERONLY);
+
+ ///
+ /// Milliseconds to asynchronously delay all PostgreSQL database operations with.
+ ///
+ ///
+ /// This is intended for performance testing. It works different from ,
+ /// as the lag is applied after acquiring the database lock.
+ ///
+ public static readonly CVarDef DatabasePgFakeLag =
+ CVarDef.Create("database.pg_fake_lag", 0, CVar.SERVERONLY);
+
+ ///
+ /// Basically only exists for integration tests to avoid race conditions.
+ ///
+ public static readonly CVarDef DatabaseSynchronous =
+ CVarDef.Create("database.sync", false, CVar.SERVERONLY);
+}
diff --git a/Content.Shared/CCVar/CCVars.Discord.cs b/Content.Shared/CCVar/CCVars.Discord.cs
new file mode 100644
index 00000000000..a6c4ada7454
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Discord.cs
@@ -0,0 +1,61 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// The role that will get mentioned if a new SOS ahelp comes in.
+ ///
+ public static readonly CVarDef DiscordAhelpMention =
+ CVarDef.Create("discord.on_call_ping", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL);
+
+ ///
+ /// URL of the discord webhook to relay unanswered ahelp messages.
+ ///
+ public static readonly CVarDef DiscordOnCallWebhook =
+ CVarDef.Create("discord.on_call_webhook", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL);
+
+ ///
+ /// URL of the Discord webhook which will relay all ahelp messages.
+ ///
+ public static readonly CVarDef DiscordAHelpWebhook =
+ CVarDef.Create("discord.ahelp_webhook", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL);
+
+ ///
+ /// The server icon to use in the Discord ahelp embed footer.
+ /// Valid values are specified at https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure.
+ ///
+ public static readonly CVarDef DiscordAHelpFooterIcon =
+ CVarDef.Create("discord.ahelp_footer_icon", string.Empty, CVar.SERVERONLY);
+
+ ///
+ /// The avatar to use for the webhook. Should be an URL.
+ ///
+ public static readonly CVarDef DiscordAHelpAvatar =
+ CVarDef.Create("discord.ahelp_avatar", string.Empty, CVar.SERVERONLY);
+
+ ///
+ /// URL of the Discord webhook which will relay all custom votes. If left empty, disables the webhook.
+ ///
+ public static readonly CVarDef DiscordVoteWebhook =
+ CVarDef.Create("discord.vote_webhook", string.Empty, CVar.SERVERONLY);
+
+ ///
+ /// URL of the Discord webhook which will relay all votekick votes. If left empty, disables the webhook.
+ ///
+ public static readonly CVarDef DiscordVotekickWebhook =
+ CVarDef.Create("discord.votekick_webhook", string.Empty, CVar.SERVERONLY);
+
+ ///
+ /// URL of the Discord webhook which will relay round restart messages.
+ ///
+ public static readonly CVarDef DiscordRoundUpdateWebhook =
+ CVarDef.Create("discord.round_update_webhook", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL);
+
+ ///
+ /// Role id for the Discord webhook to ping when the round ends.
+ ///
+ public static readonly CVarDef DiscordRoundEndRoleWebhook =
+ CVarDef.Create("discord.round_end_role", string.Empty, CVar.SERVERONLY);
+}
diff --git a/Content.Shared/CCVar/CCVars.Events.cs b/Content.Shared/CCVar/CCVars.Events.cs
new file mode 100644
index 00000000000..48797b8438c
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Events.cs
@@ -0,0 +1,12 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// Controls if the game should run station events
+ ///
+ public static readonly CVarDef
+ EventsEnabled = CVarDef.Create("events.enabled", true, CVar.ARCHIVE | CVar.SERVERONLY);
+}
diff --git a/Content.Shared/CCVar/CCVars.Explosion.cs b/Content.Shared/CCVar/CCVars.Explosion.cs
new file mode 100644
index 00000000000..51d93456b7e
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Explosion.cs
@@ -0,0 +1,108 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// How many tiles the explosion system will process per tick
+ ///
+ ///
+ /// Setting this too high will put a large load on a single tick. Setting this too low will lead to
+ /// unnaturally "slow" explosions.
+ ///
+ public static readonly CVarDef ExplosionTilesPerTick =
+ CVarDef.Create("explosion.tiles_per_tick", 100, CVar.SERVERONLY);
+
+ ///
+ /// Upper limit on the size of an explosion before physics-throwing is disabled.
+ ///
+ ///
+ /// Large nukes tend to generate a lot of shrapnel that flies through space. This can functionally cripple
+ /// the server TPS for a while after an explosion (or even during, if the explosion is processed
+ /// incrementally.
+ ///
+ public static readonly CVarDef ExplosionThrowLimit =
+ CVarDef.Create("explosion.throw_limit", 400, CVar.SERVERONLY);
+
+ ///
+ /// If this is true, explosion processing will pause the NodeGroupSystem to pause updating.
+ ///
+ ///
+ /// This only takes effect if an explosion needs more than one tick to process (i.e., covers more than tiles). If this is not enabled, the node-system will rebuild its graph
+ /// every tick as the explosion shreds the station, causing significant slowdown.
+ ///
+ public static readonly CVarDef ExplosionSleepNodeSys =
+ CVarDef.Create("explosion.node_sleep", true, CVar.SERVERONLY);
+
+ ///
+ /// Upper limit on the total area that an explosion can affect before the neighbor-finding algorithm just
+ /// stops. Defaults to a 60-rile radius explosion.
+ ///
+ ///
+ /// Actual area may be larger, as it currently doesn't terminate mid neighbor finding. I.e., area may be that of a ~51 tile radius circle instead.
+ ///
+ public static readonly CVarDef ExplosionMaxArea =
+ CVarDef.Create("explosion.max_area", (int)3.14f * 256 * 256, CVar.SERVERONLY);
+
+ ///
+ /// Upper limit on the number of neighbor finding steps for the explosion system neighbor-finding algorithm.
+ ///
+ ///
+ /// Effectively places an upper limit on the range that any explosion can have. In the vast majority of
+ /// instances, will likely be hit before this becomes a limiting factor.
+ ///
+ public static readonly CVarDef ExplosionMaxIterations =
+ CVarDef.Create("explosion.max_iterations", 500, CVar.SERVERONLY);
+
+ ///
+ /// Max Time in milliseconds to spend processing explosions every tick.
+ ///
+ ///
+ /// This time limiting is not perfectly implemented. Firstly, a significant chunk of processing time happens
+ /// due to queued entity deletions, which happen outside of the system update code. Secondly, explosion
+ /// spawning cannot currently be interrupted & resumed, and may lead to exceeding this time limit.
+ ///
+ public static readonly CVarDef ExplosionMaxProcessingTime =
+ CVarDef.Create("explosion.max_tick_time", 7f, CVar.SERVERONLY);
+
+ ///
+ /// If the explosion is being processed incrementally over several ticks, this variable determines whether
+ /// updating the grid tiles should be done incrementally at the end of every tick, or only once the explosion has finished processing.
+ ///
+ ///
+ /// The most notable consequence of this change is that explosions will only punch a hole in the station &
+ /// create a vacumm once they have finished exploding. So airlocks will no longer slam shut as the explosion
+ /// expands, just suddenly at the end.
+ ///
+ public static readonly CVarDef ExplosionIncrementalTileBreaking =
+ CVarDef.Create("explosion.incremental_tile", false, CVar.SERVERONLY);
+
+ ///
+ /// This determines for how many seconds an explosion should stay visible once it has finished expanding.
+ ///
+ public static readonly CVarDef ExplosionPersistence =
+ CVarDef.Create("explosion.persistence", 1.0f, CVar.SERVERONLY);
+
+ ///
+ /// If an explosion covers a larger area than this number, the damaging/processing will always start during
+ /// the next tick, instead of during the same tick that the explosion was generated in.
+ ///
+ ///
+ /// This value can be used to ensure that for large explosions the area/tile calculation and the explosion
+ /// processing/damaging occurs in separate ticks. This helps reduce the single-tick lag if both and are large. I.e., instead of
+ /// a single tick explosion, this cvar allows for a configuration that results in a two-tick explosion,
+ /// though most of the computational cost is still in the second tick.
+ ///
+ public static readonly CVarDef ExplosionSingleTickAreaLimit =
+ CVarDef.Create("explosion.single_tick_area_limit", 400, CVar.SERVERONLY);
+
+ ///
+ /// Whether or not explosions are allowed to create tiles that have
+ /// set to true.
+ ///
+ public static readonly CVarDef ExplosionCanCreateVacuum =
+ CVarDef.Create("explosion.can_create_vacuum", true, CVar.SERVERONLY);
+}
diff --git a/Content.Shared/CCVar/CCVars.Game.Infolinks.cs b/Content.Shared/CCVar/CCVars.Game.Infolinks.cs
new file mode 100644
index 00000000000..fa8332b497e
--- /dev/null
+++ b/Content.Shared/CCVar/CCVars.Game.Infolinks.cs
@@ -0,0 +1,54 @@
+using Robust.Shared.Configuration;
+
+namespace Content.Shared.CCVar;
+
+public sealed partial class CCVars
+{
+ ///
+ /// Link to Discord server to show in the launcher.
+ ///
+ public static readonly CVarDef InfoLinksDiscord =
+ CVarDef.Create("infolinks.discord", "", CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Link to website to show in the launcher.
+ ///
+ public static readonly CVarDef InfoLinksForum =
+ CVarDef.Create("infolinks.forum", "", CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Link to GitHub page to show in the launcher.
+ ///
+ public static readonly CVarDef InfoLinksGithub =
+ CVarDef.Create("infolinks.github", "", CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Link to website to show in the launcher.
+ ///
+ public static readonly CVarDef InfoLinksWebsite =
+ CVarDef.Create("infolinks.website", "", CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Link to wiki to show in the launcher.
+ ///
+ public static readonly CVarDef InfoLinksWiki =
+ CVarDef.Create("infolinks.wiki", "", CVar.SERVER | CVar.REPLICATED);
+
+ ///
+ /// Link to Patreon. Not shown in the launcher currently.
+ ///
+ public static readonly CVarDef InfoLinksPatreon =
+ CVarDef.Create("infolinks.patreon", "", CVar.SERVER | CVar.REPLICATED);
+
+ ///