diff --git a/Content.Client/DoAfter/DoAfterSystem.cs b/Content.Client/DoAfter/DoAfterSystem.cs index b00904a1fe..5802059537 100644 --- a/Content.Client/DoAfter/DoAfterSystem.cs +++ b/Content.Client/DoAfter/DoAfterSystem.cs @@ -30,7 +30,9 @@ public sealed class DoAfterSystem : SharedDoAfterSystem _overlay.RemoveOverlay(); } +#pragma warning disable RA0028 // No base call in overriden function public override void Update(float frameTime) +#pragma warning restore RA0028 // No base call in overriden function { // Currently this only predicts do afters initiated by the player. diff --git a/Content.Client/GameTicking/Managers/ClientGameTicker.cs b/Content.Client/GameTicking/Managers/ClientGameTicker.cs index fcf5ae91a4..3d5775a3c5 100644 --- a/Content.Client/GameTicking/Managers/ClientGameTicker.cs +++ b/Content.Client/GameTicking/Managers/ClientGameTicker.cs @@ -43,6 +43,8 @@ namespace Content.Client.GameTicking.Managers public override void Initialize() { + base.Initialize(); + SubscribeNetworkEvent(JoinLobby); SubscribeNetworkEvent(JoinGame); SubscribeNetworkEvent(ConnectionStatus); diff --git a/Content.Client/Instruments/UI/InstrumentBoundUserInterface.cs b/Content.Client/Instruments/UI/InstrumentBoundUserInterface.cs index 4816ce8c36..13397e2d9f 100644 --- a/Content.Client/Instruments/UI/InstrumentBoundUserInterface.cs +++ b/Content.Client/Instruments/UI/InstrumentBoundUserInterface.cs @@ -2,7 +2,6 @@ using Content.Shared.ActionBlocker; using Content.Shared.Instruments.UI; using Content.Shared.Interaction; using Robust.Client.Audio.Midi; -using Robust.Client.GameObjects; using Robust.Client.Player; using Robust.Client.UserInterface; @@ -13,7 +12,6 @@ namespace Content.Client.Instruments.UI public IEntityManager Entities => EntMan; [Dependency] public readonly IMidiManager MidiManager = default!; [Dependency] public readonly IFileDialogManager FileDialogManager = default!; - [Dependency] public readonly IPlayerManager PlayerManager = default!; [Dependency] public readonly ILocalizationManager Loc = default!; public readonly InstrumentSystem Instruments; diff --git a/Content.Client/Lobby/LobbyUIController.cs b/Content.Client/Lobby/LobbyUIController.cs index 56dc9d6d41..cea8248e9f 100644 --- a/Content.Client/Lobby/LobbyUIController.cs +++ b/Content.Client/Lobby/LobbyUIController.cs @@ -43,7 +43,6 @@ public sealed class LobbyUIController : UIController, IOnStateEntered { - [Dependency] private readonly IEntityManager _entMan = default!; - public readonly EntityCoordinates BeaconPosition; public Action? OnPressed; public string? Label => BeaconNameLabel.Text; diff --git a/Content.Client/Power/Visualizers/CableVisualizerSystem.cs b/Content.Client/Power/Visualizers/CableVisualizerSystem.cs index aa518d4019..60fb0d127a 100644 --- a/Content.Client/Power/Visualizers/CableVisualizerSystem.cs +++ b/Content.Client/Power/Visualizers/CableVisualizerSystem.cs @@ -4,14 +4,18 @@ using Robust.Client.GameObjects; namespace Content.Client.Power.Visualizers; -public sealed class CableVisualizerSystem : VisualizerSystem +public sealed class CableVisualizerSystem : EntitySystem { + [Dependency] private readonly AppearanceSystem _appearanceSystem = default!; + public override void Initialize() { + base.Initialize(); + SubscribeLocalEvent(OnAppearanceChange, after: new[] { typeof(SubFloorHideSystem) }); } - protected override void OnAppearanceChange(EntityUid uid, CableVisualizerComponent component, ref AppearanceChangeEvent args) + private void OnAppearanceChange(EntityUid uid, CableVisualizerComponent component, ref AppearanceChangeEvent args) { if (args.Sprite == null) return; @@ -23,7 +27,7 @@ public sealed class CableVisualizerSystem : VisualizerSystem(uid, WireVisVisuals.ConnectedMask, out var mask, args.Component)) + if (!_appearanceSystem.TryGetData(uid, WireVisVisuals.ConnectedMask, out var mask, args.Component)) mask = WireVisDirFlags.None; args.Sprite.LayerSetState(0, $"{component.StatePrefix}{(int) mask}"); diff --git a/Content.Client/Shuttles/UI/DockObject.xaml.cs b/Content.Client/Shuttles/UI/DockObject.xaml.cs index d7d565a23e..3aae64ced2 100644 --- a/Content.Client/Shuttles/UI/DockObject.xaml.cs +++ b/Content.Client/Shuttles/UI/DockObject.xaml.cs @@ -1,24 +1,14 @@ -using System.Text; using Content.Shared.Shuttles.BUIStates; -using Content.Shared.Shuttles.Systems; -using JetBrains.Annotations; using Robust.Client.AutoGenerated; using Robust.Client.Graphics; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; -using Robust.Shared.Map; namespace Content.Client.Shuttles.UI; [GenerateTypedNameReferences] public sealed partial class DockObject : PanelContainer { - [PublicAPI] - public event Action? UndockPressed; - - [PublicAPI] - public event Action? ViewPressed; - public BoxContainer ContentsContainer => Contents; public DockObject() diff --git a/Content.Client/Shuttles/UI/DockingScreen.xaml.cs b/Content.Client/Shuttles/UI/DockingScreen.xaml.cs index c0aa794214..97943c6973 100644 --- a/Content.Client/Shuttles/UI/DockingScreen.xaml.cs +++ b/Content.Client/Shuttles/UI/DockingScreen.xaml.cs @@ -163,16 +163,6 @@ public sealed partial class DockingScreen : BoxContainer } dockContainer.AddDock(dock, DockingControl); - - dockContainer.ViewPressed += () => - { - OnDockPress(dock); - }; - - dockContainer.UndockPressed += () => - { - UndockRequest?.Invoke(dock.Entity); - }; } } diff --git a/Content.Client/Sprite/ContentSpriteSystem.cs b/Content.Client/Sprite/ContentSpriteSystem.cs index da0547666b..831978f904 100644 --- a/Content.Client/Sprite/ContentSpriteSystem.cs +++ b/Content.Client/Sprite/ContentSpriteSystem.cs @@ -3,12 +3,12 @@ using System.Numerics; using System.Threading; using System.Threading.Tasks; using Content.Client.Administration.Managers; -using Content.Shared.Database; using Content.Shared.Verbs; using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Shared.ContentPack; +using Robust.Shared.Exceptions; using Robust.Shared.Timing; using Robust.Shared.Utility; using SixLabors.ImageSharp; @@ -24,6 +24,7 @@ public sealed class ContentSpriteSystem : EntitySystem [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IResourceManager _resManager = default!; [Dependency] private readonly IUserInterfaceManager _ui = default!; + [Dependency] private readonly IRuntimeLog _runtimeLog = default!; private ContentSpriteControl _control = new(); @@ -42,12 +43,12 @@ public sealed class ContentSpriteSystem : EntitySystem { base.Shutdown(); - foreach (var queued in _control._queuedTextures) + foreach (var queued in _control.QueuedTextures) { queued.Tcs.SetCanceled(); } - _control._queuedTextures.Clear(); + _control.QueuedTextures.Clear(); _ui.RootControl.RemoveChild(_control); } @@ -103,7 +104,7 @@ public sealed class ContentSpriteSystem : EntitySystem var texture = _clyde.CreateRenderTarget(new Vector2i(size.X, size.Y), new RenderTargetFormatParameters(RenderTargetColorFormat.Rgba8Srgb), name: "export"); var tcs = new TaskCompletionSource(cancelToken); - _control._queuedTextures.Enqueue((texture, direction, entity, includeId, tcs)); + _control.QueuedTextures.Enqueue((texture, direction, entity, includeId, tcs)); await tcs.Task; } @@ -113,13 +114,21 @@ public sealed class ContentSpriteSystem : EntitySystem if (!_adminManager.IsAdmin()) return; + var target = ev.Target; Verb verb = new() { Text = Loc.GetString("export-entity-verb-get-data-text"), Category = VerbCategory.Debug, - Act = () => + Act = async () => { - Export(ev.Target); + try + { + await Export(target); + } + catch (Exception e) + { + _runtimeLog.LogException(e, $"{nameof(ContentSpriteSystem)}.{nameof(Export)}"); + } }, }; @@ -141,7 +150,7 @@ public sealed class ContentSpriteSystem : EntitySystem Direction Direction, EntityUid Entity, bool IncludeId, - TaskCompletionSource Tcs)> _queuedTextures = new(); + TaskCompletionSource Tcs)> QueuedTextures = new(); private ISawmill _sawmill; @@ -155,7 +164,7 @@ public sealed class ContentSpriteSystem : EntitySystem { base.Draw(handle); - while (_queuedTextures.TryDequeue(out var queued)) + while (QueuedTextures.TryDequeue(out var queued)) { if (queued.Tcs.Task.IsCanceled) continue; diff --git a/Content.Client/UserInterface/Controls/FancyTree/FancyTree.xaml.cs b/Content.Client/UserInterface/Controls/FancyTree/FancyTree.xaml.cs index 6cf7622ea4..e231004868 100644 --- a/Content.Client/UserInterface/Controls/FancyTree/FancyTree.xaml.cs +++ b/Content.Client/UserInterface/Controls/FancyTree/FancyTree.xaml.cs @@ -7,7 +7,6 @@ using Robust.Client.ResourceManagement; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; -using Robust.Shared.Graphics; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -96,7 +95,6 @@ public sealed partial class FancyTree : Control private void LoadIcons() { IconColor = TryGetStyleProperty(StylePropertyIconColor, out Color color) ? color : Color.White; - string? path; if (!TryGetStyleProperty(StylePropertyIconExpanded, out IconExpanded)) IconExpanded = _resCache.GetTexture(DefaultIconExpanded); diff --git a/Content.Client/Voting/VotingSystem.cs b/Content.Client/Voting/VotingSystem.cs index dd74e1ccb1..9fea4d153f 100644 --- a/Content.Client/Voting/VotingSystem.cs +++ b/Content.Client/Voting/VotingSystem.cs @@ -1,15 +1,11 @@ -using Content.Client.Ghost; using Content.Shared.Voting; namespace Content.Client.Voting; public sealed class VotingSystem : EntitySystem { - public event Action? VotePlayerListResponse; //Provides a list of players elligble for vote actions - [Dependency] private readonly GhostSystem _ghostSystem = default!; - public override void Initialize() { base.Initialize(); diff --git a/Content.Server/Anomaly/Effects/InnerBodyAnomalySystem.cs b/Content.Server/Anomaly/Effects/InnerBodyAnomalySystem.cs index b75be37638..5380a1aa0a 100644 --- a/Content.Server/Anomaly/Effects/InnerBodyAnomalySystem.cs +++ b/Content.Server/Anomaly/Effects/InnerBodyAnomalySystem.cs @@ -4,7 +4,6 @@ using Content.Server.Chat.Managers; using Content.Server.Jittering; using Content.Server.Mind; using Content.Server.Stunnable; -using Content.Shared.Actions; using Content.Shared.Anomaly; using Content.Shared.Anomaly.Components; using Content.Shared.Anomaly.Effects; @@ -24,8 +23,6 @@ public sealed class InnerBodyAnomalySystem : SharedInnerBodyAnomalySystem { [Dependency] private readonly IAdminLogManager _adminLog = default!; [Dependency] private readonly AnomalySystem _anomaly = default!; - [Dependency] private readonly ActionContainerSystem _actionContainer = default!; - [Dependency] private readonly SharedActionsSystem _actions = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly BodySystem _body = default!; [Dependency] private readonly IChatManager _chat = default!; diff --git a/Content.Server/Atmos/Consoles/AtmosAlertsComputerSystem.cs b/Content.Server/Atmos/Consoles/AtmosAlertsComputerSystem.cs index 2d35ae5973..6e3a11b5f9 100644 --- a/Content.Server/Atmos/Consoles/AtmosAlertsComputerSystem.cs +++ b/Content.Server/Atmos/Consoles/AtmosAlertsComputerSystem.cs @@ -10,10 +10,8 @@ using Content.Shared.Atmos.Monitor; using Content.Shared.Atmos.Monitor.Components; using Content.Shared.DeviceNetwork.Components; using Content.Shared.Pinpointer; -using Content.Shared.Tag; using Robust.Server.GameObjects; using Robust.Shared.Map.Components; -using Robust.Shared.Timing; using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -25,11 +23,9 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem [Dependency] private readonly AirAlarmSystem _airAlarmSystem = default!; [Dependency] private readonly AtmosDeviceNetworkSystem _atmosDevNet = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly TagSystem _tagSystem = default!; [Dependency] private readonly MapSystem _mapSystem = default!; [Dependency] private readonly TransformSystem _transformSystem = default!; [Dependency] private readonly NavMapSystem _navMapSystem = default!; - [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly DeviceListSystem _deviceListSystem = default!; private const float UpdateTime = 1.0f; @@ -54,7 +50,7 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem SubscribeLocalEvent(OnDeviceAnchorChanged); } - #region Event handling + #region Event handling private void OnConsoleInit(EntityUid uid, AtmosAlertsComputerComponent component, ComponentInit args) { diff --git a/Content.Server/Botany/Systems/BotanySystem.Seed.cs b/Content.Server/Botany/Systems/BotanySystem.Seed.cs index 76421daf2e..81645be34f 100644 --- a/Content.Server/Botany/Systems/BotanySystem.Seed.cs +++ b/Content.Server/Botany/Systems/BotanySystem.Seed.cs @@ -10,7 +10,6 @@ using Content.Shared.Random; using Content.Shared.Random.Helpers; using Robust.Server.GameObjects; using Robust.Shared.Map; -using Robust.Shared.Physics.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Random; using System.Diagnostics.CodeAnalysis; @@ -25,10 +24,8 @@ public sealed partial class BotanySystem : EntitySystem [Dependency] private readonly AppearanceSystem _appearance = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly SharedHandsSystem _hands = default!; - [Dependency] private readonly SharedPointLightSystem _light = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; [Dependency] private readonly MetaDataSystem _metaData = default!; - [Dependency] private readonly FixtureSystem _fixtureSystem = default!; [Dependency] private readonly RandomHelperSystem _randomHelper = default!; public override void Initialize() diff --git a/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs b/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs index 8345aa3c3d..d537c2ffdd 100644 --- a/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs +++ b/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs @@ -12,10 +12,7 @@ using Content.Shared.Interaction.Events; using Content.Shared.Mobs.Components; using Content.Shared.Timing; using Content.Shared.Weapons.Melee.Events; -using Content.Server.Interaction; using Content.Server.Body.Components; -using Robust.Shared.GameStates; -using System.Diagnostics.CodeAnalysis; using System.Linq; using Robust.Server.Audio; @@ -24,7 +21,6 @@ namespace Content.Server.Chemistry.EntitySystems; public sealed class HypospraySystem : SharedHypospraySystem { [Dependency] private readonly AudioSystem _audio = default!; - [Dependency] private readonly InteractionSystem _interaction = default!; public override void Initialize() { diff --git a/Content.Server/Chemistry/EntitySystems/SolutionInjectWhileEmbeddedSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionInjectWhileEmbeddedSystem.cs index 2baeba9da1..eb805a9099 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionInjectWhileEmbeddedSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionInjectWhileEmbeddedSystem.cs @@ -1,14 +1,6 @@ -using Content.Server.Body.Components; -using Content.Server.Body.Systems; using Content.Server.Chemistry.Components; -using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.Events; -using Content.Shared.Inventory; -using Content.Shared.Popups; using Content.Shared.Projectiles; -using Content.Shared.Tag; -using Content.Shared.Weapons.Melee.Events; -using Robust.Shared.Collections; using Robust.Shared.Timing; namespace Content.Server.Chemistry.EntitySystems; @@ -19,16 +11,11 @@ namespace Content.Server.Chemistry.EntitySystems; public sealed class SolutionInjectWhileEmbeddedSystem : EntitySystem { [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly BloodstreamSystem _bloodstream = default!; - [Dependency] private readonly InventorySystem _inventory = default!; - [Dependency] private readonly SharedPopupSystem _popup = default!; - [Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!; - [Dependency] private readonly TagSystem _tag = default!; public override void Initialize() { base.Initialize(); - + SubscribeLocalEvent(OnMapInit); } diff --git a/Content.Server/Discord/WebhookMessages/VoteWebhooks.cs b/Content.Server/Discord/WebhookMessages/VoteWebhooks.cs index 74953d10fa..9e147fced2 100644 --- a/Content.Server/Discord/WebhookMessages/VoteWebhooks.cs +++ b/Content.Server/Discord/WebhookMessages/VoteWebhooks.cs @@ -1,9 +1,7 @@ using Content.Server.GameTicking; using Content.Server.Voting; using Robust.Server; -using Robust.Shared.Configuration; using Robust.Shared.Utility; -using System.Diagnostics; using System.Text.Json; using System.Text.Json.Nodes; @@ -11,7 +9,6 @@ namespace Content.Server.Discord.WebhookMessages; public sealed class VoteWebhooks : IPostInjectInit { - [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IEntitySystemManager _entSys = default!; [Dependency] private readonly DiscordWebhook _discord = default!; [Dependency] private readonly IBaseServer _baseServer = default!; diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs index 0962674504..beffbd6d68 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs @@ -3,10 +3,8 @@ using System.Numerics; using Content.Server.Administration.Logs; using Content.Server.Atmos.Components; using Content.Server.Chat.Managers; -using Content.Server.Explosion.Components; using Content.Server.NodeContainer.EntitySystems; using Content.Server.NPC.Pathfinding; -using Content.Shared.Armor; using Content.Shared.Camera; using Content.Shared.CCVar; using Content.Shared.Damage; @@ -18,8 +16,6 @@ using Content.Shared.GameTicking; using Content.Shared.Inventory; using Content.Shared.Projectiles; using Content.Shared.Throwing; -using Content.Shared.Explosion.Components; -using Content.Shared.Explosion.EntitySystems; using Robust.Server.GameStates; using Robust.Server.Player; using Robust.Shared.Audio.Systems; diff --git a/Content.Server/Forensics/Systems/ForensicPadSystem.cs b/Content.Server/Forensics/Systems/ForensicPadSystem.cs index a3f5627cdb..71bbcfb44a 100644 --- a/Content.Server/Forensics/Systems/ForensicPadSystem.cs +++ b/Content.Server/Forensics/Systems/ForensicPadSystem.cs @@ -17,7 +17,6 @@ namespace Content.Server.Forensics [Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!; [Dependency] private readonly InventorySystem _inventory = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; - [Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly LabelSystem _label = default!; public override void Initialize() diff --git a/Content.Server/Ghost/GhostSystem.cs b/Content.Server/Ghost/GhostSystem.cs index 25319557ae..4220f1231e 100644 --- a/Content.Server/Ghost/GhostSystem.cs +++ b/Content.Server/Ghost/GhostSystem.cs @@ -57,7 +57,6 @@ namespace Content.Server.Ghost [Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly MobThresholdSystem _mobThresholdSystem = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly IConfigurationManager _configurationManager = default!; [Dependency] private readonly IChatManager _chatManager = default!; [Dependency] private readonly SharedMindSystem _mind = default!; @@ -503,7 +502,7 @@ namespace Content.Server.Ghost var playerEntity = mind.CurrentEntity; if (playerEntity != null && viaCommand) - _adminLogger.Add(LogType.Mind, $"{EntityManager.ToPrettyString(playerEntity.Value):player} is attempting to ghost via command"); + _adminLog.Add(LogType.Mind, $"{EntityManager.ToPrettyString(playerEntity.Value):player} is attempting to ghost via command"); var handleEv = new GhostAttemptHandleEvent(mind, canReturnGlobal); RaiseLocalEvent(handleEv); @@ -575,7 +574,7 @@ namespace Content.Server.Ghost } if (playerEntity != null) - _adminLogger.Add(LogType.Mind, $"{EntityManager.ToPrettyString(playerEntity.Value):player} ghosted{(!canReturn ? " (non-returnable)" : "")}"); + _adminLog.Add(LogType.Mind, $"{EntityManager.ToPrettyString(playerEntity.Value):player} ghosted{(!canReturn ? " (non-returnable)" : "")}"); var ghost = SpawnGhost((mindId, mind), position, canReturn); diff --git a/Content.Server/NameIdentifier/NameIdentifierSystem.cs b/Content.Server/NameIdentifier/NameIdentifierSystem.cs index 6db6e0ff56..273e9407fd 100644 --- a/Content.Server/NameIdentifier/NameIdentifierSystem.cs +++ b/Content.Server/NameIdentifier/NameIdentifierSystem.cs @@ -14,7 +14,6 @@ public sealed class NameIdentifierSystem : EntitySystem [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IRobustRandom _robustRandom = default!; [Dependency] private readonly MetaDataSystem _metaData = default!; - [Dependency] private readonly ILogManager _logManager = default!; /// /// Free IDs available per . diff --git a/Content.Server/Salvage/SalvageSystem.Magnet.cs b/Content.Server/Salvage/SalvageSystem.Magnet.cs index 81db78fb20..dd61aad274 100644 --- a/Content.Server/Salvage/SalvageSystem.Magnet.cs +++ b/Content.Server/Salvage/SalvageSystem.Magnet.cs @@ -2,19 +2,20 @@ using System.Linq; using System.Numerics; using System.Threading.Tasks; using Content.Server.Salvage.Magnet; -using Content.Shared.Humanoid; using Content.Shared.Mobs.Components; using Content.Shared.Procedural; using Content.Shared.Radio; using Content.Shared.Salvage.Magnet; using Robust.Server.Maps; +using Robust.Shared.Exceptions; using Robust.Shared.Map; -using Robust.Shared.Map.Components; namespace Content.Server.Salvage; public sealed partial class SalvageSystem { + [Dependency] private readonly IRuntimeLog _runtimeLog = default!; + [ValidatePrototypeId] private const string MagnetChannel = "Supply"; @@ -45,7 +46,19 @@ public sealed partial class SalvageSystem return; } - TakeMagnetOffer((station.Value, dataComp), args.Index, (uid, component)); + var index = args.Index; + async void TryTakeMagnetOffer() + { + try + { + await TakeMagnetOffer((station.Value, dataComp), index, (uid, component)); + } + catch (Exception e) + { + _runtimeLog.LogException(e, $"{nameof(SalvageSystem)}.{nameof(TakeMagnetOffer)}"); + } + } + TryTakeMagnetOffer(); } private void OnMagnetStartup(EntityUid uid, SalvageMagnetComponent component, ComponentStartup args) diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs index 3dd4995371..de4b36df26 100644 --- a/Content.Server/Station/Systems/StationSpawningSystem.cs +++ b/Content.Server/Station/Systems/StationSpawningSystem.cs @@ -4,8 +4,6 @@ using Content.Server.Humanoid; using Content.Server.IdentityManagement; using Content.Server.Mind.Commands; using Content.Server.PDA; -using Content.Server.Shuttles.Systems; -using Content.Server.Spawners.EntitySystems; using Content.Server.Station.Components; using Content.Shared.Access.Components; using Content.Shared.Access.Systems; @@ -39,10 +37,8 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem { [Dependency] private readonly SharedAccessSystem _accessSystem = default!; [Dependency] private readonly ActorSystem _actors = default!; - [Dependency] private readonly ArrivalsSystem _arrivalsSystem = default!; [Dependency] private readonly IdCardSystem _cardSystem = default!; [Dependency] private readonly IConfigurationManager _configurationManager = default!; - [Dependency] private readonly ContainerSpawnPointSystem _containerSpawnPointSystem = default!; [Dependency] private readonly HumanoidAppearanceSystem _humanoidSystem = default!; [Dependency] private readonly IdentitySystem _identity = default!; [Dependency] private readonly MetaDataSystem _metaSystem = default!; diff --git a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs index fb99b3cfad..187295a073 100644 --- a/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs +++ b/Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs @@ -1,7 +1,6 @@ using System.Linq; using Content.Server.Administration; using Content.Server.Administration.Managers; -using Content.Server.Database; using Content.Server.Discord.WebhookMessages; using Content.Server.GameTicking; using Content.Server.GameTicking.Presets; @@ -11,7 +10,6 @@ using Content.Server.RoundEnd; using Content.Shared.CCVar; using Content.Shared.Chat; using Content.Shared.Database; -using Content.Shared.Ghost; using Content.Shared.Players; using Content.Shared.Players.PlayTimeTracking; using Content.Shared.Voting; @@ -27,14 +25,13 @@ namespace Content.Server.Voting.Managers [Dependency] private readonly IPlayerLocator _locator = default!; [Dependency] private readonly ILogManager _logManager = default!; [Dependency] private readonly IBanManager _bans = default!; - [Dependency] private readonly IServerDbManager _dbManager = default!; [Dependency] private readonly VoteWebhooks _voteWebhooks = default!; private VotingSystem? _votingSystem; private RoleSystem? _roleSystem; private GameTicker? _gameTicker; - private static readonly Dictionary> _voteTypesToEnableCVars = new() + private static readonly Dictionary> VoteTypesToEnableCVars = new() { {StandardVoteType.Restart, CCVars.VoteRestartEnabled}, {StandardVoteType.Preset, CCVars.VotePresetEnabled}, diff --git a/Content.Server/Voting/Managers/VoteManager.cs b/Content.Server/Voting/Managers/VoteManager.cs index 10b975fdca..94e637638e 100644 --- a/Content.Server/Voting/Managers/VoteManager.cs +++ b/Content.Server/Voting/Managers/VoteManager.cs @@ -65,7 +65,7 @@ namespace Content.Server.Voting.Managers DirtyCanCallVoteAll(); }); - foreach (var kvp in _voteTypesToEnableCVars) + foreach (var kvp in VoteTypesToEnableCVars) { _cfg.OnValueChanged(kvp.Value, _ => { @@ -346,7 +346,7 @@ namespace Content.Server.Voting.Managers if (!_cfg.GetCVar(CCVars.VoteEnabled)) return false; // Specific standard vote types can be disabled with cvars. - if (voteType != null && _voteTypesToEnableCVars.TryGetValue(voteType.Value, out var cvar) && !_cfg.GetCVar(cvar)) + if (voteType != null && VoteTypesToEnableCVars.TryGetValue(voteType.Value, out var cvar) && !_cfg.GetCVar(cvar)) return false; // Cannot start vote if vote is already active (as non-admin). diff --git a/Content.Shared/Doors/Systems/SharedDoorSystem.cs b/Content.Shared/Doors/Systems/SharedDoorSystem.cs index f2dcd443e9..23bea0cdf1 100644 --- a/Content.Shared/Doors/Systems/SharedDoorSystem.cs +++ b/Content.Shared/Doors/Systems/SharedDoorSystem.cs @@ -23,7 +23,6 @@ using Robust.Shared.Timing; using Robust.Shared.Audio.Systems; using Robust.Shared.Network; using Robust.Shared.Map.Components; -using Robust.Shared.Physics; namespace Content.Shared.Doors.Systems; diff --git a/Content.Shared/GameTicking/SharedGameTicker.cs b/Content.Shared/GameTicking/SharedGameTicker.cs index 5126a6bdc4..015889b152 100644 --- a/Content.Shared/GameTicking/SharedGameTicker.cs +++ b/Content.Shared/GameTicking/SharedGameTicker.cs @@ -41,7 +41,10 @@ namespace Content.Shared.GameTicking private void OnRecordingStart(MappingDataNode metadata, List events) { - metadata["roundId"] = new ValueDataNode(RoundId.ToString()); + if (RoundId != 0) + { + metadata["roundId"] = new ValueDataNode(RoundId.ToString()); + } } public TimeSpan RoundDuration() diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 1eb7bd112d..2f09f3e549 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -28,7 +28,6 @@ using Content.Shared.UserInterface; using Content.Shared.Verbs; using Content.Shared.Wall; using JetBrains.Annotations; -using Robust.Shared.Configuration; using Robust.Shared.Containers; using Robust.Shared.Input; using Robust.Shared.Input.Binding; @@ -38,7 +37,6 @@ using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; using Robust.Shared.Player; -using Robust.Shared.Random; using Robust.Shared.Serialization; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -65,12 +63,10 @@ namespace Content.Shared.Interaction [Dependency] private readonly UseDelaySystem _useDelay = default!; [Dependency] private readonly PullingSystem _pullSystem = default!; [Dependency] private readonly InventorySystem _inventory = default!; - [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly TagSystem _tagSystem = default!; [Dependency] private readonly SharedUserInterfaceSystem _ui = default!; [Dependency] private readonly SharedStrippableSystem _strippable = default!; [Dependency] private readonly SharedPlayerRateLimitManager _rateLimit = default!; - [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly ISharedChatManager _chat = default!; private EntityQuery _ignoreUiRangeQuery; diff --git a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs index 829f574ad1..5b0f331234 100644 --- a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs @@ -9,7 +9,6 @@ using Content.Shared.Interaction; using Content.Shared.Item; using Content.Shared.Lock; using Content.Shared.Movement.Events; -using Content.Shared.Placeable; using Content.Shared.Popups; using Content.Shared.Storage.Components; using Content.Shared.Tools.Systems; @@ -34,7 +33,6 @@ public abstract class SharedEntityStorageSystem : EntitySystem [Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly INetManager _net = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!; - [Dependency] private readonly PlaceableSurfaceSystem _placeableSurface = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedContainerSystem _container = default!;