Fixing warnings (#8131)

This commit is contained in:
wrexbe
2022-05-12 22:35:13 -07:00
committed by GitHub
parent 16ad873688
commit 61d147aea9
32 changed files with 22 additions and 84 deletions

View File

@@ -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;
@@ -11,12 +7,9 @@ using Content.Server.AI.WorldState;
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
{
@@ -24,7 +17,7 @@ namespace Content.Server.AI.Utility.AiLogic
[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)

View File

@@ -4,6 +4,7 @@ using Content.Server.AI.Utils;
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;
@@ -24,10 +25,10 @@ namespace Content.Server.AI.WorldState.States.Clothing
{
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))
{

View File

@@ -18,7 +18,7 @@ namespace Content.Server.Abilities.Mime
[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();

View File

@@ -6,7 +6,7 @@ using Content.Shared.Wires;
namespace Content.Server.Access;
[DataDefinition]
public class AccessWireAction : BaseWireAction
public sealed class AccessWireAction : BaseWireAction
{
[DataField("color")]
private Color _statusColor = Color.Green;

View File

@@ -1,4 +1,3 @@
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
using Content.Shared.Administration;
using Robust.Shared.Console;
@@ -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.";

View File

@@ -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()

View File

@@ -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.

View File

@@ -1,4 +1,4 @@
using Content.Server.UserInterface;
using Content.Server.UserInterface;
using Content.Shared.Body.Components;
using Robust.Server.GameObjects;
@@ -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()
{

View File

@@ -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!;

View File

@@ -8,7 +8,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
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.

View File

@@ -7,6 +7,7 @@ using Content.Shared.Cuffs.Components;
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;
@@ -23,6 +24,7 @@ namespace Content.Server.Cuffs.Components
{
[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.
@@ -45,8 +47,7 @@ namespace Content.Server.Cuffs.Components
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>();
}

View File

@@ -7,7 +7,7 @@ using Content.Shared.Wires;
namespace Content.Server.Doors;
[DataDefinition]
public class DoorBoltLightWireAction : BaseWireAction
public sealed class DoorBoltLightWireAction : BaseWireAction
{
[DataField("color")]
private Color _statusColor = Color.Lime;

View File

@@ -6,7 +6,7 @@ using Content.Shared.Wires;
namespace Content.Server.Doors;
[DataDefinition]
public class DoorBoltWireAction : BaseWireAction
public sealed class DoorBoltWireAction : BaseWireAction
{
[DataField("color")]
private Color _statusColor = Color.Red;

View File

@@ -6,7 +6,7 @@ using Content.Shared.Wires;
namespace Content.Server.Doors;
[DataDefinition]
public class DoorSafetyWireAction : BaseWireAction
public sealed class DoorSafetyWireAction : BaseWireAction
{
[DataField("color")]
private Color _statusColor = Color.Red;

View File

@@ -6,7 +6,7 @@ using Content.Shared.Wires;
namespace Content.Server.Doors;
[DataDefinition]
public class DoorTimingWireAction : BaseWireAction
public sealed class DoorTimingWireAction : BaseWireAction
{
[DataField("color")]
private Color _statusColor = Color.Orange;

View File

@@ -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!;

View File

@@ -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; }
@@ -32,7 +25,6 @@ public sealed partial class GameTicker
RandomizeLobbyBackground();
}
private void RandomizeLobbyBackground() {
LobbyBackground = _lobbyBackgrounds!.Any() ? _robustRandom.Pick(_lobbyBackgrounds!).ToString() : null;
}

View File

@@ -99,7 +99,6 @@ namespace Content.Server.GameTicking
[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!;
@@ -116,8 +115,6 @@ namespace Content.Server.GameTicking
[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!;

View File

@@ -41,7 +41,6 @@ namespace Content.Server.Hands.Systems
[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!;

View File

@@ -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;
@@ -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();

View File

@@ -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!;

View File

@@ -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

View File

@@ -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;
@@ -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!;

View File

@@ -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!;

View File

@@ -16,7 +16,6 @@ namespace Content.Server.StationEvents.Events
// 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!;

View File

@@ -17,7 +17,6 @@ namespace Content.Server.Storage.EntitySystems
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly DisposalUnitSystem _disposalUnitSystem = default!;
[Dependency] private readonly HandsSystem _handsSystem = default!;
public override void Initialize()
{
base.Initialize();

View File

@@ -38,7 +38,6 @@ namespace Content.Server.Storage.EntitySystems
[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!;

View File

@@ -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()

View File

@@ -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();

View File

@@ -1,4 +1,4 @@
using Content.Shared.Atmos;
using Content.Shared.Atmos;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
@@ -8,8 +8,6 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
[RegisterComponent]
public sealed class GasArtifactComponent : Component
{
public override string Name => "GasArtifact";
/// <summary>
/// Gas that will be spawned when artifact activated.
/// If null it will be picked on startup from <see cref="PossibleGases"/>.

View File

@@ -1,4 +1,4 @@
using Content.Server.Radiation;
using Content.Server.Radiation;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
@@ -10,8 +10,6 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
[RegisterComponent]
public sealed class RadiateArtifactComponent : Component
{
public override string Name => "RadiateArtifact";
/// <summary>
/// Radiation pulse prototype to spawn.
/// Should has <see cref="RadiationPulseComponent"/>.

View File

@@ -1,4 +1,4 @@
using Content.Shared.Atmos;
using Content.Shared.Atmos;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
@@ -8,8 +8,6 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
[RegisterComponent]
public sealed class TemperatureArtifactComponent : Component
{
public override string Name => "TemperatureArtifact";
[DataField("targetTemp")]
public float TargetTemperature = Atmospherics.T0C;