Skip to content

Commit

Permalink
Fixing warnings (#8131)
Browse files Browse the repository at this point in the history
  • Loading branch information
wrexbe authored May 13, 2022
1 parent 16ad873 commit 61d147a
Show file tree
Hide file tree
Showing 32 changed files with 22 additions and 84 deletions.
13 changes: 3 additions & 10 deletions Content.Server/AI/Utility/AiLogic/UtilityAI.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Runtime.ExceptionServices;
using System.Threading;
using Content.Server.AI.Components;
using Content.Server.AI.EntitySystems;
using Content.Server.AI.LoadBalancer;
Expand All @@ -11,20 +7,17 @@
using Content.Server.AI.WorldState.States.Utility;
using Content.Server.CPUJob.JobQueues;
using Content.Shared.Movement.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
using System.Runtime.ExceptionServices;
using System.Threading;

namespace Content.Server.AI.Utility.AiLogic
{
// TODO: Need to split out the IMover stuff for NPC to a generic one that can be used for hoomans as well.
[RegisterComponent]
[ComponentProtoName("UtilityAI")]
[ComponentReference(typeof(AiControllerComponent)), ComponentReference(typeof(IMoverComponent))]
public sealed class UtilityAi : AiControllerComponent, ISerializationHooks
public sealed class UtilityAi : AiControllerComponent
{
// TODO: Look at having ParallelOperators (probably no more than that as then you'd have a full-blown BT)
// Also RepeatOperators (e.g. if we're following an entity keep repeating MoveToEntity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Server.Clothing.Components;
using Content.Server.Storage.Components;
using JetBrains.Annotations;
using Robust.Server.Containers;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
Expand All @@ -24,10 +25,10 @@ protected override List<EntityUid> GetTrueValue()
{
return result;
}

var containerSystem = IoCManager.Resolve<ContainerSystem>();
foreach (var entity in Visibility.GetNearestEntities(entMan.GetComponent<TransformComponent>(Owner).Coordinates, typeof(ClothingComponent), controller.VisionRadius))
{
if (entity.TryGetContainer(out var container))
if (containerSystem.TryGetContainingContainer(entity, out var container))
{
if (!entMan.HasComponent<EntityStorageComponent>(container.Owner))
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Abilities/Mime/MimePowersSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class MimePowersSystem : EntitySystem
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;

public override void Initialize()
{
base.Initialize();
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Access/AccessWireAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Content.Server.Access;

[DataDefinition]
public class AccessWireAction : BaseWireAction
public sealed class AccessWireAction : BaseWireAction
{
[DataField("color")]
private Color _statusColor = Color.Green;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
using Content.Shared.Administration;
using Robust.Shared.Console;
Expand All @@ -8,8 +7,6 @@ namespace Content.Server.Administration.Commands.Station;
[AdminCommand(AdminFlags.Admin)]
public sealed class ListStationJobsCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entityManager = default!;

public string Command => "lsstationjobs";

public string Description => "Lists all jobs on the given station.";
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Atmos/EntitySystems/GasAnalyzableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace Content.Server.Atmos.EntitySystems
[UsedImplicitly]
public sealed class GasAnalyzableSystem : EntitySystem
{
[Dependency] private readonly ToolSystem _toolSystem = default!;
[Dependency] private readonly ExamineSystemShared _examineSystem = default!;

public override void Initialize()
Expand Down
12 changes: 0 additions & 12 deletions Content.Server/Atmos/Monitor/Components/AirAlarmComponent.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
using System;
using System.Threading;
using System.Collections.Generic;
using Content.Server.Atmos.Monitor.Systems;
using Content.Shared.Atmos.Monitor.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Network;
using Robust.Shared.ViewVariables;

namespace Content.Server.Atmos.Monitor.Components
{
[RegisterComponent]
public sealed class AirAlarmComponent : Component
{
[Dependency] private readonly IEntityManager _entMan = default!;

private AirAlarmSystem? _airAlarmSystem;

[ViewVariables] public AirAlarmMode CurrentMode { get; set; } = AirAlarmMode.Filtering;

// Remember to null this afterwards.
Expand Down
4 changes: 1 addition & 3 deletions Content.Server/Body/Components/BodyScannerComponent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Server.UserInterface;
using Content.Server.UserInterface;
using Content.Shared.Body.Components;
using Robust.Server.GameObjects;

Expand All @@ -8,8 +8,6 @@ namespace Content.Server.Body.Components
[ComponentReference(typeof(SharedBodyScannerComponent))]
public sealed class BodyScannerComponent : SharedBodyScannerComponent
{
[Dependency] private readonly IEntityManager _entMan = default!;

[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(BodyScannerUiKey.Key);
protected override void Initialize()
{
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Botany/Systems/PlantHolderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ namespace Content.Server.Botany.Systems
public sealed class PlantHolderSystem : EntitySystem
{
[Dependency] private readonly BotanySystem _botanySystem = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Content.Server.Chemistry.ReactionEffects
{
[DataDefinition]
public class ExplosionReactionEffect : ReagentEffect
public sealed class ExplosionReactionEffect : ReagentEffect
{
/// <summary>
/// The type of explosion. Determines damage types and tile break chance scaling.
Expand Down
5 changes: 3 additions & 2 deletions Content.Server/Cuffs/Components/CuffableComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
Expand All @@ -23,6 +24,7 @@ public sealed class CuffableComponent : SharedCuffableComponent
{
[Dependency] private readonly IEntityManager _entMan = default!;
[Dependency] private readonly IEntitySystemManager _sysMan = default!;
[Dependency] private readonly IComponentFactory _componentFactory = default!;

/// <summary>
/// How many of this entity's hands are currently cuffed.
Expand All @@ -45,8 +47,7 @@ public sealed class CuffableComponent : SharedCuffableComponent
protected override void Initialize()
{
base.Initialize();

Container = ContainerHelpers.EnsureContainer<Container>(Owner, Name);
Container = _sysMan.GetEntitySystem<ContainerSystem>().EnsureContainer<Container>(Owner, _componentFactory.GetComponentName(GetType()));
Owner.EnsureComponentWarn<HandsComponent>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Content.Server.Doors;

[DataDefinition]
public class DoorBoltLightWireAction : BaseWireAction
public sealed class DoorBoltLightWireAction : BaseWireAction
{
[DataField("color")]
private Color _statusColor = Color.Lime;
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Doors/WireActions/DoorBoltWireAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Content.Server.Doors;

[DataDefinition]
public class DoorBoltWireAction : BaseWireAction
public sealed class DoorBoltWireAction : BaseWireAction
{
[DataField("color")]
private Color _statusColor = Color.Red;
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Doors/WireActions/DoorSafetyWireAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Content.Server.Doors;

[DataDefinition]
public class DoorSafetyWireAction : BaseWireAction
public sealed class DoorSafetyWireAction : BaseWireAction
{
[DataField("color")]
private Color _statusColor = Color.Red;
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Doors/WireActions/DoorTimingWireAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Content.Server.Doors;

[DataDefinition]
public class DoorTimingWireAction : BaseWireAction
public sealed class DoorTimingWireAction : BaseWireAction
{
[DataField("color")]
private Color _statusColor = Color.Orange;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public sealed partial class ExplosionSystem : EntitySystem
[Dependency] private readonly IPlayerManager _playerManager = default!;

[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly ContainerSystem _containerSystem = default!;
[Dependency] private readonly NodeGroupSystem _nodeGroupSystem = default!;
[Dependency] private readonly CameraRecoilSystem _recoilSystem = default!;
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
Expand Down
10 changes: 1 addition & 9 deletions Content.Server/GameTicking/GameTicker.LobbyBackground.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
using System.IO;
using System.Linq;
using Content.Server.GameTicking.Prototypes;
using Content.Shared.Audio;
using Robust.Shared.ContentPack;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;

using System.Linq;

namespace Content.Server.GameTicking;

public sealed partial class GameTicker
{
[Dependency] private readonly IResourceManager _resourceManager = default!;

[ViewVariables]
public string? LobbyBackground { get; private set; }

Expand All @@ -32,7 +25,6 @@ private void InitializeLobbyBackground()
RandomizeLobbyBackground();
}


private void RandomizeLobbyBackground() {
LobbyBackground = _lobbyBackgrounds!.Any() ? _robustRandom.Pick(_lobbyBackgrounds!).ToString() : null;
}
Expand Down
3 changes: 0 additions & 3 deletions Content.Server/GameTicking/GameTicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public override void Update(float frameTime)
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IServerNetManager _netManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly IServerPreferencesManager _prefsManager = default!;
Expand All @@ -116,8 +115,6 @@ public override void Update(float frameTime)
[Dependency] private readonly StationSpawningSystem _stationSpawning = default!;
[Dependency] private readonly StationJobsSystem _stationJobs = default!;
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
[Dependency] private readonly HumanoidAppearanceSystem _humanoidAppearanceSystem = default!;
[Dependency] private readonly PDASystem _pdaSystem = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly GhostSystem _ghosts = default!;
[Dependency] private readonly RoleBanManager _roleBanManager = default!;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Hands/Systems/HandsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ internal sealed class HandsSystem : SharedHandsSystem
[Dependency] private readonly StackSystem _stackSystem = default!;
[Dependency] private readonly HandVirtualItemSystem _virtualItemSystem = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
[Dependency] private readonly AdminLogSystem _logSystem = default!;
[Dependency] private readonly StrippableSystem _strippableSystem = default!;
[Dependency] private readonly SharedHandVirtualItemSystem _virtualSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
Expand Down
7 changes: 0 additions & 7 deletions Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
using System.Collections.Generic;
using System.Linq;
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Hands.Components;
using Content.Server.Kitchen.Components;
using Content.Server.Kitchen.Events;
using Content.Server.Power.Components;
using Content.Server.Stack;
using Content.Server.UserInterface;
using Content.Shared.Chemistry.Components;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Item;
using Content.Shared.Kitchen.Components;
using Content.Shared.Popups;
using Content.Shared.Random.Helpers;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
Expand All @@ -28,7 +22,6 @@ namespace Content.Server.Kitchen.EntitySystems
internal sealed class ReagentGrinderSystem : EntitySystem
{
[Dependency] private readonly SolutionContainerSystem _solutionsSystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!;

private Queue<ReagentGrinderComponent> _uiUpdateQueue = new();
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Payload/EntitySystems/PayloadSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public sealed class PayloadSystem : EntitySystem
{
[Dependency] private readonly TagSystem _tagSystem = default!;
[Dependency] private readonly SolutionContainerSystem _solutionSystem = default!;
[Dependency] private readonly SharedChemicalReactionSystem _chemistrySystem = default!;
[Dependency] private readonly AdminLogSystem _logSystem = default!;
[Dependency] private readonly IComponentFactory _componentFactory = default!;
[Dependency] private readonly ISerializationManager _serializationManager = default!;
Expand Down
2 changes: 0 additions & 2 deletions Content.Server/Remotes/DoorRemoteComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ namespace Content.Server.Remotes
[Friend(typeof(DoorRemoteSystem))]
public sealed class DoorRemoteComponent : Component
{
public override string Name => "DoorRemote";

public OperatingMode Mode = OperatingMode.OpenClose;

public enum OperatingMode : byte
Expand Down
4 changes: 1 addition & 3 deletions Content.Server/Station/Systems/StationSpawningSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Server.Access.Systems;
using Content.Server.Access.Systems;
using Content.Server.CharacterAppearance.Systems;
using Content.Server.Hands.Components;
using Content.Server.Hands.Systems;
Expand Down Expand Up @@ -26,9 +26,7 @@ namespace Content.Server.Station.Systems;
[PublicAPI]
public sealed class StationSpawningSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly HandsSystem _handsSystem = default!;
[Dependency] private readonly HumanoidAppearanceSystem _humanoidAppearanceSystem = default!;
[Dependency] private readonly IdCardSystem _cardSystem = default!;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Station/Systems/StationSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public sealed class StationSystem : EntitySystem
{
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
[Dependency] private readonly IGameMapManager _gameMapManager = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/StationEvents/Events/RadiationStorm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public sealed class RadiationStorm : StationEvent
// Based on Goonstation style radiation storm with some TG elements (announcer, etc.)

[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;

private StationSystem _stationSystem = default!;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Storage/EntitySystems/DumpableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public sealed class DumpableSystem : EntitySystem
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly DisposalUnitSystem _disposalUnitSystem = default!;

[Dependency] private readonly HandsSystem _handsSystem = default!;
public override void Initialize()
{
base.Initialize();
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Storage/EntitySystems/StorageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public sealed partial class StorageSystem : EntitySystem
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ContainerSystem _containerSystem = default!;
[Dependency] private readonly DisposalUnitSystem _disposalSystem = default!;
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly EntityLookupSystem _entityLookupSystem = default!;
[Dependency] private readonly InteractionSystem _interactionSystem = default!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ namespace Content.Server.Weapons.Melee.ZombieTransfer
public sealed class ZombieTransferSystem : EntitySystem
{
[Dependency] private readonly DiseaseSystem _disease = default!;
[Dependency] private readonly BodySystem _body = default!;
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
public override void Initialize()
Expand Down
2 changes: 0 additions & 2 deletions Content.Server/Wires/WiresSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ namespace Content.Server.Wires;
public sealed class WiresSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly AudioSystem _audioSystem = default!;
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
[Dependency] private readonly ToolSystem _toolSystem = default!;
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] private readonly HandsSystem _handsSystem = default!;
[Dependency] private readonly DoAfterSystem _doAfter = default!;

private IRobustRandom _random = new RobustRandom();
Expand Down
Loading

0 comments on commit 61d147a

Please sign in to comment.