Skip to content

Commit

Permalink
Resolve all non-obsoleting warnings in content (space-wizards#27934)
Browse files Browse the repository at this point in the history
* Resolve all non-obsoleting warnings in content

* Update ClientGameTicker.cs

* Update SkeletonAccentSystem.cs

* Update BwoinkSystem.cs
  • Loading branch information
mirrorcult authored May 12, 2024
1 parent cf14828 commit 1596e04
Show file tree
Hide file tree
Showing 35 changed files with 32 additions and 70 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Content.Shared.Access;
using Content.Shared.Access.Components;
using Content.Shared.Access;
using Content.Shared.Access.Systems;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.CrewManifest;
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Audio/Jukebox/JukeboxBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Content.Client.Audio.Jukebox;

public sealed class JukeboxBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!;

[ViewVariables]
Expand Down
13 changes: 4 additions & 9 deletions Content.Client/RCD/AlignRCDConstruction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public sealed class AlignRCDConstruction : PlacementMode
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
[Dependency] private readonly RCDSystem _rcdSystem = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
private readonly SharedMapSystem _mapSystem;
private readonly RCDSystem _rcdSystem;
private readonly SharedTransformSystem _transformSystem;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IStateManager _stateManager = default!;

Expand All @@ -32,12 +32,7 @@ public sealed class AlignRCDConstruction : PlacementMode
/// </summary>
public AlignRCDConstruction(PlacementManager pMan) : base(pMan)
{
var dependencies = IoCManager.Instance!;
_entityManager = dependencies.Resolve<IEntityManager>();
_mapManager = dependencies.Resolve<IMapManager>();
_playerManager = dependencies.Resolve<IPlayerManager>();
_stateManager = dependencies.Resolve<IStateManager>();

IoCManager.InjectDependencies(this);
_mapSystem = _entityManager.System<SharedMapSystem>();
_rcdSystem = _entityManager.System<RCDSystem>();
_transformSystem = _entityManager.System<SharedTransformSystem>();
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Robotics/UI/RoboticsConsoleWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public sealed partial class RoboticsConsoleWindow : FancyWindow
{
[Dependency] private readonly IEntityManager _entMan = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
private readonly LockSystem _lock;
private readonly SpriteSystem _sprite;

Expand Down
4 changes: 4 additions & 0 deletions Content.Client/Shuttles/UI/DockObject.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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;
Expand All @@ -12,7 +13,10 @@ 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;
Expand Down
10 changes: 5 additions & 5 deletions Content.IntegrationTests/Tests/RoundEndTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public sealed class RoundEndTest
{
private sealed class RoundEndTestSystem : EntitySystem
{
public int Count;
public int RoundCount;

public override void Initialize()
{
Expand All @@ -22,7 +22,7 @@ public override void Initialize()

private void OnRoundEnd(RoundEndSystemChangedEvent ev)
{
Interlocked.Increment(ref Count);
Interlocked.Increment(ref RoundCount);
}
}

Expand All @@ -43,7 +43,7 @@ public async Task Test()
var ticker = sysManager.GetEntitySystem<GameTicker>();
var roundEndSystem = sysManager.GetEntitySystem<RoundEndSystem>();
var sys = server.System<RoundEndTestSystem>();
sys.Count = 0;
sys.RoundCount = 0;

await server.WaitAssertion(() =>
{
Expand Down Expand Up @@ -128,8 +128,8 @@ Task CheckRunLevel(GameRunLevel level)
async Task WaitForEvent()
{
var timeout = Task.Delay(TimeSpan.FromSeconds(10));
var currentCount = Thread.VolatileRead(ref sys.Count);
while (currentCount == Thread.VolatileRead(ref sys.Count) && !timeout.IsCompleted)
var currentCount = Thread.VolatileRead(ref sys.RoundCount);
while (currentCount == Thread.VolatileRead(ref sys.RoundCount) && !timeout.IsCompleted)
{
await pair.RunTicksSync(5);
}
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Access/Systems/AccessOverriderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public sealed class AccessOverriderSystem : SharedAccessOverriderSystem
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;

public override void Initialize()
{
Expand Down
7 changes: 5 additions & 2 deletions Content.Server/Administration/Systems/BwoinkSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
namespace Content.Server.Administration.Systems
{
[UsedImplicitly]
public sealed class BwoinkSystem : SharedBwoinkSystem
public sealed partial class BwoinkSystem : SharedBwoinkSystem
{
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IAdminManager _adminManager = default!;
Expand All @@ -36,6 +36,9 @@ public sealed class BwoinkSystem : SharedBwoinkSystem
[Dependency] private readonly SharedMindSystem _minds = default!;
[Dependency] private readonly IAfkManager _afkManager = default!;

[GeneratedRegex(@"^https://discord\.com/api/webhooks/(\d+)/((?!.*/).*)$")]
private static partial Regex DiscordRegex();

private ISawmill _sawmill = default!;
private readonly HttpClient _httpClient = new();
private string _webhookUrl = string.Empty;
Expand Down Expand Up @@ -157,7 +160,7 @@ private async void OnWebhookChanged(string url)
return;

// Basic sanity check and capturing webhook ID and token
var match = Regex.Match(url, @"^https://discord\.com/api/webhooks/(\d+)/((?!.*/).*)$");
var match = DiscordRegex().Match(url);

if (!match.Success)
{
Expand Down
3 changes: 0 additions & 3 deletions Content.Server/Anomaly/AnomalySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ public sealed partial class AnomalySystem : SharedAnomalySystem
[Dependency] private readonly RadiationSystem _radiation = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly IComponentFactory _componentFactory = default!;
[Dependency] private readonly ISerializationManager _serialization = default!;
[Dependency] private readonly IEntityManager _entity = default!;

public const float MinParticleVariation = 0.8f;
public const float MaxParticleVariation = 1.2f;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Atmos/EntitySystems/AirFilterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace Content.Server.Atmos.EntitySystems;
public sealed class AirFilterSystem : EntitySystem
{
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
[Dependency] private readonly IMapManager _map = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;

public override void Initialize()
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Chemistry/EntitySystems/HypospraySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public sealed class HypospraySystem : SharedHypospraySystem
{
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly InteractionSystem _interaction = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;

public override void Initialize()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ namespace Content.Server.Disposal.Unit.EntitySystems;
public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
{
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
[Dependency] private readonly AppearanceSystem _appearance = default!;
[Dependency] private readonly AtmosphereSystem _atmosSystem = default!;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Geras/GerasSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace Content.Server.Geras;
public sealed class GerasSystem : SharedGerasSystem
{
[Dependency] private readonly PolymorphSystem _polymorphSystem = default!;
[Dependency] private readonly MetaDataSystem _metaDataSystem = default!;
[Dependency] private readonly ActionsSystem _actionsSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;

Expand Down
1 change: 0 additions & 1 deletion Content.Server/Ghost/GhostSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public sealed class GhostSystem : SharedGhostSystem
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly VisibilitySystem _visibilitySystem = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly IMapManager _mapManager = default!;

private EntityQuery<GhostComponent> _ghostQuery;
private EntityQuery<PhysicsComponent> _physicsQuery;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Ghost/Roles/GhostRoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
using Robust.Shared.Utility;
using Content.Server.Popups;
using Content.Shared.Verbs;
using Robust.Shared.Prototypes;
using Robust.Shared.Collections;

namespace Content.Server.Ghost.Roles
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Ghost/Roles/UI/GhostRolesEui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Content.Server.Ghost.Roles.UI
{
public sealed class GhostRolesEui : BaseEui
{
[Dependency] private readonly GhostRoleSystem _ghostRoleSystem;
private readonly GhostRoleSystem _ghostRoleSystem;

public GhostRolesEui()
{
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 @@ -33,7 +33,6 @@ public sealed class HandsSystem : SharedHandsSystem
[Dependency] private readonly StackSystem _stackSystem = default!;
[Dependency] private readonly VirtualItemSystem _virtualItemSystem = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly PullingSystem _pullingSystem = default!;
[Dependency] private readonly ThrowingSystem _throwingSystem = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/IdentityManagement/IdentitySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Content.Server.IdentityManagement;
/// <summary>
/// Responsible for updating the identity of an entity on init or clothing equip/unequip.
/// </summary>
public class IdentitySystem : SharedIdentitySystem
public sealed class IdentitySystem : SharedIdentitySystem
{
[Dependency] private readonly IdCardSystem _idCard = default!;
[Dependency] private readonly IAdminLogManager _adminLog = default!;
Expand Down
7 changes: 0 additions & 7 deletions Content.Server/Kitchen/EntitySystems/SharpSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,17 @@
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.Body.Components;
using Content.Shared.Administration.Logs;
using Content.Shared.Body.Components;
using Content.Shared.Database;
using Content.Shared.Interaction;
using Content.Shared.Nutrition.Components;
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.Popups;
using Content.Shared.Storage;
using Content.Shared.Verbs;
using Content.Shared.Destructible;
using Content.Shared.DoAfter;
using Content.Shared.Interaction;
using Content.Shared.Kitchen;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Nutrition.Components;
using Content.Shared.Popups;
using Content.Shared.Storage;
using Content.Shared.Verbs;
using Robust.Server.Containers;
using Robust.Shared.Random;
using Robust.Shared.Utility;
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Ninja/Systems/NinjaGlovesSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public sealed class NinjaGlovesSystem : SharedNinjaGlovesSystem
[Dependency] private readonly EmagProviderSystem _emagProvider = default!;
[Dependency] private readonly CodeConditionSystem _codeCondition = default!;
[Dependency] private readonly CommsHackerSystem _commsHacker = default!;
[Dependency] private readonly MindSystem _mind = default!;
[Dependency] private readonly SharedStunProviderSystem _stunProvider = default!;
[Dependency] private readonly SpaceNinjaSystem _ninja = default!;

Expand Down
5 changes: 0 additions & 5 deletions Content.Server/Power/Components/ChargerComponent.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using Content.Shared.Power;
using Content.Shared.Whitelist;
using Content.Shared.Power;
using Content.Shared.Whitelist;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;

namespace Content.Server.Power.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public sealed class ServerPreferencesManager : IServerPreferencesManager
[Dependency] private readonly IServerDbManager _db = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IDependencyCollection _dependencies = default!;
[Dependency] private readonly IPrototypeManager _protos = default!;

// Cache player prefs on the server so we don't need as much async hell related to them.
private readonly Dictionary<NetUserId, PlayerPrefData> _cachedPlayerPrefs =
Expand Down
2 changes: 0 additions & 2 deletions Content.Server/Salvage/SpawnSalvageMissionJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Content.Server.Shuttles.Components;
using Content.Shared.Coordinates;
using Content.Shared.Shuttles.Components;

namespace Content.Server.Salvage;

Expand Down
7 changes: 5 additions & 2 deletions Content.Server/Speech/EntitySystems/SkeletonAccentSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

namespace Content.Server.Speech.EntitySystems;

public sealed class SkeletonAccentSystem : EntitySystem
public sealed partial class SkeletonAccentSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;

[GeneratedRegex(@"(?<!\w)[^aeiou]one", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex BoneRegex();

private static readonly Dictionary<string, string> DirectReplacements = new()
{
{ "fuck you", "I've got a BONE to pick with you" },
Expand Down Expand Up @@ -45,7 +48,7 @@ public string Accentuate(string message, SkeletonAccentComponent component)

// Character manipulations:
// At the start of words, any non-vowel + "one" becomes "bone", e.g. tone -> bone ; lonely -> bonely; clone -> clone (remains unchanged).
msg = Regex.Replace(msg, @"(?<!\w)[^aeiou]one", "bone", RegexOptions.IgnoreCase);
msg = BoneRegex().Replace(msg, "bone");

// Direct word/phrase replacements:
foreach (var (first, replace) in DirectReplacements)
Expand Down
6 changes: 0 additions & 6 deletions Content.Server/Station/Systems/StationSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,16 @@ namespace Content.Server.Station.Systems;
[PublicAPI]
public sealed class StationSystem : EntitySystem
{
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ChatSystem _chatSystem = default!;
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly MapSystem _map = default!;

private ISawmill _sawmill = default!;

private bool _randomStationOffset;
private bool _randomStationRotation;
private float _maxRandomStationOffset;

/// <inheritdoc/>
public override void Initialize()
{
Expand Down
1 change: 0 additions & 1 deletion Content.Server/Traitor/Uplink/Commands/AddUplinkCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace Content.Server.Traitor.Uplink.Commands
[AdminCommand(AdminFlags.Admin)]
public sealed class AddUplinkCommand : IConsoleCommand
{
[Dependency] private readonly IConfigurationManager _cfgManager = default!;
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Wires/WiresSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public override void Update(float frameTime)
}
}

private class ActiveWireAction
private sealed class ActiveWireAction
{
/// <summary>
/// The wire action's ID. This is so that once the action is finished,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace Content.Server.Xenoarchaeology.Equipment.Systems;
public sealed class TraversalDistorterSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly PopupSystem _popup = default!;

/// <inheritdoc/>
public override void Initialize()
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Zombies/InitialInfectedExemptComponent.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Content.Server.Zombies;

[RegisterComponent]
public partial class InitialInfectedExemptComponent : Component
public sealed partial class InitialInfectedExemptComponent : Component
{

}
2 changes: 0 additions & 2 deletions Content.Shared/Access/Components/IdCardConsoleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.Prototypes;

namespace Content.Shared.Access.Components;

Expand Down
Loading

0 comments on commit 1596e04

Please sign in to comment.