]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Use new ComponentPauseGenerator (#25183)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Mon, 26 Feb 2024 03:36:19 +0000 (04:36 +0100)
committerGitHub <noreply@github.com>
Mon, 26 Feb 2024 03:36:19 +0000 (14:36 +1100)
Also includes some (non critical) changes to the solution file to re-organize the Roslyn components.

130 files changed:
Content.Server/Anomaly/AnomalySystem.Generator.cs
Content.Server/Anomaly/AnomalySystem.Vessel.cs
Content.Server/Anomaly/Components/AnomalyGeneratorComponent.cs
Content.Server/Anomaly/Components/AnomalyVesselComponent.cs
Content.Server/Anomaly/Components/GeneratingAnomalyGeneratorComponent.cs
Content.Server/Atmos/Rotting/RottingSystem.cs
Content.Server/Charges/Components/AutoRechargeComponent.cs
Content.Server/Charges/Systems/ChargesSystem.cs
Content.Server/Chat/EmoteOnDamageComponent.cs
Content.Server/Chat/Systems/EmoteOnDamageSystem.cs
Content.Server/Chemistry/Components/SolutionPurgeComponent.cs
Content.Server/Chemistry/Components/SolutionRegenerationComponent.cs
Content.Server/Chemistry/EntitySystems/SolutionPurgeSystem.cs
Content.Server/Chemistry/EntitySystems/SolutionRegenerationSystem.cs
Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs
Content.Server/Emp/EmpSystem.cs
Content.Server/Explosion/Components/OnTrigger/TwoStageTriggerComponent.cs
Content.Server/Explosion/Components/TriggerOnProximityComponent.cs
Content.Server/Explosion/EntitySystems/TriggerSystem.Proximity.cs
Content.Server/Explosion/EntitySystems/TwoStageTriggerSystem.cs
Content.Server/Fluids/EntitySystems/SmokeSystem.cs
Content.Server/Gateway/Components/GatewayComponent.cs
Content.Server/Gateway/Components/GatewayGeneratorComponent.cs
Content.Server/Gateway/Systems/GatewayGeneratorSystem.cs
Content.Server/Gateway/Systems/GatewaySystem.cs
Content.Server/Hands/Systems/HandsSystem.cs
Content.Server/Kitchen/Components/ActiveMicrowaveComponent.cs
Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs
Content.Server/Medical/Components/HealthAnalyzerComponent.cs
Content.Server/Medical/DefibrillatorSystem.cs
Content.Server/Medical/HealthAnalyzerSystem.cs
Content.Server/Medical/SuitSensors/SuitSensorComponent.cs
Content.Server/Medical/SuitSensors/SuitSensorSystem.cs
Content.Server/NPC/Components/NPCJukeComponent.cs
Content.Server/NPC/Components/NPCSteeringComponent.cs
Content.Server/NPC/Pathfinding/GridPathfindingComponent.cs
Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs
Content.Server/NPC/Systems/NPCJukeSystem.cs
Content.Server/NPC/Systems/NPCSteeringSystem.cs
Content.Server/Nutrition/Components/FatExtractorComponent.cs
Content.Server/Nutrition/EntitySystems/AnimalHusbandrySystem.cs
Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs
Content.Server/Physics/Components/ChasingWalkComponent.cs
Content.Server/Physics/Controllers/ChasingWalkSystem.cs
Content.Server/PowerCell/PowerCellSystem.Draw.cs
Content.Server/PowerCell/PowerCellSystem.cs
Content.Server/PowerSink/PowerSinkComponent.cs
Content.Server/PowerSink/PowerSinkSystem.cs
Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs
Content.Server/Salvage/SalvageSystem.Expeditions.cs
Content.Server/Shuttles/Components/ArrivalsShuttleComponent.cs
Content.Server/Shuttles/Components/EscapePodComponent.cs
Content.Server/Shuttles/Systems/ArrivalsSystem.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs
Content.Server/Spreader/GrowingKudzuComponent.cs
Content.Server/Spreader/KudzuSystem.cs
Content.Server/StationEvents/Components/StationEventComponent.cs
Content.Server/StationEvents/EventManagerSystem.cs
Content.Server/Tesla/Components/LightningArcShooterComponent.cs
Content.Server/Tesla/Components/LightningSparkingComponent.cs
Content.Server/Tesla/EntitySystem/LightningArcShooterSystem.cs
Content.Server/Tesla/EntitySystem/LightningSparkingSystem.cs
Content.Shared/Anomaly/Components/AnomalyComponent.cs
Content.Shared/Anomaly/Components/AnomalyPulsingComponent.cs
Content.Shared/Anomaly/Components/AnomalySupercriticalComponent.cs
Content.Shared/Anomaly/SharedAnomalySystem.cs
Content.Shared/Atmos/Rotting/PerishableComponent.cs
Content.Shared/Atmos/Rotting/RottingComponent.cs
Content.Shared/Bed/Cryostorage/CryostorageContainedComponent.cs
Content.Shared/Bed/Cryostorage/SharedCryostorageSystem.cs
Content.Shared/Bed/Sleep/SharedSleepingSystem.cs
Content.Shared/Bed/Sleep/SleepingComponent.cs
Content.Shared/Chasm/ChasmFallingComponent.cs
Content.Shared/Chasm/ChasmSystem.cs
Content.Shared/Chemistry/Components/SmokeAffectedComponent.cs
Content.Shared/Climbing/Components/ClimbingComponent.cs
Content.Shared/Climbing/Systems/ClimbSystem.cs
Content.Shared/CombatMode/Pacification/PacificationSystem.cs
Content.Shared/CombatMode/Pacification/PacifiedComponent.cs
Content.Shared/Construction/Components/FlatpackCreatorComponent.cs
Content.Shared/Construction/SharedFlatpackSystem.cs
Content.Shared/Damage/Components/DamageOnHoldingComponent.cs
Content.Shared/Damage/Components/StaminaComponent.cs
Content.Shared/Damage/Systems/DamageOnHoldingSystem.cs
Content.Shared/Damage/Systems/StaminaSystem.cs
Content.Shared/Emp/EmpDisabledComponent.cs
Content.Shared/Gravity/GravityShakeComponent.cs
Content.Shared/Gravity/SharedGravitySystem.Shake.cs
Content.Shared/Gravity/SharedGravitySystem.cs
Content.Shared/Hands/Components/HandsComponent.cs
Content.Shared/Materials/ActiveMaterialReclaimerComponent.cs
Content.Shared/Materials/InsertingMaterialStorageComponent.cs
Content.Shared/Materials/MaterialReclaimerComponent.cs
Content.Shared/Materials/SharedMaterialReclaimerSystem.cs
Content.Shared/Materials/SharedMaterialStorageSystem.cs
Content.Shared/Medical/DefibrillatorComponent.cs
Content.Shared/Ninja/Components/NinjaSuitComponent.cs
Content.Shared/Ninja/Systems/SharedNinjaSuitSystem.cs
Content.Shared/Nutrition/AnimalHusbandry/InfantComponent.cs
Content.Shared/Nutrition/AnimalHusbandry/ReproductiveComponent.cs
Content.Shared/Nutrition/Components/HungerComponent.cs
Content.Shared/Nutrition/Components/ThirstComponent.cs
Content.Shared/Nutrition/EntitySystems/HungerSystem.cs
Content.Shared/Nutrition/EntitySystems/ThirstSystem.cs
Content.Shared/PowerCell/PowerCellDrawComponent.cs
Content.Shared/Salvage/Expeditions/SalvageExpeditions.cs
Content.Shared/Salvage/Fulton/FultonedComponent.cs
Content.Shared/Salvage/Fulton/SharedFultonSystem.cs
Content.Shared/Singularity/Components/EventHorizonComponent.cs
Content.Shared/Sound/Components/EmitSoundOnCollideComponent.cs
Content.Shared/Sound/SharedEmitSoundSystem.cs
Content.Shared/Storage/Components/MagnetPickupComponent.cs
Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs
Content.Shared/Teleportation/Components/SwapTeleporterComponent.cs
Content.Shared/Teleportation/Systems/SwapTeleporterSystem.cs
Content.Shared/Throwing/ThrownItemComponent.cs
Content.Shared/Throwing/ThrownItemSystem.cs
Content.Shared/Timing/UseDelayComponent.cs
Content.Shared/Timing/UseDelaySystem.cs
Content.Shared/Weapons/Marker/DamageMarkerComponent.cs
Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs
Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs
Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs
Content.Shared/Weapons/Ranged/Components/GunComponent.cs
Content.Shared/Weapons/Ranged/Components/RechargeBasicEntityAmmoComponent.cs
Content.Shared/Weapons/Ranged/Systems/RechargeBasicEntityAmmoSystem.cs
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs
SpaceStation14.sln

index d07740e2f66aedfa6a5088a7897b44381b3aaacf..2053a7bbbe6aba5101ff34a6156923ae8ffe01e5 100644 (file)
@@ -33,9 +33,7 @@ public sealed partial class AnomalySystem
         SubscribeLocalEvent<AnomalyGeneratorComponent, MaterialAmountChangedEvent>(OnGeneratorMaterialAmountChanged);
         SubscribeLocalEvent<AnomalyGeneratorComponent, AnomalyGeneratorGenerateButtonPressedEvent>(OnGenerateButtonPressed);
         SubscribeLocalEvent<AnomalyGeneratorComponent, PowerChangedEvent>(OnGeneratorPowerChanged);
-        SubscribeLocalEvent<AnomalyGeneratorComponent, EntityUnpausedEvent>(OnGeneratorUnpaused);
         SubscribeLocalEvent<GeneratingAnomalyGeneratorComponent, ComponentStartup>(OnGeneratingStartup);
-        SubscribeLocalEvent<GeneratingAnomalyGeneratorComponent, EntityUnpausedEvent>(OnGeneratingUnpaused);
     }
 
     private void OnGeneratorPowerChanged(EntityUid uid, AnomalyGeneratorComponent component, ref PowerChangedEvent args)
@@ -58,11 +56,6 @@ public sealed partial class AnomalySystem
         TryGeneratorCreateAnomaly(uid, component);
     }
 
-    private void OnGeneratorUnpaused(EntityUid uid, AnomalyGeneratorComponent component, ref EntityUnpausedEvent args)
-    {
-        component.CooldownEndTime += args.PausedTime;
-    }
-
     public void UpdateGeneratorUi(EntityUid uid, AnomalyGeneratorComponent component)
     {
         var materialAmount = _material.GetMaterialAmount(uid, component.RequiredMaterial);
@@ -169,11 +162,6 @@ public sealed partial class AnomalySystem
         Appearance.SetData(uid, AnomalyGeneratorVisuals.Generating, true);
     }
 
-    private void OnGeneratingUnpaused(EntityUid uid, GeneratingAnomalyGeneratorComponent component, ref EntityUnpausedEvent args)
-    {
-        component.EndTime += args.PausedTime;
-    }
-
     private void OnGeneratingFinished(EntityUid uid, AnomalyGeneratorComponent component)
     {
         var xform = Transform(uid);
index 7c7feacb8792e5cc7b4d187fc9afc9ca81983a32..98e56a884453d98dfa0138f65593dd47baff62ed 100644 (file)
@@ -22,7 +22,6 @@ public sealed partial class AnomalySystem
         SubscribeLocalEvent<AnomalyVesselComponent, InteractUsingEvent>(OnVesselInteractUsing);
         SubscribeLocalEvent<AnomalyVesselComponent, ExaminedEvent>(OnExamined);
         SubscribeLocalEvent<AnomalyVesselComponent, ResearchServerGetPointsPerSecondEvent>(OnVesselGetPointsPerSecond);
-        SubscribeLocalEvent<AnomalyVesselComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<AnomalyShutdownEvent>(OnShutdown);
         SubscribeLocalEvent<AnomalyStabilityChangedEvent>(OnStabilityChanged);
     }
@@ -92,11 +91,6 @@ public sealed partial class AnomalySystem
         args.Points += (int) (GetAnomalyPointValue(anomaly) * component.PointMultiplier);
     }
 
-    private void OnUnpaused(EntityUid uid, AnomalyVesselComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextBeep += args.PausedTime;
-    }
-
     private void OnVesselAnomalyShutdown(ref AnomalyShutdownEvent args)
     {
         var query = EntityQueryEnumerator<AnomalyVesselComponent>();
index 1ff0290fc9658471b7a476d7540a40609f94bbd5..d4acfc6150cd6e5e3b3a912ed2e89727aa0e7b8e 100644 (file)
@@ -12,13 +12,14 @@ namespace Content.Server.Anomaly.Components;
 /// This is used for a machine that is able to generate
 /// anomalies randomly on the station.
 /// </summary>
-[RegisterComponent, Access(typeof(SharedAnomalySystem))]
+[RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
 public sealed partial class AnomalyGeneratorComponent : Component
 {
     /// <summary>
     /// The time at which the cooldown for generating another anomaly will be over
     /// </summary>
     [DataField("cooldownEndTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan CooldownEndTime = TimeSpan.Zero;
 
     /// <summary>
index 74c5e3e9ed2c1e29bf587d9ee60d7eefb693781e..1225cbf11602dab7f0b690fac277d53d5c591444 100644 (file)
@@ -10,7 +10,7 @@ namespace Content.Server.Anomaly.Components;
 /// they generate points for the selected server based on
 /// the anomaly's stability and severity.
 /// </summary>
-[RegisterComponent, Access(typeof(SharedAnomalySystem))]
+[RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
 public sealed partial class AnomalyVesselComponent : Component
 {
     /// <summary>
@@ -42,6 +42,7 @@ public sealed partial class AnomalyVesselComponent : Component
     /// When the next beep sound will play
     /// </summary>
     [DataField("nextBeep", customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextBeep = TimeSpan.Zero;
 
     /// <summary>
index 4233bfd7e1e57e886a7cb9a0ee70b3b15b91e272..ef93e8c6997bc5c0f0040f06a97eb857bb562092 100644 (file)
@@ -4,13 +4,14 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
 namespace Content.Server.Anomaly.Components;
 
-[RegisterComponent, Access(typeof(SharedAnomalySystem))]
+[RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
 public sealed partial class GeneratingAnomalyGeneratorComponent : Component
 {
     /// <summary>
     /// When the generating period will end.
     /// </summary>
     [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan EndTime = TimeSpan.Zero;
 
     public EntityUid? AudioStream;
index e3389def662164c93cc82967d6088161f8ddb898..47bac84e0ca8c0fb1757c53205aafc3964c791ef 100644 (file)
@@ -29,11 +29,9 @@ public sealed class RottingSystem : SharedRottingSystem
         base.Initialize();
 
         SubscribeLocalEvent<PerishableComponent, MapInitEvent>(OnPerishableMapInit);
-        SubscribeLocalEvent<PerishableComponent, EntityUnpausedEvent>(OnPerishableUnpaused);
         SubscribeLocalEvent<PerishableComponent, MobStateChangedEvent>(OnMobStateChanged);
         SubscribeLocalEvent<PerishableComponent, ExaminedEvent>(OnPerishableExamined);
 
-        SubscribeLocalEvent<RottingComponent, EntityUnpausedEvent>(OnRottingUnpaused);
         SubscribeLocalEvent<RottingComponent, ComponentShutdown>(OnShutdown);
         SubscribeLocalEvent<RottingComponent, MobStateChangedEvent>(OnRottingMobStateChanged);
         SubscribeLocalEvent<RottingComponent, BeingGibbedEvent>(OnGibbed);
@@ -47,11 +45,6 @@ public sealed class RottingSystem : SharedRottingSystem
         component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate;
     }
 
-    private void OnPerishableUnpaused(EntityUid uid, PerishableComponent component, ref EntityUnpausedEvent args)
-    {
-        component.RotNextUpdate += args.PausedTime;
-    }
-
     private void OnMobStateChanged(EntityUid uid, PerishableComponent component, MobStateChangedEvent args)
     {
         if (args.NewMobState != MobState.Dead && args.OldMobState != MobState.Dead)
@@ -64,11 +57,6 @@ public sealed class RottingSystem : SharedRottingSystem
         component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate;
     }
 
-    private void OnRottingUnpaused(EntityUid uid, RottingComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextRotUpdate += args.PausedTime;
-    }
-
     private void OnShutdown(EntityUid uid, RottingComponent component, ComponentShutdown args)
     {
         if (TryComp<PerishableComponent>(uid, out var perishable))
index e23f0229bb4941dfa20b917d54f03ad7190c2c89..9dcf555ea93123e985d15274d456352e43854b13 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Server.Charges.Components;
 /// Something with limited charges that can be recharged automatically.
 /// Requires LimitedChargesComponent to function.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 [Access(typeof(ChargesSystem))]
 public sealed partial class AutoRechargeComponent : Component
 {
@@ -21,5 +21,6 @@ public sealed partial class AutoRechargeComponent : Component
     /// The time when the next charge will be added
     /// </summary>
     [DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextChargeTime;
 }
index 82758f4653d542d573727ae195d076585501ac44..03e192e680e85926f84248e8efa2861f0e2902ad 100644 (file)
@@ -10,13 +10,6 @@ public sealed class ChargesSystem : SharedChargesSystem
 {
     [Dependency] private readonly IGameTiming _timing = default!;
 
-    public override void Initialize()
-    {
-        base.Initialize();
-
-        SubscribeLocalEvent<AutoRechargeComponent, EntityUnpausedEvent>(OnUnpaused);
-    }
-
     public override void Update(float frameTime)
     {
         base.Update(frameTime);
@@ -32,11 +25,6 @@ public sealed class ChargesSystem : SharedChargesSystem
         }
     }
 
-    private void OnUnpaused(EntityUid uid, AutoRechargeComponent comp, ref EntityUnpausedEvent args)
-    {
-        comp.NextChargeTime += args.PausedTime;
-    }
-
     protected override void OnExamine(EntityUid uid, LimitedChargesComponent comp, ExaminedEvent args)
     {
         base.OnExamine(uid, comp, args);
index 91eddef215b27b9a98c7f95fec567e657285f799..8653a4fe5536f17b590eed93b909ef966147d333 100644 (file)
@@ -8,7 +8,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
 /// <summary>
 /// Causes an entity to automatically emote when taking damage.
 /// </summary>
-[RegisterComponent, Access(typeof(EmoteOnDamageSystem))]
+[RegisterComponent, Access(typeof(EmoteOnDamageSystem)), AutoGenerateComponentPause]
 public sealed partial class EmoteOnDamageComponent : Component
 {
     /// <summary>
@@ -41,6 +41,7 @@ public sealed partial class EmoteOnDamageComponent : Component
     /// The simulation time of the last emote preformed due to taking damage.
     /// </summary>
     [DataField("lastEmoteTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan LastEmoteTime = TimeSpan.Zero;
 
     /// <summary>
index 9a435971f2d776af6564f463d9c884351d1263e9..878c517d9242b6e53da8bae44c246cc6853ceb7c 100644 (file)
@@ -18,15 +18,9 @@ public sealed class EmoteOnDamageSystem : EntitySystem
     {
         base.Initialize();
 
-        SubscribeLocalEvent<EmoteOnDamageComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<EmoteOnDamageComponent, DamageChangedEvent>(OnDamage);
     }
 
-    private void OnUnpaused(EntityUid uid, EmoteOnDamageComponent emoteOnDamage, ref EntityUnpausedEvent args)
-    {
-        emoteOnDamage.LastEmoteTime += args.PausedTime;
-    }
-
     private void OnDamage(EntityUid uid, EmoteOnDamageComponent emoteOnDamage, DamageChangedEvent args)
     {
         if (!args.DamageIncreased)
index 0525542b9698bc91daa202d22555e6b6e9348781..9b9294b6f93a2f6d38ab5247e6fb74caf1927854 100644 (file)
@@ -9,7 +9,7 @@ namespace Content.Server.Chemistry.Components;
 /// <summary>
 /// Passively decreases a solution's quantity of reagent(s).
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 [Access(typeof(SolutionPurgeSystem))]
 public sealed partial class SolutionPurgeComponent : Component
 {
@@ -42,5 +42,6 @@ public sealed partial class SolutionPurgeComponent : Component
     /// The time when the next purge will occur.
     /// </summary>
     [DataField("nextPurgeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan NextPurgeTime = TimeSpan.FromSeconds(0);
 }
index 7fe2dacb6790392411befbb4f2039914c23f9b8e..23bf6b215736e32757edb37f60ab85dbc4e1ec69 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Server.Chemistry.Components;
 /// <summary>
 /// Passively increases a solution's quantity of a reagent.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 [Access(typeof(SolutionRegenerationSystem))]
 public sealed partial class SolutionRegenerationComponent : Component
 {
@@ -39,5 +39,6 @@ public sealed partial class SolutionRegenerationComponent : Component
     /// The time when the next regeneration will occur.
     /// </summary>
     [DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan NextRegenTime = TimeSpan.FromSeconds(0);
 }
index e6e003a7f5f4e7c1573aa50c7b6125fb68c997bb..42b8ab374a2fefe5264a46e5d7b5f0eb7609dfdc 100644 (file)
@@ -10,13 +10,6 @@ public sealed class SolutionPurgeSystem : EntitySystem
     [Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
     [Dependency] private readonly IGameTiming _timing = default!;
 
-    public override void Initialize()
-    {
-        base.Initialize();
-
-        SubscribeLocalEvent<SolutionPurgeComponent, EntityUnpausedEvent>(OnUnpaused);
-    }
-
     public override void Update(float frameTime)
     {
         base.Update(frameTime);
@@ -33,9 +26,4 @@ public sealed class SolutionPurgeSystem : EntitySystem
                 _solutionContainer.SplitSolutionWithout(solution.Value, purge.Quantity, purge.Preserve.ToArray());
         }
     }
-
-    private void OnUnpaused(Entity<SolutionPurgeComponent> entity, ref EntityUnpausedEvent args)
-    {
-        entity.Comp.NextPurgeTime += args.PausedTime;
-    }
 }
index 37458846e333f92ae155af14f90643f96df2f776..5af181e4af5a08283e7c987a64023e47159de114 100644 (file)
@@ -12,13 +12,6 @@ public sealed class SolutionRegenerationSystem : EntitySystem
     [Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
     [Dependency] private readonly IGameTiming _timing = default!;
 
-    public override void Initialize()
-    {
-        base.Initialize();
-
-        SubscribeLocalEvent<SolutionRegenerationComponent, EntityUnpausedEvent>(OnUnpaused);
-    }
-
     public override void Update(float frameTime)
     {
         base.Update(frameTime);
@@ -52,9 +45,4 @@ public sealed class SolutionRegenerationSystem : EntitySystem
             }
         }
     }
-
-    private void OnUnpaused(Entity<SolutionRegenerationComponent> entity, ref EntityUnpausedEvent args)
-    {
-        entity.Comp.NextRegenTime += args.PausedTime;
-    }
 }
index 35b2afc2e0f427591eaf042a8e788e2cac67dfd8..6938792315ce67c54eab89e73a7da7de993085d2 100644 (file)
@@ -68,7 +68,6 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
 
         // Shouldn't need re-anchoring.
         SubscribeLocalEvent<DisposalUnitComponent, AnchorStateChangedEvent>(OnAnchorChanged);
-        SubscribeLocalEvent<DisposalUnitComponent, EntityUnpausedEvent>(OnUnpaused);
         // TODO: Predict me when hands predicted
         SubscribeLocalEvent<DisposalUnitComponent, ContainerRelayMovementEntityEvent>(OnMovement);
         SubscribeLocalEvent<DisposalUnitComponent, PowerChangedEvent>(OnPowerChange);
@@ -103,14 +102,6 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
             GetNetEntityList(component.RecentlyEjected));
     }
 
-    private void OnUnpaused(EntityUid uid, SharedDisposalUnitComponent component, ref EntityUnpausedEvent args)
-    {
-        if (component.NextFlush != null)
-            component.NextFlush = component.NextFlush.Value + args.PausedTime;
-
-        component.NextPressurized += args.PausedTime;
-    }
-
     private void AddDisposalAltVerbs(EntityUid uid, SharedDisposalUnitComponent component, GetVerbsEvent<AlternativeVerb> args)
     {
         if (!args.CanAccess || !args.CanInteract)
index 02a18284e8b01863d3c69dec79a9afb696caa5ce..7c1a6f9b5db0cfeed29f219165e8e576facf1adb 100644 (file)
@@ -17,7 +17,6 @@ public sealed class EmpSystem : SharedEmpSystem
     public override void Initialize()
     {
         base.Initialize();
-        SubscribeLocalEvent<EmpDisabledComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<EmpDisabledComponent, ExaminedEvent>(OnExamine);
         SubscribeLocalEvent<EmpOnTriggerComponent, TriggerEvent>(HandleEmpTrigger);
 
@@ -96,12 +95,6 @@ public sealed class EmpSystem : SharedEmpSystem
         }
     }
 
-    private void OnUnpaused(EntityUid uid, EmpDisabledComponent component, ref EntityUnpausedEvent args)
-    {
-        component.DisabledUntil += args.PausedTime;
-        component.TargetTime += args.PausedTime;
-    }
-
     private void OnExamine(EntityUid uid, EmpDisabledComponent component, ExaminedEvent args)
     {
         args.PushMarkup(Loc.GetString("emp-disabled-comp-on-examine"));
index 357286b192ee60b7f1d20ab6f9454b7412a8918a..a63d6fcf66f5e8833deecfebde3538548795bef2 100644 (file)
@@ -6,7 +6,7 @@ namespace Content.Server.Explosion.Components.OnTrigger;
 /// <summary>
 /// After being triggered applies the specified components and runs triggers again.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 public sealed partial class TwoStageTriggerComponent : Component
 {
     /// <summary>
@@ -23,6 +23,7 @@ public sealed partial class TwoStageTriggerComponent : Component
     public ComponentRegistry SecondStageComponents = new();
 
     [DataField("nextTriggerTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan? NextTriggerTime;
 
     [DataField("triggered")]
index 504ef4dee43e647bffe4569c2d4ba44b10a4182f..4f3fb4754e9ebeb2b4555afcb70082f12329f7f5 100644 (file)
@@ -13,7 +13,7 @@ namespace Content.Server.Explosion.Components
     /// <summary>
     /// Raises a <see cref="TriggerEvent"/> whenever an entity collides with a fixture attached to the owner of this component.
     /// </summary>
-    [RegisterComponent]
+    [RegisterComponent, AutoGenerateComponentPause]
     public sealed partial class TriggerOnProximityComponent : SharedTriggerOnProximityComponent
     {
         public const string FixtureID = "trigger-on-proximity-fixture";
@@ -58,6 +58,7 @@ namespace Content.Server.Explosion.Components
         /// </summary>
         [ViewVariables(VVAccess.ReadWrite)]
         [DataField("nextTrigger", customTypeSerializer: typeof(TimeOffsetSerializer))]
+        [AutoPausedField]
         public TimeSpan NextTrigger = TimeSpan.Zero;
 
         /// <summary>
@@ -65,6 +66,7 @@ namespace Content.Server.Explosion.Components
         /// </summary>
         [ViewVariables(VVAccess.ReadWrite)]
         [DataField("nextVisualUpdate", customTypeSerializer: typeof(TimeOffsetSerializer))]
+        [AutoPausedField]
         public TimeSpan NextVisualUpdate = TimeSpan.Zero;
 
         /// <summary>
index d3d97a851e6913e258a81e44d183e1335c4cb2ad..119b1a3d368dda1d164d91909727009575a5fdd8 100644 (file)
@@ -17,7 +17,6 @@ public sealed partial class TriggerSystem
         SubscribeLocalEvent<TriggerOnProximityComponent, StartCollideEvent>(OnProximityStartCollide);
         SubscribeLocalEvent<TriggerOnProximityComponent, EndCollideEvent>(OnProximityEndCollide);
         SubscribeLocalEvent<TriggerOnProximityComponent, MapInitEvent>(OnMapInit);
-        SubscribeLocalEvent<TriggerOnProximityComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<TriggerOnProximityComponent, ComponentShutdown>(OnProximityShutdown);
         // Shouldn't need re-anchoring.
         SubscribeLocalEvent<TriggerOnProximityComponent, AnchorStateChangedEvent>(OnProximityAnchor);
@@ -65,12 +64,6 @@ public sealed partial class TriggerSystem
             collisionLayer: component.Layer);
     }
 
-    private void OnUnpaused(EntityUid uid, TriggerOnProximityComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextTrigger += args.PausedTime;
-        component.NextVisualUpdate += args.PausedTime;
-    }
-
     private void OnProximityStartCollide(EntityUid uid, TriggerOnProximityComponent component, ref StartCollideEvent args)
     {
         if (args.OurFixtureId != TriggerOnProximityComponent.FixtureID)
index a8c48f21d6c01cde465dc2bc29b8657dd0ec0408..4e95eabff04cbdf39d21d713cac27ba4a1b7eb57 100644 (file)
@@ -14,16 +14,9 @@ public sealed class TwoStageTriggerSystem : EntitySystem
     public override void Initialize()
     {
         base.Initialize();
-        SubscribeLocalEvent<TwoStageTriggerComponent, EntityUnpausedEvent>(OnTriggerUnpaused);
         SubscribeLocalEvent<TwoStageTriggerComponent, TriggerEvent>(OnTrigger);
     }
 
-    private void OnTriggerUnpaused(EntityUid uid, TwoStageTriggerComponent component, ref EntityUnpausedEvent args)
-    {
-        if (component.NextTriggerTime != null)
-            component.NextTriggerTime = component.NextTriggerTime.Value + args.PausedTime;
-    }
-
     private void OnTrigger(EntityUid uid, TwoStageTriggerComponent component, TriggerEvent args)
     {
         if (component.Triggered)
index 795655068f742a2d670e8272517ec131b6ab0faa..cb6f9c13ef16cef6945c188337049d06a09d6ef5 100644 (file)
@@ -63,7 +63,6 @@ public sealed class SmokeSystem : EntitySystem
         SubscribeLocalEvent<SmokeComponent, ReactionAttemptEvent>(OnReactionAttempt);
         SubscribeLocalEvent<SmokeComponent, SolutionRelayEvent<ReactionAttemptEvent>>(OnReactionAttempt);
         SubscribeLocalEvent<SmokeComponent, SpreadNeighborsEvent>(OnSmokeSpread);
-        SubscribeLocalEvent<SmokeAffectedComponent, EntityUnpausedEvent>(OnAffectedUnpaused);
     }
 
     /// <inheritdoc/>
@@ -124,11 +123,6 @@ public sealed class SmokeSystem : EntitySystem
             RemComp(args.OtherEntity, smokeAffectedComponent);
     }
 
-    private void OnAffectedUnpaused(Entity<SmokeAffectedComponent> entity, ref EntityUnpausedEvent args)
-    {
-        entity.Comp.NextSecond += args.PausedTime;
-    }
-
     private void OnSmokeSpread(Entity<SmokeComponent> entity, ref SpreadNeighborsEvent args)
     {
         if (entity.Comp.SpreadAmount == 0 || !_solutionContainerSystem.ResolveSolution(entity.Owner, SmokeComponent.SolutionName, ref entity.Comp.Solution, out var solution))
index 71d070f699094a528c8a8742c1629c2f1bc98126..9650baafa3aac44d976d145dfc36c31b9e329ac1 100644 (file)
@@ -8,7 +8,7 @@ namespace Content.Server.Gateway.Components;
 /// <summary>
 /// Controlling gateway that links to other gateway destinations on the server.
 /// </summary>
-[RegisterComponent, Access(typeof(GatewaySystem))]
+[RegisterComponent, Access(typeof(GatewaySystem)), AutoGenerateComponentPause]
 public sealed partial class GatewayComponent : Component
 {
     /// <summary>
@@ -61,5 +61,6 @@ public sealed partial class GatewayComponent : Component
     /// The time at which the portal can next be opened.
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextReady;
 }
index 670cbea307580a7e1fa8163d8452762eb5ac7c04..d65760e270fdc4f81fc6868d9d741838a420a472 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Server.Gateway.Components;
 /// <summary>
 /// Generates gateway destinations at a regular interval.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 public sealed partial class GatewayGeneratorComponent : Component
 {
     /// <summary>
@@ -20,6 +20,7 @@ public sealed partial class GatewayGeneratorComponent : Component
     /// Next time another seed unlocks.
     /// </summary>
     [DataField(customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextUnlock;
 
     /// <summary>
index c8b30af620c0f4fae695574817c3f19a952a70a3..7558f7afc0bcce3feb1340f5142fd836a5dc2638 100644 (file)
@@ -67,7 +67,6 @@ public sealed class GatewayGeneratorSystem : EntitySystem
     public override void Initialize()
     {
         base.Initialize();
-        SubscribeLocalEvent<GatewayGeneratorComponent, EntityUnpausedEvent>(OnGeneratorUnpaused);
         SubscribeLocalEvent<GatewayGeneratorComponent, MapInitEvent>(OnGeneratorMapInit);
         SubscribeLocalEvent<GatewayGeneratorComponent, ComponentShutdown>(OnGeneratorShutdown);
         SubscribeLocalEvent<GatewayGeneratorDestinationComponent, AttemptGatewayOpenEvent>(OnGeneratorAttemptOpen);
@@ -85,11 +84,6 @@ public sealed class GatewayGeneratorSystem : EntitySystem
         }
     }
 
-    private void OnGeneratorUnpaused(Entity<GatewayGeneratorComponent> ent, ref EntityUnpausedEvent args)
-    {
-        ent.Comp.NextUnlock += args.PausedTime;
-    }
-
     private void OnGeneratorMapInit(EntityUid uid, GatewayGeneratorComponent generator, MapInitEvent args)
     {
         if (!_cfgManager.GetCVar(CCVars.GatewayGeneratorEnabled))
index 52525ee0d4c49b54915af67713b006d3fe313fea..7ebc751dd2d39b743e1f4e31d56d2a0beb897869 100644 (file)
@@ -32,7 +32,6 @@ public sealed class GatewaySystem : EntitySystem
     {
         base.Initialize();
 
-        SubscribeLocalEvent<GatewayComponent, EntityUnpausedEvent>(OnGatewayUnpaused);
         SubscribeLocalEvent<GatewayComponent, ComponentStartup>(OnStartup);
         SubscribeLocalEvent<GatewayComponent, ActivatableUIOpenAttemptEvent>(OnGatewayOpenAttempt);
         SubscribeLocalEvent<GatewayComponent, BoundUIOpenedEvent>(UpdateUserInterface);
@@ -48,11 +47,6 @@ public sealed class GatewaySystem : EntitySystem
         UpdateAllGateways();
     }
 
-    private void OnGatewayUnpaused(EntityUid uid, GatewayComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextReady += args.PausedTime;
-    }
-
     private void OnStartup(EntityUid uid, GatewayComponent comp, ComponentStartup args)
     {
         // no need to update ui since its just been created, just do portal
index 77b5e3970c378e9fdb9cd4d883816d222539fe5b..62278064b685a2478cf09eedd5bd11a71e6961fd 100644 (file)
@@ -52,7 +52,6 @@ namespace Content.Server.Hands.Systems
             SubscribeLocalEvent<HandsComponent, BodyPartRemovedEvent>(HandleBodyPartRemoved);
 
             SubscribeLocalEvent<HandsComponent, ComponentGetState>(GetComponentState);
-            SubscribeLocalEvent<HandsComponent, EntityUnpausedEvent>(OnUnpaused);
 
             SubscribeLocalEvent<HandsComponent, BeforeExplodeEvent>(OnExploded);
 
@@ -73,10 +72,6 @@ namespace Content.Server.Hands.Systems
             args.State = new HandsComponentState(hands);
         }
 
-        private void OnUnpaused(Entity<HandsComponent> ent, ref EntityUnpausedEvent args)
-        {
-            ent.Comp.NextThrowTime += args.PausedTime;
-        }
 
         private void OnExploded(Entity<HandsComponent> ent, ref BeforeExplodeEvent args)
         {
index bd5449dde60c39cd8daacd8dea7c3346d22d32a0..1e32e039db1cd8fd88cae7a64a924aa9d714e852 100644 (file)
@@ -6,7 +6,7 @@ namespace Content.Server.Kitchen.Components;
 /// <summary>
 /// Attached to a microwave that is currently in the process of cooking
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 public sealed partial class ActiveMicrowaveComponent : Component
 {
     [ViewVariables(VVAccess.ReadWrite)]
@@ -17,6 +17,7 @@ public sealed partial class ActiveMicrowaveComponent : Component
 
     [ViewVariables(VVAccess.ReadWrite)]
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan MalfunctionTime = TimeSpan.Zero;
 
     [ViewVariables]
index cf3544a7e19b395e3bb2832c6f8cb20149fe1469..212383c463a71438d9013bef7b5ef2f79d287625 100644 (file)
@@ -86,7 +86,6 @@ namespace Content.Server.Kitchen.EntitySystems
 
             SubscribeLocalEvent<ActiveMicrowaveComponent, ComponentStartup>(OnCookStart);
             SubscribeLocalEvent<ActiveMicrowaveComponent, ComponentShutdown>(OnCookStop);
-            SubscribeLocalEvent<ActiveMicrowaveComponent, EntityUnpausedEvent>(OnEntityUnpaused);
             SubscribeLocalEvent<ActiveMicrowaveComponent, EntInsertedIntoContainerMessage>(OnActiveMicrowaveInsert);
             SubscribeLocalEvent<ActiveMicrowaveComponent, EntRemovedFromContainerMessage>(OnActiveMicrowaveRemove);
 
@@ -112,11 +111,6 @@ namespace Content.Server.Kitchen.EntitySystems
             microwaveComponent.PlayingStream = _audio.Stop(microwaveComponent.PlayingStream);
         }
 
-        private void OnEntityUnpaused(Entity<ActiveMicrowaveComponent> ent, ref EntityUnpausedEvent args)
-        {
-            ent.Comp.MalfunctionTime += args.PausedTime;
-        }
-
         private void OnActiveMicrowaveInsert(Entity<ActiveMicrowaveComponent> ent, ref EntInsertedIntoContainerMessage args)
         {
             AddComp<ActivelyMicrowavedComponent>(args.Entity);
index a7fed0cae364c537e4caf5b7761216fc3d13e869..6380b71c8a0bad8649c5eaf61784e20d1f5d7e21 100644 (file)
@@ -6,7 +6,7 @@ namespace Content.Server.Medical.Components;
 /// <summary>
 /// After scanning, retrieves the target Uid to use with its related UI.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 [Access(typeof(HealthAnalyzerSystem), typeof(CryoPodSystem))]
 public sealed partial class HealthAnalyzerComponent : Component
 {
@@ -14,6 +14,7 @@ public sealed partial class HealthAnalyzerComponent : Component
     /// When should the next update be sent for the patient
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextUpdate = TimeSpan.Zero;
 
     /// <summary>
index e6ef8bf96a9a789538e9ed6681c7189208d73855..467085f49eda1af67e49703cd905229b69ea77c8 100644 (file)
@@ -50,21 +50,12 @@ public sealed class DefibrillatorSystem : EntitySystem
     /// <inheritdoc/>
     public override void Initialize()
     {
-        SubscribeLocalEvent<DefibrillatorComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<DefibrillatorComponent, UseInHandEvent>(OnUseInHand);
         SubscribeLocalEvent<DefibrillatorComponent, PowerCellSlotEmptyEvent>(OnPowerCellSlotEmpty);
         SubscribeLocalEvent<DefibrillatorComponent, AfterInteractEvent>(OnAfterInteract);
         SubscribeLocalEvent<DefibrillatorComponent, DefibrillatorZapDoAfterEvent>(OnDoAfter);
     }
 
-    private void OnUnpaused(EntityUid uid, DefibrillatorComponent component, ref EntityUnpausedEvent args)
-    {
-        if (component.NextZapTime == null)
-            return;
-
-        component.NextZapTime = component.NextZapTime.Value + args.PausedTime;
-    }
-
     private void OnUseInHand(EntityUid uid, DefibrillatorComponent component, UseInHandEvent args)
     {
         if (args.Handled || !TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay)))
index 5c7d265e615ed3605e6243dc5a512b70637ca294..a8abc4752df23a797941f3a9d208d38c76e90588 100644 (file)
@@ -30,7 +30,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem
 
     public override void Initialize()
     {
-        SubscribeLocalEvent<HealthAnalyzerComponent, EntityUnpausedEvent>(OnEntityUnpaused);
         SubscribeLocalEvent<HealthAnalyzerComponent, AfterInteractEvent>(OnAfterInteract);
         SubscribeLocalEvent<HealthAnalyzerComponent, HealthAnalyzerDoAfterEvent>(OnDoAfter);
         SubscribeLocalEvent<HealthAnalyzerComponent, EntGotInsertedIntoContainerMessage>(OnInsertedIntoContainer);
@@ -65,11 +64,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem
         }
     }
 
-    private void OnEntityUnpaused(Entity<HealthAnalyzerComponent> ent, ref EntityUnpausedEvent args)
-    {
-        ent.Comp.NextUpdate += args.PausedTime;
-    }
-
     /// <summary>
     /// Trigger the doafter for scanning
     /// </summary>
index 5de11f848cde4100a6835a69ff3ee132a5fb9325..9079655c80c15add2ed9a7dc0a628ccaf1aba5b8 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Server.Medical.SuitSensors;
 ///     Tracking device, embedded in almost all uniforms and jumpsuits.
 ///     If enabled, will report to crew monitoring console owners position and status.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 [Access(typeof(SuitSensorSystem))]
 public sealed partial class SuitSensorComponent : Component
 {
@@ -57,6 +57,7 @@ public sealed partial class SuitSensorComponent : Component
     ///     Next time when sensor updated owners status
     /// </summary>
     [DataField("nextUpdate", customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextUpdate = TimeSpan.Zero;
 
     /// <summary>
index 38a7b0a4517be3dfc8433d50db7fc9a69e460f71..94ecf5fd0e73de39940750d07c50dd0ce2cafc52 100644 (file)
@@ -40,7 +40,6 @@ public sealed class SuitSensorSystem : EntitySystem
         base.Initialize();
         SubscribeLocalEvent<PlayerSpawnCompleteEvent>(OnPlayerSpawn);
         SubscribeLocalEvent<SuitSensorComponent, MapInitEvent>(OnMapInit);
-        SubscribeLocalEvent<SuitSensorComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<SuitSensorComponent, GotEquippedEvent>(OnEquipped);
         SubscribeLocalEvent<SuitSensorComponent, GotUnequippedEvent>(OnUnequipped);
         SubscribeLocalEvent<SuitSensorComponent, ExaminedEvent>(OnExamine);
@@ -51,11 +50,6 @@ public sealed class SuitSensorSystem : EntitySystem
         SubscribeLocalEvent<SuitSensorComponent, EmpDisabledRemoved>(OnEmpFinished);
     }
 
-    private void OnUnpaused(EntityUid uid, SuitSensorComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextUpdate += args.PausedTime;
-    }
-
     public override void Update(float frameTime)
     {
         base.Update(frameTime);
index 4cbd8017f2198cf9a12a36d1fee343428e293b9f..2c4136c24b9c647bd630bd9a7e1cff2d7f00b4fc 100644 (file)
@@ -3,7 +3,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
 namespace Content.Server.NPC.Components;
 
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 public sealed partial class NPCJukeComponent : Component
 {
     [DataField("jukeType")]
@@ -13,6 +13,7 @@ public sealed partial class NPCJukeComponent : Component
     public float JukeDuration = 0.5f;
 
     [DataField("nextJuke", customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextJuke;
 
     [DataField("targetTile")]
index 52f96e9c554458f979cd1066648199fc8a67a963..397b7fb032aa275d49d4812062f0b4e1c23c58e6 100644 (file)
@@ -11,7 +11,7 @@ namespace Content.Server.NPC.Components;
 /// <summary>
 /// Added to NPCs that are moving.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 public sealed partial class NPCSteeringComponent : Component
 {
     #region Context Steering
@@ -49,6 +49,7 @@ public sealed partial class NPCSteeringComponent : Component
     /// Next time we can change our steering direction.
     /// </summary>
     [DataField("nextSteer", customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextSteer = TimeSpan.Zero;
 
     [DataField("lastSteerIndex")]
@@ -66,6 +67,7 @@ public sealed partial class NPCSteeringComponent : Component
     public EntityCoordinates LastStuckCoordinates;
 
     [DataField("lastStuckTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan LastStuckTime;
 
     public const float StuckDistance = 1f;
index 335a2bbaa118a3ac2cd74128fc35ca24a1986f04..dac07ea8421205109b2e3f84fb1a84be7de0f3fd 100644 (file)
@@ -5,7 +5,7 @@ namespace Content.Server.NPC.Pathfinding;
 /// <summary>
 /// Stores the relevant pathfinding data for grids.
 /// </summary>
-[RegisterComponent, Access(typeof(PathfindingSystem))]
+[RegisterComponent, Access(typeof(PathfindingSystem)), AutoGenerateComponentPause]
 public sealed partial class GridPathfindingComponent : Component
 {
     [ViewVariables]
@@ -15,6 +15,7 @@ public sealed partial class GridPathfindingComponent : Component
     /// Next time the graph is allowed to update.
     /// </summary>
     /// Removing this datafield is the lazy fix HOWEVER I want to purge this anyway and do pathfinding at runtime.
+    [AutoPausedField]
     public TimeSpan NextUpdate;
 
     [ViewVariables]
index c27947dedb1f230dd65208ee3ea5308e30b7b1bf..6462c10fe55bb23aa4fbf76aa4ec44786eeb1322 100644 (file)
@@ -44,7 +44,6 @@ public sealed partial class PathfindingSystem
     {
         SubscribeLocalEvent<GridInitializeEvent>(OnGridInit);
         SubscribeLocalEvent<GridRemovalEvent>(OnGridRemoved);
-        SubscribeLocalEvent<GridPathfindingComponent, EntityUnpausedEvent>(OnGridPathPause);
         SubscribeLocalEvent<GridPathfindingComponent, ComponentShutdown>(OnGridPathShutdown);
         SubscribeLocalEvent<CollisionChangeEvent>(OnCollisionChange);
         SubscribeLocalEvent<CollisionLayerChangeEvent>(OnCollisionLayerChange);
@@ -61,10 +60,6 @@ public sealed partial class PathfindingSystem
         DirtyChunk(ev.Entity, Comp<MapGridComponent>(ev.Entity).GridTileToLocal(ev.NewTile.GridIndices));
     }
 
-    private void OnGridPathPause(EntityUid uid, GridPathfindingComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextUpdate += args.PausedTime;
-    }
 
     private void OnGridPathShutdown(EntityUid uid, GridPathfindingComponent component, ComponentShutdown args)
     {
index 19f566405a2863aadd103093948424d1e80c61b6..da9fa1f7615f4ee4871748d5cf0bb301ed5ad0e6 100644 (file)
@@ -33,15 +33,9 @@ public sealed class NPCJukeSystem : EntitySystem
         _npcRangedQuery = GetEntityQuery<NPCRangedCombatComponent>();
         _physicsQuery = GetEntityQuery<PhysicsComponent>();
 
-        SubscribeLocalEvent<NPCJukeComponent, EntityUnpausedEvent>(OnJukeUnpaused);
         SubscribeLocalEvent<NPCJukeComponent, NPCSteeringEvent>(OnJukeSteering);
     }
 
-    private void OnJukeUnpaused(EntityUid uid, NPCJukeComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextJuke += args.PausedTime;
-    }
-
     private void OnJukeSteering(EntityUid uid, NPCJukeComponent component, ref NPCSteeringEvent args)
     {
         if (component.JukeType == JukeType.AdjacentTile)
index 149a330919f71c2294ed7bbfc1874eb479bfd07a..aca2411d8a08213a4773e1c3df0c03e755408382 100644 (file)
@@ -107,7 +107,6 @@ public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem
         Subs.CVar(_configManager, CCVars.NPCPathfinding, SetNPCPathfinding, true);
 
         SubscribeLocalEvent<NPCSteeringComponent, ComponentShutdown>(OnSteeringShutdown);
-        SubscribeLocalEvent<NPCSteeringComponent, EntityUnpausedEvent>(OnSteeringUnpaused);
         SubscribeNetworkEvent<RequestNPCSteeringDebugEvent>(OnDebugRequest);
     }
 
@@ -158,12 +157,6 @@ public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem
         component.PathfindToken = null;
     }
 
-    private void OnSteeringUnpaused(EntityUid uid, NPCSteeringComponent component, ref EntityUnpausedEvent args)
-    {
-        component.LastStuckTime += args.PausedTime;
-        component.NextSteer += args.PausedTime;
-    }
-
     /// <summary>
     /// Adds the AI to the steering system to move towards a specific target
     /// </summary>
index bf81a173e4f907dbae5b6d2208e92d3253326634..e23c557236c049c0d7b7c80ce42e5bf784de7e47 100644 (file)
@@ -10,7 +10,7 @@ namespace Content.Server.Nutrition.Components;
 /// <summary>
 /// This is used for a machine that extracts hunger from entities and creates meat. Yum!
 /// </summary>
-[RegisterComponent, Access(typeof(FatExtractorSystem))]
+[RegisterComponent, Access(typeof(FatExtractorSystem)), AutoGenerateComponentPause]
 public sealed partial class FatExtractorComponent : Component
 {
     /// <summary>
@@ -48,6 +48,7 @@ public sealed partial class FatExtractorComponent : Component
     /// When the next update will occur
     /// </summary>
     [DataField("nextUpdate", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan NextUpdate;
 
     /// <summary>
index 1271c57a23cd07702a1a33bd68a37eb217f1159e..d0fcd113595df2a5308b77ad07e95e90073b5ae6 100644 (file)
@@ -40,23 +40,11 @@ public sealed class AnimalHusbandrySystem : EntitySystem
     /// <inheritdoc/>
     public override void Initialize()
     {
-        SubscribeLocalEvent<ReproductiveComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<ReproductiveComponent, MindAddedMessage>(OnMindAdded);
-        SubscribeLocalEvent<InfantComponent, EntityUnpausedEvent>(OnInfantUnpaused);
         SubscribeLocalEvent<InfantComponent, ComponentStartup>(OnInfantStartup);
         SubscribeLocalEvent<InfantComponent, ComponentShutdown>(OnInfantShutdown);
     }
 
-    private void OnUnpaused(EntityUid uid, ReproductiveComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextBreedAttempt += args.PausedTime;
-    }
-
-    private void OnInfantUnpaused(EntityUid uid, InfantComponent component, ref EntityUnpausedEvent args)
-    {
-        component.InfantEndTime += args.PausedTime;
-    }
-
     // we express EZ-pass terminate the pregnancy if a player takes the role
     private void OnMindAdded(EntityUid uid, ReproductiveComponent component, MindAddedMessage args)
     {
index 4bd8c94ac814b2c15fc84008e442787f7e1d6a65..180e40d1e42625a785c0ef4bce78dac4876a0d53 100644 (file)
@@ -27,18 +27,12 @@ public sealed class FatExtractorSystem : EntitySystem
     /// <inheritdoc/>
     public override void Initialize()
     {
-        SubscribeLocalEvent<FatExtractorComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<FatExtractorComponent, GotEmaggedEvent>(OnGotEmagged);
         SubscribeLocalEvent<FatExtractorComponent, StorageAfterCloseEvent>(OnClosed);
         SubscribeLocalEvent<FatExtractorComponent, StorageAfterOpenEvent>(OnOpen);
         SubscribeLocalEvent<FatExtractorComponent, PowerChangedEvent>(OnPowerChanged);
     }
 
-    private void OnUnpaused(EntityUid uid, FatExtractorComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextUpdate += args.PausedTime;
-    }
-
     private void OnGotEmagged(EntityUid uid, FatExtractorComponent component, ref GotEmaggedEvent args)
     {
         args.Handled = true;
index ca7a0275445a2e4adf4df02ef95980e10d16725e..222c9d64db8dbe427b5a3ac723f1ca36ffd6d838 100644 (file)
@@ -8,13 +8,14 @@ namespace Content.Server.Physics.Components;
 /// <summary>
 /// A component which makes its entity chasing entity with selected component.
 /// </summary>
-[RegisterComponent, Access(typeof(ChasingWalkSystem))]
+[RegisterComponent, Access(typeof(ChasingWalkSystem)), AutoGenerateComponentPause]
 public sealed partial class ChasingWalkComponent : Component
 {
     /// <summary>
     /// The next moment in time when the entity is pushed toward its goal
     /// </summary>
     [DataField, ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan NextImpulseTime;
 
     /// <summary>
@@ -57,6 +58,7 @@ public sealed partial class ChasingWalkComponent : Component
     /// The next change of direction time.
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan NextChangeVectorTime;
 
     /// <summary>
index 8835b44ab79d2bf5be5a4c6df443247a84dadffb..215e7e3124e87762e3e69208097a694927042e4d 100644 (file)
@@ -27,7 +27,6 @@ public sealed class ChasingWalkSystem : VirtualController
         base.Initialize();
 
         SubscribeLocalEvent<ChasingWalkComponent, MapInitEvent>(OnChasingMapInit);
-        SubscribeLocalEvent<ChasingWalkComponent, EntityUnpausedEvent>(OnChasingUnpaused);
     }
 
     private void OnChasingMapInit(EntityUid uid, ChasingWalkComponent component, MapInitEvent args)
@@ -36,12 +35,6 @@ public sealed class ChasingWalkSystem : VirtualController
         component.NextChangeVectorTime = _gameTiming.CurTime;
     }
 
-    private void OnChasingUnpaused(EntityUid uid, ChasingWalkComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextImpulseTime += args.PausedTime;
-        component.NextChangeVectorTime += args.PausedTime;
-    }
-
     public override void UpdateBeforeSolve(bool prediction, float frameTime)
     {
         base.UpdateBeforeSolve(prediction, frameTime);
index c6d8e1e709d97133b127a93e5a1ddf8522e18010..8e960357b7a0a370a51f5ef74f16f9e0cc404b31 100644 (file)
@@ -39,11 +39,6 @@ public sealed partial class PowerCellSystem
         }
     }
 
-    private void OnUnpaused(EntityUid uid, PowerCellDrawComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextUpdateTime += args.PausedTime;
-    }
-
     private void OnDrawChargeChanged(EntityUid uid, PowerCellDrawComponent component, ref ChargeChangedEvent args)
     {
         // Update the bools for client prediction.
index b424f34de556109d938a83c6e52081ba31ca56b6..d501a1bda36d2a51fee0c870b56a24de9f19d293 100644 (file)
@@ -35,7 +35,6 @@ public sealed partial class PowerCellSystem : SharedPowerCellSystem
         SubscribeLocalEvent<PowerCellComponent, ExaminedEvent>(OnCellExamined);
         SubscribeLocalEvent<PowerCellComponent, EmpAttemptEvent>(OnCellEmpAttempt);
 
-        SubscribeLocalEvent<PowerCellDrawComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<PowerCellDrawComponent, ChargeChangedEvent>(OnDrawChargeChanged);
         SubscribeLocalEvent<PowerCellDrawComponent, PowerCellChangedEvent>(OnDrawCellChanged);
 
index f1df042179f02ffc4ff7bf4cc24a0884454bf96e..a55d368c6e309dd4716f1cf4c7dfde96fef70254 100644 (file)
@@ -6,7 +6,7 @@ namespace Content.Server.PowerSink
     /// <summary>
     /// Absorbs power up to its capacity when anchored then explodes.
     /// </summary>
-    [RegisterComponent]
+    [RegisterComponent, AutoGenerateComponentPause]
     public sealed partial class PowerSinkComponent : Component
     {
         /// <summary>
@@ -21,6 +21,7 @@ namespace Content.Server.PowerSink
         /// If explosion has been triggered, time at which to explode.
         /// </summary>
         [DataField("explosionTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
+        [AutoPausedField]
         public System.TimeSpan? ExplosionTime = null;
 
         /// <summary>
index deb669350006725e6543e11a9500e7f2ba9a7d87..dddfd33967f8a8c6c3bdbef5cf794880f8c782e0 100644 (file)
@@ -37,7 +37,6 @@ namespace Content.Server.PowerSink
             base.Initialize();
 
             SubscribeLocalEvent<PowerSinkComponent, ExaminedEvent>(OnExamine);
-            SubscribeLocalEvent<PowerSinkComponent, EntityUnpausedEvent>(OnUnpaused);
         }
 
         private void OnExamine(EntityUid uid, PowerSinkComponent component, ExaminedEvent args)
@@ -54,14 +53,6 @@ namespace Content.Server.PowerSink
             );
         }
 
-        private void OnUnpaused(EntityUid uid, PowerSinkComponent component, ref EntityUnpausedEvent args)
-        {
-            if (component.ExplosionTime == null)
-                return;
-
-            component.ExplosionTime = component.ExplosionTime + args.PausedTime;
-        }
-
         public override void Update(float frameTime)
         {
             var toRemove = new RemQueue<(EntityUid Entity, PowerSinkComponent Sink)>();
index 6d3d831a2dab2cd6cdd34c78c5e02b377bc0be7a..6a58c209cfafe7b318bc2c907ad58e53ad108913 100644 (file)
@@ -11,7 +11,7 @@ namespace Content.Server.Salvage.Expeditions;
 /// <summary>
 /// Designates this entity as holding a salvage expedition.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 public sealed partial class SalvageExpeditionComponent : SharedSalvageExpeditionComponent
 {
     public SalvageMissionParams MissionParams = default!;
@@ -26,6 +26,7 @@ public sealed partial class SalvageExpeditionComponent : SharedSalvageExpedition
     /// When the expeditions ends.
     /// </summary>
     [ViewVariables(VVAccess.ReadWrite), DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan EndTime;
 
     /// <summary>
index 1eb1cc3027f9b82ee3e9fd011889d748a5170631..7e4a9c9310e1accf674694d28b5e2b8675909a8a 100644 (file)
@@ -31,10 +31,7 @@ public sealed partial class SalvageSystem
         SubscribeLocalEvent<SalvageExpeditionConsoleComponent, EntParentChangedMessage>(OnSalvageConsoleParent);
         SubscribeLocalEvent<SalvageExpeditionConsoleComponent, ClaimSalvageMessage>(OnSalvageClaimMessage);
 
-        SubscribeLocalEvent<SalvageExpeditionDataComponent, EntityUnpausedEvent>(OnDataUnpaused);
-
         SubscribeLocalEvent<SalvageExpeditionComponent, ComponentShutdown>(OnExpeditionShutdown);
-        SubscribeLocalEvent<SalvageExpeditionComponent, EntityUnpausedEvent>(OnExpeditionUnpaused);
         SubscribeLocalEvent<SalvageExpeditionComponent, ComponentGetState>(OnExpeditionGetState);
 
         SubscribeLocalEvent<SalvageStructureComponent, ExaminedEvent>(OnStructureExamine);
@@ -89,16 +86,6 @@ public sealed partial class SalvageSystem
         }
     }
 
-    private void OnDataUnpaused(EntityUid uid, SalvageExpeditionDataComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextOffer += args.PausedTime;
-    }
-
-    private void OnExpeditionUnpaused(EntityUid uid, SalvageExpeditionComponent component, ref EntityUnpausedEvent args)
-    {
-        component.EndTime += args.PausedTime;
-    }
-
     private void UpdateExpeditions()
     {
         var currentTime = _timing.CurTime;
index 99cdcbc3b6c095d3782cbcaa63fc4c099fb1b386..b9ff375507f34db022c73f2478bf3cb20852c040 100644 (file)
@@ -3,13 +3,14 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
 namespace Content.Server.Shuttles.Components;
 
-[RegisterComponent, Access(typeof(ArrivalsSystem))]
+[RegisterComponent, Access(typeof(ArrivalsSystem)), AutoGenerateComponentPause]
 public sealed partial class ArrivalsShuttleComponent : Component
 {
     [DataField("station")]
     public EntityUid Station;
 
     [DataField("nextTransfer", customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextTransfer;
 
     [DataField("nextArrivalsTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
index d68065fc00e70e4209aa192ff03d15cfa0cba45e..72c8024e12bfa7bc476fd60887b9d932a941c6fa 100644 (file)
@@ -6,9 +6,10 @@ namespace Content.Server.Shuttles.Components;
 /// <summary>
 /// If added to a grid gets launched when the emergency shuttle launches.
 /// </summary>
-[RegisterComponent, Access(typeof(EmergencyShuttleSystem))]
+[RegisterComponent, Access(typeof(EmergencyShuttleSystem)), AutoGenerateComponentPause]
 public sealed partial class EscapePodComponent : Component
 {
     [DataField("launchTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan? LaunchTime;
 }
index 7d63b835881273f32519420f9e0b2a43b5f6b232..037fcc7566539c2dede5ce0596b3135073afd9cc 100644 (file)
@@ -85,7 +85,6 @@ public sealed class ArrivalsSystem : EntitySystem
         SubscribeLocalEvent<StationArrivalsComponent, ComponentStartup>(OnArrivalsStartup);
 
         SubscribeLocalEvent<ArrivalsShuttleComponent, ComponentStartup>(OnShuttleStartup);
-        SubscribeLocalEvent<ArrivalsShuttleComponent, EntityUnpausedEvent>(OnShuttleUnpaused);
         SubscribeLocalEvent<ArrivalsShuttleComponent, FTLTagEvent>(OnShuttleTag);
 
         SubscribeLocalEvent<RoundStartingEvent>(OnRoundStarting);
@@ -384,11 +383,6 @@ public sealed class ArrivalsSystem : EntitySystem
         EnsureComp<PreventPilotComponent>(uid);
     }
 
-    private void OnShuttleUnpaused(EntityUid uid, ArrivalsShuttleComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextTransfer += args.PausedTime;
-    }
-
     private bool TryGetArrivals(out EntityUid uid)
     {
         var arrivalsQuery = EntityQueryEnumerator<ArrivalsSourceComponent>();
index f8e6f2423f9ddce75a68b3f748f624792f9b4309..6fb939d94ad22732a08877e652cd491883ec143f 100644 (file)
@@ -93,8 +93,6 @@ public sealed partial class EmergencyShuttleSystem
         SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealMessage>(OnEmergencyRepeal);
         SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealAllMessage>(OnEmergencyRepealAll);
         SubscribeLocalEvent<EmergencyShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(OnEmergencyOpenAttempt);
-
-        SubscribeLocalEvent<EscapePodComponent, EntityUnpausedEvent>(OnEscapeUnpaused);
     }
 
     private void OnEmergencyOpenAttempt(EntityUid uid, EmergencyShuttleConsoleComponent component, ActivatableUIOpenAttemptEvent args)
index 66214b0577ee12366db8ec37c22610bc2eecf9e2..8b2c268300b6fb00b19844caf9644637a2181c43 100644 (file)
@@ -507,14 +507,6 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
         EnsureComp<EmergencyShuttleComponent>(shuttle.Value);
     }
 
-    private void OnEscapeUnpaused(EntityUid uid, EscapePodComponent component, ref EntityUnpausedEvent args)
-    {
-        if (component.LaunchTime == null)
-            return;
-
-        component.LaunchTime = component.LaunchTime.Value + args.PausedTime;
-    }
-
     /// <summary>
     /// Returns whether a target is escaping on the emergency shuttle, but only if evac has arrived.
     /// </summary>
index bbe19614a3d185cffe4245445d01eff4b1a65124..e346ae93007921e680eb2b3958003a1dd825a485 100644 (file)
@@ -40,7 +40,6 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
         SubscribeLocalEvent<GhostComponent, EventHorizonAttemptConsumeEntityEvent>(PreventConsume);
         SubscribeLocalEvent<StationDataComponent, EventHorizonAttemptConsumeEntityEvent>(PreventConsume);
         SubscribeLocalEvent<EventHorizonComponent, MapInitEvent>(OnHorizonMapInit);
-        SubscribeLocalEvent<EventHorizonComponent, EntityUnpausedEvent>(OnHorizonUnpaused);
         SubscribeLocalEvent<EventHorizonComponent, StartCollideEvent>(OnStartCollide);
         SubscribeLocalEvent<EventHorizonComponent, EntGotInsertedIntoContainerMessage>(OnEventHorizonContained);
         SubscribeLocalEvent<EventHorizonContainedEvent>(OnEventHorizonContained);
@@ -57,11 +56,6 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
         component.NextConsumeWaveTime = _timing.CurTime;
     }
 
-    private void OnHorizonUnpaused(EntityUid uid, EventHorizonComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextConsumeWaveTime += args.PausedTime;
-    }
-
     public override void Shutdown()
     {
         var vvHandle = Vvm.GetTypeHandler<EventHorizonComponent>();
index d2cd6d640490d2586ef2c3a1e8e5a66909a894ae..8cda21234f19b487a15cda5c42c8f85b50429587 100644 (file)
@@ -2,12 +2,13 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
 namespace Content.Server.Spreader;
 
-[RegisterComponent, Access(typeof(KudzuSystem))]
+[RegisterComponent, Access(typeof(KudzuSystem)), AutoGenerateComponentPause]
 public sealed partial class GrowingKudzuComponent : Component
 {
     /// <summary>
     /// The next time kudzu will try to tick its growth level.
     /// </summary>
     [DataField("nextTick", customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextTick = TimeSpan.Zero;
 }
index d15a2c667f4eef0ebb77fb3a4fc4eb89a412a080..49698ea6735db1becb707a032e9b3383baa07f81 100644 (file)
@@ -21,7 +21,6 @@ public sealed class KudzuSystem : EntitySystem
     {
         SubscribeLocalEvent<KudzuComponent, ComponentStartup>(SetupKudzu);
         SubscribeLocalEvent<KudzuComponent, SpreadNeighborsEvent>(OnKudzuSpread);
-        SubscribeLocalEvent<GrowingKudzuComponent, EntityUnpausedEvent>(OnKudzuUnpaused);
         SubscribeLocalEvent<KudzuComponent, DamageChangedEvent>(OnDamageChanged);
     }
 
@@ -80,11 +79,6 @@ public sealed class KudzuSystem : EntitySystem
         }
     }
 
-    private void OnKudzuUnpaused(EntityUid uid, GrowingKudzuComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextTick += args.PausedTime;
-    }
-
     private void SetupKudzu(EntityUid uid, KudzuComponent component, ComponentStartup args)
     {
         if (!EntityManager.TryGetComponent<AppearanceComponent>(uid, out var appearance))
index de0dc1c28a83d0df73268851cfe303816f4911eb..b4456a4b5b76624e824722ed68e629e823b7db07 100644 (file)
@@ -6,7 +6,7 @@ namespace Content.Server.StationEvents.Components;
 /// <summary>
 ///     Defines basic data for a station event
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 public sealed partial class StationEventComponent : Component
 {
     public const float WeightVeryLow = 0.0f;
@@ -79,11 +79,13 @@ public sealed partial class StationEventComponent : Component
     /// When the station event starts.
     /// </summary>
     [DataField("startTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan StartTime;
 
     /// <summary>
     /// When the station event ends.
     /// </summary>
     [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan? EndTime;
 }
index fb3590dcd5645e1f20ce1cd2cb2e4dc6edb6c456..a0ab037755ff9f08ed4604a5eaca1f480387ad49 100644 (file)
@@ -29,15 +29,6 @@ public sealed class EventManagerSystem : EntitySystem
         _sawmill = Logger.GetSawmill("events");
 
         Subs.CVar(_configurationManager, CCVars.EventsEnabled, SetEnabled, true);
-
-        SubscribeLocalEvent<StationEventComponent, EntityUnpausedEvent>(OnUnpaused);
-    }
-
-    private void OnUnpaused(EntityUid uid, StationEventComponent component, ref EntityUnpausedEvent args)
-    {
-        component.StartTime += args.PausedTime;
-        if (component.EndTime != null)
-            component.EndTime = component.EndTime.Value + args.PausedTime;
     }
 
     /// <summary>
index 641dc59e8c8e86b954b9987c20c646e0b06d6454..add7bf88e4361eddae3748393bac54444bd4b182 100644 (file)
@@ -6,7 +6,7 @@ namespace Content.Server.Tesla.Components;
 /// <summary>
 /// Periodically fires electric arcs at surrounding objects.
 /// </summary>
-[RegisterComponent, Access(typeof(LightningArcShooterSystem))]
+[RegisterComponent, Access(typeof(LightningArcShooterSystem)), AutoGenerateComponentPause]
 public sealed partial class LightningArcShooterComponent : Component
 {
     /// <summary>
@@ -45,6 +45,7 @@ public sealed partial class LightningArcShooterComponent : Component
     /// The time, upon reaching which the next batch of lightning bolts will be fired.
     /// </summary>
     [DataField, ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan NextShootTime;
 
     /// <summary>
index bb954de89ae0b30f0b7e5fb31bf9bdd7b0ee421b..e56c59f196daaa7a265856976742d70ecfbe3936 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Server.Tesla.Components;
 /// <summary>
 /// The component changes the visual of an object after it is struck by lightning
 /// </summary>
-[RegisterComponent, Access(typeof(LightningSparkingSystem))]
+[RegisterComponent, Access(typeof(LightningSparkingSystem)), AutoGenerateComponentPause]
 public sealed partial class LightningSparkingComponent : Component
 {
     /// <summary>
@@ -20,6 +20,7 @@ public sealed partial class LightningSparkingComponent : Component
     /// When the spark visual should turn off.
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan LightningEndTime;
 
     [DataField, ViewVariables(VVAccess.ReadWrite)]
index e901a9328816b16ae5cd90354dacf029c37af8ca..9948537c3c9102551e944d53f05e451844048e88 100644 (file)
@@ -18,7 +18,6 @@ public sealed class LightningArcShooterSystem : EntitySystem
     {
         base.Initialize();
         SubscribeLocalEvent<LightningArcShooterComponent, MapInitEvent>(OnShooterMapInit);
-        SubscribeLocalEvent<LightningArcShooterComponent, EntityUnpausedEvent>(OnShooterUnpaused);
     }
 
     private void OnShooterMapInit(EntityUid uid, LightningArcShooterComponent component, ref MapInitEvent args)
@@ -26,11 +25,6 @@ public sealed class LightningArcShooterSystem : EntitySystem
         component.NextShootTime = _gameTiming.CurTime + TimeSpan.FromSeconds(component.ShootMaxInterval);
     }
 
-    private void OnShooterUnpaused(EntityUid uid, LightningArcShooterComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextShootTime += args.PausedTime;
-    }
-
     public override void Update(float frameTime)
     {
         base.Update(frameTime);
index 7b569e66b396dd7da1c3ac2adb71af8e3cc14345..c07472c8b3b245211e2e604c342832e66fed3496 100644 (file)
@@ -18,12 +18,6 @@ public sealed class LightningSparkingSystem : EntitySystem
         base.Initialize();
 
         SubscribeLocalEvent<LightningSparkingComponent, HitByLightningEvent>(OnHitByLightning);
-        SubscribeLocalEvent<LightningSparkingComponent, EntityUnpausedEvent>(OnLightningUnpaused);
-    }
-
-    private void OnLightningUnpaused(EntityUid uid, LightningSparkingComponent component, ref EntityUnpausedEvent args)
-    {
-        component.LightningEndTime += args.PausedTime;
     }
 
     private void OnHitByLightning(Entity<LightningSparkingComponent> uid, ref HitByLightningEvent args)
index 89afbb0122eb92107c848b87193dd905d9068a8a..bafdf12360040e4d06944344267ccd0d90bb5d0b 100644 (file)
@@ -14,7 +14,7 @@ namespace Content.Shared.Anomaly.Components;
 ///
 /// Anomalies and their related components were designed here: https://hackmd.io/@ss14-design/r1sQbkJOs
 /// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 [Access(typeof(SharedAnomalySystem))]
 public sealed partial class AnomalyComponent : Component
 {
@@ -86,7 +86,7 @@ public sealed partial class AnomalyComponent : Component
     /// <summary>
     /// The time at which the next artifact pulse will occur.
     /// </summary>
-    [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
+    [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField, AutoPausedField]
     [ViewVariables(VVAccess.ReadWrite)]
     public TimeSpan NextPulseTime = TimeSpan.Zero;
 
index 7326118b3cb11872e0064552ebe37c1c00778e6d..a7fedb821b8889bc656d933e7e312d0e1bf48a51 100644 (file)
@@ -5,13 +5,14 @@ namespace Content.Shared.Anomaly.Components;
 /// <summary>
 /// This component tracks anomalies that are currently pulsing
 /// </summary>
-[RegisterComponent, Access(typeof(SharedAnomalySystem))]
+[RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
 public sealed partial class AnomalyPulsingComponent : Component
 {
     /// <summary>
     /// The time at which the pulse will be over.
     /// </summary>
     [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan EndTime;
 
     /// <summary>
index bd8f40852d845652ce32d6661b306f4ae47077d2..00ea882ad2615fecc078a0cc522ad7a4c35eae4d 100644 (file)
@@ -8,6 +8,7 @@ namespace Content.Shared.Anomaly.Components;
 /// </summary>
 [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
 [Access(typeof(SharedAnomalySystem))]
+[AutoGenerateComponentPause]
 public sealed partial class AnomalySupercriticalComponent : Component
 {
     /// <summary>
@@ -15,6 +16,7 @@ public sealed partial class AnomalySupercriticalComponent : Component
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
     [ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan EndTime;
 
     /// <summary>
index 6eba4221b498ce5db814fc33472e1853c26d373b..6cdcdf305bbbd0734f0bebdd4d28d0b11aa4c948 100644 (file)
@@ -46,10 +46,6 @@ public abstract class SharedAnomalySystem : EntitySystem
         SubscribeLocalEvent<AnomalyComponent, MeleeThrowOnHitStartEvent>(OnAnomalyThrowStart);
         SubscribeLocalEvent<AnomalyComponent, MeleeThrowOnHitEndEvent>(OnAnomalyThrowEnd);
 
-        SubscribeLocalEvent<AnomalyComponent, EntityUnpausedEvent>(OnAnomalyUnpause);
-        SubscribeLocalEvent<AnomalyPulsingComponent, EntityUnpausedEvent>(OnPulsingUnpause);
-        SubscribeLocalEvent<AnomalySupercriticalComponent, EntityUnpausedEvent>(OnSupercriticalUnpause);
-
         _sawmill = Logger.GetSawmill("anomaly");
     }
 
@@ -89,23 +85,6 @@ public abstract class SharedAnomalySystem : EntitySystem
         Popup.PopupEntity(Loc.GetString("anomaly-component-contact-damage"), target, target);
     }
 
-    private void OnAnomalyUnpause(EntityUid uid, AnomalyComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextPulseTime += args.PausedTime;
-        Dirty(uid, component);
-    }
-
-    private void OnPulsingUnpause(EntityUid uid, AnomalyPulsingComponent component, ref EntityUnpausedEvent args)
-    {
-        component.EndTime += args.PausedTime;
-    }
-
-    private void OnSupercriticalUnpause(EntityUid uid, AnomalySupercriticalComponent component, ref EntityUnpausedEvent args)
-    {
-        component.EndTime += args.PausedTime;
-        Dirty(uid, component);
-    }
-
     public void DoAnomalyPulse(EntityUid uid, AnomalyComponent? component = null)
     {
         if (!Resolve(uid, ref component))
index 1c5c4bc4ae83ec4e020c0202e200e5746a92761f..6983b872b897cf6ffb712b51cc5f163d3c731773 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Shared.Atmos.Rotting;
 /// This makes mobs eventually start rotting when they die.
 /// It may be expanded to food at some point, but it's just for mobs right now.
 /// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 [Access(typeof(SharedRottingSystem))]
 public sealed partial class PerishableComponent : Component
 {
@@ -27,6 +27,7 @@ public sealed partial class PerishableComponent : Component
     /// Gasses are released, this is when the next gas release update will be.
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan RotNextUpdate = TimeSpan.Zero;
 
     /// <summary>
index d4ba79bb89c932d10982114a30e271985409b6d8..d21fac88a20d63ffddd74f6964cd3d3f2a3993c0 100644 (file)
@@ -8,7 +8,7 @@ namespace Content.Shared.Atmos.Rotting;
 /// Tracking component for stuff that has started to rot.
 /// Only the current stage is networked to the client.
 /// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
 [Access(typeof(SharedRottingSystem))]
 public sealed partial class RottingComponent : Component
 {
@@ -22,6 +22,7 @@ public sealed partial class RottingComponent : Component
     /// When the next check will happen for rot progression + effects like damage and ammonia
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextRotUpdate = TimeSpan.Zero;
 
     /// <summary>
index 5ab639bd3c1623caf8644eaeb28e5821eef235eb..9c73b59e9a82da45fa18ab16bd0a7fd0dc452705 100644 (file)
@@ -8,7 +8,7 @@ namespace Content.Shared.Bed.Cryostorage;
 /// This is used to track an entity that is currently being held in Cryostorage.
 /// </summary>
 [RegisterComponent, NetworkedComponent]
-[AutoGenerateComponentState]
+[AutoGenerateComponentState, AutoGenerateComponentPause]
 public sealed partial class CryostorageContainedComponent : Component
 {
     /// <summary>
@@ -22,6 +22,7 @@ public sealed partial class CryostorageContainedComponent : Component
     /// The time at which the cryostorage grace period ends.
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan? GracePeriodEndTime;
 
     /// <summary>
index 1197e019d07c95068e32005e581bfa4c8400739f..f14dc21c480318a0afac94544831977f1cee99d7 100644 (file)
@@ -37,7 +37,6 @@ public abstract class SharedCryostorageSystem : EntitySystem
         SubscribeLocalEvent<CryostorageComponent, CanDropTargetEvent>(OnCanDropTarget);
 
         SubscribeLocalEvent<CryostorageContainedComponent, EntGotRemovedFromContainerMessage>(OnRemovedContained);
-        SubscribeLocalEvent<CryostorageContainedComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<CryostorageContainedComponent, ComponentShutdown>(OnShutdownContained);
 
         SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
@@ -130,13 +129,6 @@ public abstract class SharedCryostorageSystem : EntitySystem
             RemCompDeferred(ent, comp);
     }
 
-    private void OnUnpaused(Entity<CryostorageContainedComponent> ent, ref EntityUnpausedEvent args)
-    {
-        var comp = ent.Comp;
-        if (comp.GracePeriodEndTime != null)
-            comp.GracePeriodEndTime = comp.GracePeriodEndTime.Value + args.PausedTime;
-    }
-
     private void OnShutdownContained(Entity<CryostorageContainedComponent> ent, ref ComponentShutdown args)
     {
         var comp = ent.Comp;
index 8e76ce3a3e60d50783a99f4a682b02078054e55e..4e4bc2c574b1fc1a777355e49ca4b53bc5812ed2 100644 (file)
@@ -26,14 +26,8 @@ namespace Content.Server.Bed.Sleep
             SubscribeLocalEvent<SleepingComponent, SpeakAttemptEvent>(OnSpeakAttempt);
             SubscribeLocalEvent<SleepingComponent, CanSeeAttemptEvent>(OnSeeAttempt);
             SubscribeLocalEvent<SleepingComponent, PointAttemptEvent>(OnPointAttempt);
-            SubscribeLocalEvent<SleepingComponent, EntityUnpausedEvent>(OnSleepUnpaused);
         }
 
-        private void OnSleepUnpaused(EntityUid uid, SleepingComponent component, ref EntityUnpausedEvent args)
-        {
-            component.CoolDownEnd += args.PausedTime;
-            Dirty(uid, component);
-        }
 
         private void OnMapInit(EntityUid uid, SleepingComponent component, MapInitEvent args)
         {
index 94838b658ffcb0f4ff4c2e82d2232885d5c08e79..cd468440f40d80b207101d88a69af9cd00cef519 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Shared.Bed.Sleep;
 /// <summary>
 /// Added to entities when they go to sleep.
 /// </summary>
-[NetworkedComponent, RegisterComponent]
+[NetworkedComponent, RegisterComponent, AutoGenerateComponentPause(Dirty = true)]
 public sealed partial class SleepingComponent : Component
 {
     /// <summary>
@@ -24,6 +24,7 @@ public sealed partial class SleepingComponent : Component
     public TimeSpan Cooldown = TimeSpan.FromSeconds(1f);
 
     [DataField("cooldownEnd", customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan CoolDownEnd;
 
     [DataField("wakeAction")] public EntityUid? WakeAction;
index 69b1c8e308161758d89d3e928fbdbe0970af07ce..09377864c44f87b91b2dca235bfee02e15f2488a 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Shared.Chasm;
 /// <summary>
 ///     Added to entities which have started falling into a chasm.
 /// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
 public sealed partial class ChasmFallingComponent : Component
 {
     /// <summary>
@@ -23,6 +23,7 @@ public sealed partial class ChasmFallingComponent : Component
     public TimeSpan DeletionTime = TimeSpan.FromSeconds(1.8f);
 
     [DataField("nextDeletionTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextDeletionTime = TimeSpan.Zero;
 
     /// <summary>
index 4045a270780555f31761dae6b78e2da780859187..51299557dbd3f2cf967ffef355f880471518c401 100644 (file)
@@ -26,7 +26,6 @@ public sealed class ChasmSystem : EntitySystem
 
         SubscribeLocalEvent<ChasmComponent, StepTriggeredEvent>(OnStepTriggered);
         SubscribeLocalEvent<ChasmComponent, StepTriggerAttemptEvent>(OnStepTriggerAttempt);
-        SubscribeLocalEvent<ChasmFallingComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<ChasmFallingComponent, UpdateCanMoveEvent>(OnUpdateCanMove);
     }
 
@@ -73,11 +72,6 @@ public sealed class ChasmSystem : EntitySystem
         args.Continue = true;
     }
 
-    private void OnUnpaused(EntityUid uid, ChasmFallingComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextDeletionTime += args.PausedTime;
-    }
-
     private void OnUpdateCanMove(EntityUid uid, ChasmFallingComponent component, UpdateCanMoveEvent args)
     {
         args.Cancel();
index def6940ee1c87d1b4d6625b31f1851e0706142f2..fdc46dfbef48533d9e76a197e4db606c333f1b6c 100644 (file)
@@ -7,13 +7,14 @@ namespace Content.Shared.Chemistry.Components;
 /// This is used for entities which are currently being affected by smoke.
 /// Manages the gradual metabolism every second.
 /// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
 public sealed partial class SmokeAffectedComponent : Component
 {
     /// <summary>
     /// The time at which the next smoke metabolism will occur.
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextSecond;
 
     /// <summary>
index 2af2c89feb50b783f5e1afd616746cb2e33ec67a..89320eabc89c4dfa18bc8e37c096d14566b709e4 100644 (file)
@@ -4,7 +4,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
 namespace Content.Shared.Climbing.Components;
 
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 public sealed partial class ClimbingComponent : Component
 {
     /// <summary>
@@ -17,6 +17,7 @@ public sealed partial class ClimbingComponent : Component
     /// Whether the owner is being moved onto the climbed entity.
     /// </summary>
     [AutoNetworkedField, DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan? NextTransition;
 
     /// <summary>
index 23bc54b8f894dd87969348025b77ed730b06d0eb..7c760f2c5de601c796c11a5fa3fa725a18d199ea 100644 (file)
@@ -62,7 +62,6 @@ public sealed partial class ClimbSystem : VirtualController
         SubscribeLocalEvent<ClimbingComponent, ClimbDoAfterEvent>(OnDoAfter);
         SubscribeLocalEvent<ClimbingComponent, EndCollideEvent>(OnClimbEndCollide);
         SubscribeLocalEvent<ClimbingComponent, BuckleChangeEvent>(OnBuckleChange);
-        SubscribeLocalEvent<ClimbingComponent, EntityUnpausedEvent>(OnClimbableUnpaused);
 
         SubscribeLocalEvent<ClimbableComponent, CanDropTargetEvent>(OnCanDragDropOn);
         SubscribeLocalEvent<ClimbableComponent, GetVerbsEvent<AlternativeVerb>>(AddClimbableVerb);
@@ -71,15 +70,6 @@ public sealed partial class ClimbSystem : VirtualController
         SubscribeLocalEvent<GlassTableComponent, ClimbedOnEvent>(OnGlassClimbed);
     }
 
-    private void OnClimbableUnpaused(EntityUid uid, ClimbingComponent component, ref EntityUnpausedEvent args)
-    {
-        if (component.NextTransition == null)
-            return;
-
-        component.NextTransition = component.NextTransition.Value + args.PausedTime;
-        Dirty(uid, component);
-    }
-
     public override void UpdateBeforeSolve(bool prediction, float frameTime)
     {
         base.UpdateBeforeSolve(prediction, frameTime);
index 0c5e12e6f0f6cf1de596c0fbbec4f0ef7162254f..6d94c087af6a6d372cf7ddc8ca66a827015f1503 100644 (file)
@@ -28,16 +28,9 @@ public sealed class PacificationSystem : EntitySystem
         SubscribeLocalEvent<PacifiedComponent, BeforeThrowEvent>(OnBeforeThrow);
         SubscribeLocalEvent<PacifiedComponent, AttackAttemptEvent>(OnAttackAttempt);
         SubscribeLocalEvent<PacifiedComponent, ShotAttemptedEvent>(OnShootAttempt);
-        SubscribeLocalEvent<PacifiedComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<PacifismDangerousAttackComponent, AttemptPacifiedAttackEvent>(OnPacifiedDangerousAttack);
     }
 
-    private void OnUnpaused(Entity<PacifiedComponent> ent, ref EntityUnpausedEvent args)
-    {
-        if (ent.Comp.NextPopupTime != null)
-            ent.Comp.NextPopupTime = ent.Comp.NextPopupTime.Value + args.PausedTime;
-    }
-
     private bool PacifiedCanAttack(EntityUid user, EntityUid target, [NotNullWhen(false)] out string? reason)
     {
         var ev = new AttemptPacifiedAttackEvent(user);
index e271628fcb9448d4706d5ece3ab5b906bcb5f28d..464ef778851c5e053b154f2165a06160c6fbba03 100644 (file)
@@ -11,7 +11,7 @@ namespace Content.Shared.CombatMode.Pacification;
 ///
 /// If you want full-pacifism (no combat mode at all), you can simply set <see cref="DisallowAllCombat"/> before adding.
 /// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
 [Access(typeof(PacificationSystem))]
 public sealed partial class PacifiedComponent : Component
 {
@@ -33,6 +33,7 @@ public sealed partial class PacifiedComponent : Component
     public TimeSpan PopupCooldown = TimeSpan.FromSeconds(3.0);
 
     [DataField]
+    [AutoPausedField]
     public TimeSpan? NextPopupTime = null;
 
     /// <summary>
index 1270591548fcbb639ad2fd22ca6ee3fe6ed55e38..ed084b39b535282736a1931da4408ff8ba3c0972 100644 (file)
@@ -11,7 +11,7 @@ namespace Content.Shared.Construction.Components;
 /// </summary>
 [RegisterComponent, NetworkedComponent]
 [Access(typeof(SharedFlatpackSystem))]
-[AutoGenerateComponentState]
+[AutoGenerateComponentState, AutoGenerateComponentPause]
 public sealed partial class FlatpackCreatorComponent : Component
 {
     /// <summary>
@@ -26,6 +26,7 @@ public sealed partial class FlatpackCreatorComponent : Component
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
     [AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan PackEndTime;
 
     /// <summary>
index d4c2513cd3d7b164618a6f1512bdc1471ee27a1d..a62488d6f38d6a8121fa4bfdb9f64a2b6ce13223 100644 (file)
@@ -40,7 +40,6 @@ public abstract class SharedFlatpackSystem : EntitySystem
         SubscribeLocalEvent<FlatpackComponent, ExaminedEvent>(OnFlatpackExamined);
 
         SubscribeLocalEvent<FlatpackCreatorComponent, ContainerIsRemovingAttemptEvent>(OnCreatorRemovingAttempt);
-        SubscribeLocalEvent<FlatpackCreatorComponent, EntityUnpausedEvent>(OnCreatorUnpaused);
     }
 
     private void OnFlatpackInteractUsing(Entity<FlatpackComponent> ent, ref InteractUsingEvent args)
@@ -110,11 +109,6 @@ public abstract class SharedFlatpackSystem : EntitySystem
             args.Cancel();
     }
 
-    private void OnCreatorUnpaused(Entity<FlatpackCreatorComponent> ent, ref EntityUnpausedEvent args)
-    {
-        ent.Comp.PackEndTime += args.PausedTime;
-    }
-
     public void SetupFlatpack(Entity<FlatpackComponent?> ent, EntityUid? board)
     {
         if (!Resolve(ent, ref ent.Comp))
index fe28b7e7f089b07825376abfc50bf786b0a73e37..8af477c30b86b1843d774e983f803a44f0e61d0d 100644 (file)
@@ -5,7 +5,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 namespace Content.Shared.Damage.Components;
 
 [RegisterComponent, NetworkedComponent]
-[AutoGenerateComponentState]
+[AutoGenerateComponentState, AutoGenerateComponentPause]
 [Access(typeof(DamageOnHoldingSystem))]
 public sealed partial class DamageOnHoldingComponent : Component
 {
@@ -29,5 +29,6 @@ public sealed partial class DamageOnHoldingComponent : Component
 
     [DataField("nextDamage", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
     [AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan NextDamage = TimeSpan.Zero;
 }
index 74e0f6c85295b9114e6b2fc897325fe8e38d5a58..5a2fba4970164ebdf0a93a64bad2be81a06a5f6d 100644 (file)
@@ -6,7 +6,7 @@ namespace Content.Shared.Damage.Components;
 /// <summary>
 /// Add to an entity to paralyze it whenever it reaches critical amounts of Stamina DamageType.
 /// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), AutoGenerateComponentPause]
 public sealed partial class StaminaComponent : Component
 {
     /// <summary>
@@ -49,5 +49,6 @@ public sealed partial class StaminaComponent : Component
     /// To avoid continuously updating our data we track the last time we updated so we can extrapolate our current stamina.
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan NextUpdate = TimeSpan.Zero;
 }
index e22be2fbbf52902f53fdb179d9ddde26c908977a..c13ec0a1b9f6d35f364f5dba84c4aaeedca192d6 100644 (file)
@@ -13,7 +13,6 @@ public sealed class DamageOnHoldingSystem : EntitySystem
     public override void Initialize()
     {
         base.Initialize();
-        SubscribeLocalEvent<DamageOnHoldingComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<DamageOnHoldingComponent, MapInitEvent>(OnMapInit);
     }
 
@@ -26,11 +25,6 @@ public sealed class DamageOnHoldingSystem : EntitySystem
         }
     }
 
-    private void OnUnpaused(EntityUid uid, DamageOnHoldingComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextDamage += args.PausedTime;
-    }
-
     private void OnMapInit(EntityUid uid, DamageOnHoldingComponent component, MapInitEvent args)
     {
         component.NextDamage = _timing.CurTime;
@@ -50,4 +44,4 @@ public sealed class DamageOnHoldingSystem : EntitySystem
             component.NextDamage = _timing.CurTime + TimeSpan.FromSeconds(component.Interval);
         }
     }
-}
\ No newline at end of file
+}
index 9ac23f1af87429ae57a84426e242c97f86266120..b8ea953f25243e878abcfcf796f2b7626d840ff2 100644 (file)
@@ -46,7 +46,6 @@ public sealed partial class StaminaSystem : EntitySystem
 
         InitializeModifier();
 
-        SubscribeLocalEvent<StaminaComponent, EntityUnpausedEvent>(OnStamUnpaused);
         SubscribeLocalEvent<StaminaComponent, ComponentStartup>(OnStartup);
         SubscribeLocalEvent<StaminaComponent, ComponentShutdown>(OnShutdown);
         SubscribeLocalEvent<StaminaComponent, AfterAutoHandleStateEvent>(OnStamHandleState);
@@ -61,11 +60,6 @@ public sealed partial class StaminaSystem : EntitySystem
         SubscribeLocalEvent<StaminaDamageOnHitComponent, MeleeHitEvent>(OnMeleeHit);
     }
 
-    private void OnStamUnpaused(EntityUid uid, StaminaComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextUpdate += args.PausedTime;
-    }
-
     private void OnStamHandleState(EntityUid uid, StaminaComponent component, ref AfterAutoHandleStateEvent args)
     {
         if (component.Critical)
index 33ba619a0d253976a7bfd0e9f98092b3be895dd5..9e5a56de8378c71d3c6050e88098567d13211d53 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Shared.Emp;
 /// While entity has this component it is "disabled" by EMP.
 /// Add desired behaviour in other systems
 /// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
 [Access(typeof(SharedEmpSystem))]
 public sealed partial class EmpDisabledComponent : Component
 {
@@ -15,6 +15,7 @@ public sealed partial class EmpDisabledComponent : Component
     /// Moment of time when component is removed and entity stops being "disabled"
     /// </summary>
     [DataField("timeLeft", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan DisabledUntil;
 
     [DataField("effectCoolDown"), ViewVariables(VVAccess.ReadWrite)]
@@ -23,5 +24,6 @@ public sealed partial class EmpDisabledComponent : Component
     /// <summary>
     /// When next effect will be spawned
     /// </summary>
+    [AutoPausedField]
     public TimeSpan TargetTime = TimeSpan.Zero;
 }
index e8608a9681c1c11f6fbaf4d40220f2ca6e781793..c910320a2fbd45ab3898d1035251ea9be94ec7cd 100644 (file)
@@ -6,12 +6,13 @@ namespace Content.Shared.Gravity;
 /// <summary>
 /// Indicates this entity is shaking due to gravity changes.
 /// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 public sealed partial class GravityShakeComponent : Component
 {
     [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
     public int ShakeTimes;
 
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan NextShake;
 }
index e590baae44ca9c3440ac2738c66149c8704b911f..ad2e0e3ad576138c0385ed1d3f1586f2086ace1d 100644 (file)
@@ -5,16 +5,6 @@ public abstract partial class SharedGravitySystem
     protected const float GravityKick = 100.0f;
     protected const float ShakeCooldown = 0.2f;
 
-    private void InitializeShake()
-    {
-        SubscribeLocalEvent<GravityShakeComponent, EntityUnpausedEvent>(OnShakeUnpaused);
-    }
-
-    private void OnShakeUnpaused(EntityUid uid, GravityShakeComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextShake += args.PausedTime;
-    }
-
     private void UpdateShake()
     {
         var curTime = Timing.CurTime;
index a65c386ae569762129958523e373797bed4c7875..100d2ee74fb8a5ac6a2313974af65275571f4916 100644 (file)
@@ -61,8 +61,6 @@ namespace Content.Shared.Gravity
             SubscribeLocalEvent<GravityChangedEvent>(OnGravityChange);
             SubscribeLocalEvent<GravityComponent, ComponentGetState>(OnGetState);
             SubscribeLocalEvent<GravityComponent, ComponentHandleState>(OnHandleState);
-
-            InitializeShake();
         }
 
         public override void Update(float frameTime)
index ef3b2a6a0e6670897ae1cc8a25c40305344a1384..904b10b3bdca6c7a57d0470320db6bb7990ac36b 100644 (file)
@@ -5,7 +5,7 @@ using Robust.Shared.Serialization;
 
 namespace Content.Shared.Hands.Components;
 
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
 [Access(typeof(SharedHandsSystem))]
 public sealed partial class HandsComponent : Component
 {
@@ -62,6 +62,7 @@ public sealed partial class HandsComponent : Component
     ///     The time at which throws will be allowed again.
     /// </summary>
     [DataField, ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan NextThrowTime;
 
     /// <summary>
index 9c2ee9632e246c3f24afb9553579fdd1c4c50bd0..2beeed5d1ec30f30d0fbcfa93817411deb637fcf 100644 (file)
@@ -8,7 +8,7 @@ namespace Content.Shared.Materials;
 /// Tracker component for the process of reclaiming entities
 /// <seealso cref="MaterialReclaimerComponent"/>
 /// </summary>
-[RegisterComponent, NetworkedComponent, Access(typeof(SharedMaterialReclaimerSystem))]
+[RegisterComponent, NetworkedComponent, Access(typeof(SharedMaterialReclaimerSystem)), AutoGenerateComponentPause]
 public sealed partial class ActiveMaterialReclaimerComponent : Component
 {
     /// <summary>
@@ -21,6 +21,7 @@ public sealed partial class ActiveMaterialReclaimerComponent : Component
     /// When the reclaiming process ends.
     /// </summary>
     [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan EndTime;
 
     /// <summary>
index 007dc73345d40771610b4df988f5fb0e8d63dad3..8ff96c17a77ea34b0e585e76bba896a7768fc04b 100644 (file)
@@ -3,7 +3,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
 namespace Content.Shared.Materials;
 
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 public sealed partial class InsertingMaterialStorageComponent : Component
 {
     /// <summary>
@@ -11,6 +11,7 @@ public sealed partial class InsertingMaterialStorageComponent : Component
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
     [ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan EndTime;
 
     [ViewVariables, AutoNetworkedField]
index 6c625e2fa2583731919b8f0b0442d2c44841fd87..3e72baf6041ea0ec99b5213d957fd6152b12c14e 100644 (file)
@@ -10,7 +10,7 @@ namespace Content.Shared.Materials;
 /// This is a machine that handles converting entities
 /// into the raw materials and chemicals that make them up.
 /// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 [Access(typeof(SharedMaterialReclaimerSystem))]
 public sealed partial class MaterialReclaimerComponent : Component
 {
@@ -90,6 +90,7 @@ public sealed partial class MaterialReclaimerComponent : Component
     /// When the next sound will be allowed to be played. Used to prevent spam.
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextSound;
 
     /// <summary>
index 66cb25f530b6081ef7e762480284a08ef78255b7..ad8547acc02ebdcbeefd7ce47d7d465b957eb3b0 100644 (file)
@@ -34,13 +34,11 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
     public override void Initialize()
     {
         SubscribeLocalEvent<MaterialReclaimerComponent, ComponentShutdown>(OnShutdown);
-        SubscribeLocalEvent<MaterialReclaimerComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<MaterialReclaimerComponent, ExaminedEvent>(OnExamined);
         SubscribeLocalEvent<MaterialReclaimerComponent, GotEmaggedEvent>(OnEmagged);
         SubscribeLocalEvent<MaterialReclaimerComponent, MapInitEvent>(OnMapInit);
         SubscribeLocalEvent<CollideMaterialReclaimerComponent, StartCollideEvent>(OnCollide);
         SubscribeLocalEvent<ActiveMaterialReclaimerComponent, ComponentStartup>(OnActiveStartup);
-        SubscribeLocalEvent<ActiveMaterialReclaimerComponent, EntityUnpausedEvent>(OnActiveUnpaused);
     }
 
     private void OnMapInit(EntityUid uid, MaterialReclaimerComponent component, MapInitEvent args)
@@ -53,11 +51,6 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
         _audio.Stop(component.Stream);
     }
 
-    private void OnUnpaused(EntityUid uid, MaterialReclaimerComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextSound += args.PausedTime;
-    }
-
     private void OnExamined(EntityUid uid, MaterialReclaimerComponent component, ExaminedEvent args)
     {
         args.PushMarkup(Loc.GetString("recycler-count-items", ("items", component.ItemsProcessed)));
@@ -82,11 +75,6 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
         component.ReclaimingContainer = Container.EnsureContainer<Container>(uid, ActiveReclaimerContainerId);
     }
 
-    private void OnActiveUnpaused(EntityUid uid, ActiveMaterialReclaimerComponent component, ref EntityUnpausedEvent args)
-    {
-        component.EndTime += args.PausedTime;
-    }
-
     /// <summary>
     /// Tries to start processing an item via a <see cref="MaterialReclaimerComponent"/>.
     /// </summary>
index 9f7c87df3c98482462de531d1a376ca5a21d8349..b1de77d971a0e4b29a9278ca80ec6ee43344f30b 100644 (file)
@@ -30,7 +30,6 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
 
         SubscribeLocalEvent<MaterialStorageComponent, MapInitEvent>(OnMapInit);
         SubscribeLocalEvent<MaterialStorageComponent, InteractUsingEvent>(OnInteractUsing);
-        SubscribeLocalEvent<InsertingMaterialStorageComponent, EntityUnpausedEvent>(OnUnpaused);
     }
 
     public override void Update(float frameTime)
@@ -52,11 +51,6 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
         _appearance.SetData(uid, MaterialStorageVisuals.Inserting, false);
     }
 
-    private void OnUnpaused(EntityUid uid, InsertingMaterialStorageComponent component, ref EntityUnpausedEvent args)
-    {
-        component.EndTime += args.PausedTime;
-    }
-
     /// <summary>
     /// Gets the volume of a specified material contained in this storage.
     /// </summary>
index afd1e0cc96989e74060c0920f901482aef5630dc..2da5285285473dd31527ae15dedbd4800328e74f 100644 (file)
@@ -11,7 +11,7 @@ namespace Content.Shared.Medical;
 /// This is used for defibrillators; a machine that shocks a dead
 /// person back into the world of the living.
 /// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
 public sealed partial class DefibrillatorComponent : Component
 {
     /// <summary>
@@ -24,6 +24,7 @@ public sealed partial class DefibrillatorComponent : Component
     /// The time at which the zap cooldown will be completed
     /// </summary>
     [DataField("nextZapTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan? NextZapTime;
 
     /// <summary>
index b6fac57b0b5374130043a71b53ab9ed3f3178746..7e7b1ffcd3017aae0fad04d3e90118ea55704874 100644 (file)
@@ -15,6 +15,7 @@ namespace Content.Shared.Ninja.Components;
 /// As an implementation detail, dashing with katana is a suit action which isn't ideal.
 /// </summary>
 [RegisterComponent, NetworkedComponent, Access(typeof(SharedNinjaSuitSystem)), AutoGenerateComponentState]
+[AutoGenerateComponentPause]
 public sealed partial class NinjaSuitComponent : Component
 {
     /// <summary>
@@ -46,6 +47,7 @@ public sealed partial class NinjaSuitComponent : Component
     /// Time at which we will be able to use our abilities again
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan DisableCooldown;
 
     /// <summary>
index 1449157538a9c34596698e0bc1567fea27c52160..fed41eaed8afd7da46ba173eaa16ac83ba473031 100644 (file)
@@ -27,7 +27,6 @@ public abstract class SharedNinjaSuitSystem : EntitySystem
         base.Initialize();
 
         SubscribeLocalEvent<NinjaSuitComponent, MapInitEvent>(OnMapInit);
-        SubscribeLocalEvent<NinjaSuitComponent, EntityUnpausedEvent>(OnEntityUnpaused);
 
         SubscribeLocalEvent<NinjaSuitComponent, GotEquippedEvent>(OnEquipped);
         SubscribeLocalEvent<NinjaSuitComponent, GetItemActionsEvent>(OnGetItemActions);
@@ -43,11 +42,6 @@ public abstract class SharedNinjaSuitSystem : EntitySystem
         Dirty(uid, component);
     }
 
-    private void OnEntityUnpaused(Entity<NinjaSuitComponent> ent, ref EntityUnpausedEvent args)
-    {
-        ent.Comp.DisableCooldown += args.PausedTime;
-    }
-
     /// <summary>
     /// Call the shared and serverside code for when a ninja equips the suit.
     /// </summary>
index c6406a08668202560258823f81e778ccd2aaeff4..2708c823d2c83a1fea9312e5bfc94bd144d0e95c 100644 (file)
@@ -8,7 +8,7 @@ namespace Content.Shared.Nutrition.AnimalHusbandry;
 /// This is used for marking entities as infants.
 /// Infants have half the size, visually, and cannot breed.
 /// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
 public sealed partial class InfantComponent : Component
 {
     /// <summary>
@@ -33,6 +33,7 @@ public sealed partial class InfantComponent : Component
     /// When the entity will stop being an infant.
     /// </summary>
     [DataField("infantEndTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan InfantEndTime;
 
     /// <summary>
index ea9edcb50762a6ea90e3063f074798a1b618341f..8d128f547e65788bf093511258f05b2b7f357efc 100644 (file)
@@ -9,13 +9,14 @@ namespace Content.Shared.Nutrition.AnimalHusbandry;
 /// given they are next to a particular entity that fulfills a whitelist,
 /// can create several "child" entities.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 public sealed partial class ReproductiveComponent : Component
 {
     /// <summary>
     /// The next time when breeding will be attempted.
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan NextBreedAttempt;
 
     /// <summary>
index 11197d8b42a44013bf7bf631b66654af31c93cac..9ac82ba283c9dab4b28904b97d8dde938136ad99 100644 (file)
@@ -9,7 +9,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Generic;
 namespace Content.Shared.Nutrition.Components;
 
 [RegisterComponent, NetworkedComponent, Access(typeof(HungerSystem))]
-[AutoGenerateComponentState]
+[AutoGenerateComponentState, AutoGenerateComponentPause]
 public sealed partial class HungerComponent : Component
 {
     /// <summary>
@@ -106,6 +106,7 @@ public sealed partial class HungerComponent : Component
     /// </summary>
     [DataField("nextUpdateTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
     [AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan NextUpdateTime;
 
     /// <summary>
index 35eb4d261492df0507464cd18af8dff88f6e25fa..731346401fd9d8b836a002d0891c14818b903e3f 100644 (file)
@@ -6,7 +6,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 namespace Content.Shared.Nutrition.Components;
 
 [RegisterComponent, NetworkedComponent, Access(typeof(ThirstSystem))]
-[AutoGenerateComponentState]
+[AutoGenerateComponentState, AutoGenerateComponentPause]
 public sealed partial class ThirstComponent : Component
 {
     // Base stuff
@@ -35,6 +35,7 @@ public sealed partial class ThirstComponent : Component
     /// </summary>
     [DataField("nextUpdateTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
     [AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan NextUpdateTime;
 
     /// <summary>
index 9c096035104ad7bcdb5d8b2f3f403f5ad138d6ed..d8808b6e4ab87c2f482adc98a8f605920841a618 100644 (file)
@@ -23,18 +23,12 @@ public sealed class HungerSystem : EntitySystem
     {
         base.Initialize();
 
-        SubscribeLocalEvent<HungerComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<HungerComponent, MapInitEvent>(OnMapInit);
         SubscribeLocalEvent<HungerComponent, ComponentShutdown>(OnShutdown);
         SubscribeLocalEvent<HungerComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovespeed);
         SubscribeLocalEvent<HungerComponent, RejuvenateEvent>(OnRejuvenate);
     }
 
-    private void OnUnpaused(EntityUid uid, HungerComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextUpdateTime += args.PausedTime;
-    }
-
     private void OnMapInit(EntityUid uid, HungerComponent component, MapInitEvent args)
     {
         var amount = _random.Next(
index 05a2338768fc9e5680fe9548fc3d85fadcfd613d..b070cee283144a040d4059a5aac4ac227bc5fc9c 100644 (file)
@@ -29,7 +29,6 @@ public sealed class ThirstSystem : EntitySystem
         SubscribeLocalEvent<ThirstComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovespeed);
         SubscribeLocalEvent<ThirstComponent, MapInitEvent>(OnMapInit);
         SubscribeLocalEvent<ThirstComponent, RejuvenateEvent>(OnRejuvenate);
-        SubscribeLocalEvent<ThirstComponent, EntityUnpausedEvent>(OnUnpaused);
     }
 
     private void OnMapInit(EntityUid uid, ThirstComponent component, MapInitEvent args)
@@ -184,9 +183,4 @@ public sealed class ThirstSystem : EntitySystem
             UpdateEffects(uid, thirst);
         }
     }
-
-    private void OnUnpaused(EntityUid uid, ThirstComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextUpdateTime += args.PausedTime;
-    }
 }
index 6963326b709c3245b4df1f0f6287f39b761ed82c..708a86a8eaf9d2e630d9b93a2fb167e3b7433561 100644 (file)
@@ -6,7 +6,7 @@ namespace Content.Shared.PowerCell;
 /// <summary>
 /// Indicates that the entity's ActivatableUI requires power or else it closes.
 /// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 public sealed partial class PowerCellDrawComponent : Component
 {
     #region Prediction
@@ -49,5 +49,6 @@ public sealed partial class PowerCellDrawComponent : Component
     /// When the next automatic power draw will occur
     /// </summary>
     [DataField("nextUpdate", customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextUpdateTime;
 }
index 41f44f672beebd9c44f0e40819b952bc74d49bcb..fe4d59b81a8f0450c72617a68dd730127c0bfd16 100644 (file)
@@ -42,7 +42,7 @@ public sealed class ClaimSalvageMessage : BoundUserInterfaceMessage
 /// <summary>
 /// Added per station to store data on their available salvage missions.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 public sealed partial class SalvageExpeditionDataComponent : Component
 {
     /// <summary>
@@ -61,6 +61,7 @@ public sealed partial class SalvageExpeditionDataComponent : Component
     /// Nexy time salvage missions are offered.
     /// </summary>
     [ViewVariables(VVAccess.ReadWrite), DataField("nextOffer", customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextOffer;
 
     [ViewVariables]
index 3070249eee2822ed5766c923ff0ffd5b1197edc9..c73237a366dbbf0188b694943d1e1e6c807feca0 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Shared.Salvage.Fulton;
 /// <summary>
 /// Marks an entity as pending being fultoned.
 /// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), AutoGenerateComponentPause]
 public sealed partial class FultonedComponent : Component
 {
     /// <summary>
@@ -26,6 +26,7 @@ public sealed partial class FultonedComponent : Component
     /// When the fulton is travelling to the beacon.
     /// </summary>
     [ViewVariables(VVAccess.ReadWrite), DataField("nextFulton", customTypeSerializer:typeof(TimeOffsetSerializer)), AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan NextFulton;
 
     [ViewVariables(VVAccess.ReadWrite), DataField("sound"), AutoNetworkedField]
index adaef16608e550b14138497efdc443883ec0eea1..0599482bbef706398f110192327a020f6101f927 100644 (file)
@@ -40,7 +40,6 @@ public abstract partial class SharedFultonSystem : EntitySystem
 
         SubscribeLocalEvent<FultonedDoAfterEvent>(OnFultonDoAfter);
 
-        SubscribeLocalEvent<FultonedComponent, EntityUnpausedEvent>(OnFultonUnpaused);
         SubscribeLocalEvent<FultonedComponent, GetVerbsEvent<InteractionVerb>>(OnFultonedGetVerbs);
         SubscribeLocalEvent<FultonedComponent, ExaminedEvent>(OnFultonedExamine);
         SubscribeLocalEvent<FultonedComponent, EntGotInsertedIntoContainerMessage>(OnFultonContainerInserted);
@@ -106,11 +105,6 @@ public abstract partial class SharedFultonSystem : EntitySystem
         Audio.PlayPredicted(fulton.FultonSound, args.Target.Value, args.User);
     }
 
-    private void OnFultonUnpaused(EntityUid uid, FultonedComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextFulton += args.PausedTime;
-    }
-
     private void OnFultonInteract(EntityUid uid, FultonComponent component, AfterInteractEvent args)
     {
         if (args.Target == null || args.Handled || !args.CanReach)
index 2aa081915beb760a935559848745070a3bf95034..106d790ccb62c56fba8df2c4cb728a33c8806b68 100644 (file)
@@ -10,7 +10,7 @@ namespace Content.Shared.Singularity.Components;
 /// Primarily managed by <see cref="SharedEventHorizonSystem"/> and its server/client versions.
 /// </summary>
 [Access(friends: typeof(SharedEventHorizonSystem))]
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
 public sealed partial class EventHorizonComponent : Component
 {
     /// <summary>
@@ -78,6 +78,7 @@ public sealed partial class EventHorizonComponent : Component
     /// The next time at which this consumed everything it overlapped with.
     /// </summary>
     [ViewVariables(VVAccess.ReadOnly), DataField("nextConsumeWaveTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextConsumeWaveTime;
 
     #endregion Update Timing
index f2c71ad120de999efcf00a17e65207eb3f3c64cd..a2cdd63ab70703b146c2808c619fa3c7731a8ab6 100644 (file)
@@ -3,7 +3,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
 namespace Content.Shared.Sound.Components;
 
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
 public sealed partial class EmitSoundOnCollideComponent : BaseEmitSoundComponent
 {
     public static readonly TimeSpan CollideCooldown = TimeSpan.FromSeconds(0.2);
@@ -18,5 +18,6 @@ public sealed partial class EmitSoundOnCollideComponent : BaseEmitSoundComponent
     /// To avoid sound spam add a cooldown to it.
     /// </summary>
     [ViewVariables(VVAccess.ReadWrite), DataField("nextSound", customTypeSerializer: typeof(TimeOffsetSerializer))]
+    [AutoPausedField]
     public TimeSpan NextSound;
 }
index 5e131a13554350fb1cc7ca09a70b3c2fb121fb60..22ba8e0e3eec2ebb1f5823f28bafe3da04488bc9 100644 (file)
@@ -42,7 +42,6 @@ public abstract class SharedEmitSoundSystem : EntitySystem
         SubscribeLocalEvent<EmitSoundOnPickupComponent, GotEquippedHandEvent>(OnEmitSoundOnPickup);
         SubscribeLocalEvent<EmitSoundOnDropComponent, DroppedEvent>(OnEmitSoundOnDrop);
 
-        SubscribeLocalEvent<EmitSoundOnCollideComponent, EntityUnpausedEvent>(OnEmitSoundUnpaused);
         SubscribeLocalEvent<EmitSoundOnCollideComponent, StartCollideEvent>(OnEmitSoundOnCollide);
     }
 
@@ -119,11 +118,6 @@ public abstract class SharedEmitSoundSystem : EntitySystem
         }
     }
 
-    private void OnEmitSoundUnpaused(EntityUid uid, EmitSoundOnCollideComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextSound += args.PausedTime;
-    }
-
     private void OnEmitSoundOnCollide(EntityUid uid, EmitSoundOnCollideComponent component, ref StartCollideEvent args)
     {
         if (!args.OurFixture.Hard ||
index c57b7c4e85a3575bc8c0b76010d48bd269bb295d..3467439a6da71eb343d8de447a8b34d0a771bd0a 100644 (file)
@@ -5,10 +5,11 @@ namespace Content.Server.Storage.Components;
 /// <summary>
 /// Applies an ongoing pickup area around the attached entity.
 /// </summary>
-[RegisterComponent]
+[RegisterComponent, AutoGenerateComponentPause]
 public sealed partial class MagnetPickupComponent : Component
 {
     [ViewVariables(VVAccess.ReadWrite), DataField("nextScan")]
+    [AutoPausedField]
     public TimeSpan NextScan = TimeSpan.Zero;
 
     /// <summary>
index 1703db25f3d97ffae2cee82eb2a08c29593e8248..21861f57dab20ad713b3fb4dce92c4df06b5ae02 100644 (file)
@@ -26,12 +26,6 @@ public sealed class MagnetPickupSystem : EntitySystem
         base.Initialize();
         _physicsQuery = GetEntityQuery<PhysicsComponent>();
         SubscribeLocalEvent<MagnetPickupComponent, MapInitEvent>(OnMagnetMapInit);
-        SubscribeLocalEvent<MagnetPickupComponent, EntityUnpausedEvent>(OnMagnetUnpaused);
-    }
-
-    private void OnMagnetUnpaused(EntityUid uid, MagnetPickupComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextScan += args.PausedTime;
     }
 
     private void OnMagnetMapInit(EntityUid uid, MagnetPickupComponent component, MapInitEvent args)
index 7a7bac83f40646b99da04b7f1cba17fabfb8899f..a080a83aaaf420ebb54a123d08f477e8b4350c3a 100644 (file)
@@ -11,7 +11,7 @@ namespace Content.Shared.Teleportation.Components;
 /// This is used for an entity that, when linked to another valid entity, allows the two to swap positions,
 /// additionally swapping the positions of the parents.
 /// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 [Access(typeof(SwapTeleporterSystem))]
 public sealed partial class SwapTeleporterComponent : Component
 {
@@ -37,6 +37,7 @@ public sealed partial class SwapTeleporterComponent : Component
     /// The time at which <see cref="Cooldown"/> ends and teleportation can occur again.
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan NextTeleportUse;
 
     /// <summary>
index e900700e115de0038c82fcb68bbd17506523f6d1..98a8955c7bc1003c970af82b748d36b284e7166a 100644 (file)
@@ -33,7 +33,6 @@ public sealed class SwapTeleporterSystem : EntitySystem
         SubscribeLocalEvent<SwapTeleporterComponent, ActivateInWorldEvent>(OnActivateInWorld);
         SubscribeLocalEvent<SwapTeleporterComponent, ExaminedEvent>(OnExamined);
 
-        SubscribeLocalEvent<SwapTeleporterComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<SwapTeleporterComponent, ComponentShutdown>(OnShutdown);
 
         _xformQuery = GetEntityQuery<TransformComponent>();
@@ -217,11 +216,6 @@ public sealed class SwapTeleporterSystem : EntitySystem
         }
     }
 
-    private void OnUnpaused(Entity<SwapTeleporterComponent> ent, ref EntityUnpausedEvent args)
-    {
-        ent.Comp.NextTeleportUse += args.PausedTime;
-    }
-
     private void OnShutdown(Entity<SwapTeleporterComponent> ent, ref ComponentShutdown args)
     {
         DestroyLink((ent, ent), null);
index ab80e079383620ae9f6ccb044f288e02f7c0ad21..16c9b13254cf099e54cc27f350454a66d95bb7b9 100644 (file)
@@ -5,7 +5,7 @@ using Robust.Shared.Timing;
 
 namespace Content.Shared.Throwing
 {
-    [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
+    [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), AutoGenerateComponentPause]
     public sealed partial class ThrownItemComponent : Component
     {
         /// <summary>
@@ -24,6 +24,7 @@ namespace Content.Shared.Throwing
         ///     Compared to <see cref="IGameTiming.CurTime"/> to land this entity, if any.
         /// </summary>
         [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
+        [AutoPausedField]
         public TimeSpan? LandTime;
 
         /// <summary>
index 8d84cf36fa2481d0bdcc2846f17011353230ae49..0f38c4d753383b3661eb37c4650ecce346c9aefe 100644 (file)
@@ -35,7 +35,6 @@ namespace Content.Shared.Throwing
             SubscribeLocalEvent<ThrownItemComponent, StartCollideEvent>(HandleCollision);
             SubscribeLocalEvent<ThrownItemComponent, PreventCollideEvent>(PreventCollision);
             SubscribeLocalEvent<ThrownItemComponent, ThrownEvent>(ThrowItem);
-            SubscribeLocalEvent<ThrownItemComponent, EntityUnpausedEvent>(OnThrownUnpaused);
 
             SubscribeLocalEvent<PullStartedMessage>(HandlePullStarted);
         }
@@ -59,14 +58,6 @@ namespace Content.Shared.Throwing
             _fixtures.TryCreateFixture(uid, shape, ThrowingFixture, hard: false, collisionMask: (int) CollisionGroup.ThrownItem, manager: fixturesComponent, body: body);
         }
 
-        private void OnThrownUnpaused(EntityUid uid, ThrownItemComponent component, ref EntityUnpausedEvent args)
-        {
-            if (component.LandTime != null)
-            {
-                component.LandTime = component.LandTime.Value + args.PausedTime;
-            }
-        }
-
         private void HandleCollision(EntityUid uid, ThrownItemComponent component, ref StartCollideEvent args)
         {
             if (!args.OtherFixture.Hard)
index 784fd6632f77268c83296647c0ab750e73acee47..1560d4dd0b92990a583c00046f3309e3183e5e39 100644 (file)
@@ -10,7 +10,7 @@ namespace Content.Shared.Timing;
 /// Currently it only supports a single delay per entity, this means that for things that have two delay interactions they will share one timer, so this can cause issues. For example, the bible has a delay when opening the storage UI and when applying it's interaction effect, and they share the same delay.
 /// </remarks>
 [RegisterComponent]
-[NetworkedComponent, AutoGenerateComponentState]
+[NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 [Access(typeof(UseDelaySystem))]
 public sealed partial class UseDelayComponent : Component
 {
@@ -18,12 +18,14 @@ public sealed partial class UseDelayComponent : Component
     /// When the delay starts.
     /// </summary>
     [ViewVariables(VVAccess.ReadWrite), DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan DelayStartTime;
 
     /// <summary>
     /// When the delay ends.
     /// </summary>
     [ViewVariables(VVAccess.ReadWrite), DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan DelayEndTime;
 
     /// <summary>
index 34f12fa55e2f3cd598bd666f23f4bc1d29a8babb..388f31079cdc7b6dd928ef3e970be38c9ef907c5 100644 (file)
@@ -7,19 +7,6 @@ public sealed class UseDelaySystem : EntitySystem
     [Dependency] private readonly IGameTiming _gameTiming = default!;
     [Dependency] private readonly MetaDataSystem _metadata = default!;
 
-    public override void Initialize()
-    {
-        SubscribeLocalEvent<UseDelayComponent, EntityUnpausedEvent>(OnUnpaused);
-    }
-
-    private void OnUnpaused(Entity<UseDelayComponent> ent, ref EntityUnpausedEvent args)
-    {
-        // We got unpaused, resume the delay
-        ent.Comp.DelayStartTime += args.PausedTime;
-        ent.Comp.DelayEndTime += args.PausedTime;
-        Dirty(ent);
-    }
-
     public void SetDelay(Entity<UseDelayComponent> ent, TimeSpan delay)
     {
         if (ent.Comp.Delay == delay)
index ef3b712f60ef954395f5bc0feae3f1ae5aaffa38..87ad6519d0760d2e052d3b5d1c3ca43609198fdb 100644 (file)
@@ -10,6 +10,7 @@ namespace Content.Shared.Weapons.Marker;
 /// Marks an entity to take additional damage
 /// </summary>
 [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(SharedDamageMarkerSystem))]
+[AutoGenerateComponentPause]
 public sealed partial class DamageMarkerComponent : Component
 {
     /// <summary>
@@ -34,5 +35,6 @@ public sealed partial class DamageMarkerComponent : Component
     public EntityUid Marker;
 
     [ViewVariables(VVAccess.ReadWrite), DataField("endTime", customTypeSerializer:typeof(TimeOffsetSerializer)), AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan EndTime;
 }
index 3a6afce363837f5c12529fd4d50f64d4da86f3fd..63b2d5f211512e16255ebf8d15b46072d206d5f8 100644 (file)
@@ -20,7 +20,6 @@ public abstract class SharedDamageMarkerSystem : EntitySystem
     {
         base.Initialize();
         SubscribeLocalEvent<DamageMarkerOnCollideComponent, StartCollideEvent>(OnMarkerCollide);
-        SubscribeLocalEvent<DamageMarkerComponent, EntityUnpausedEvent>(OnMarkerUnpaused);
         SubscribeLocalEvent<DamageMarkerComponent, AttackedEvent>(OnMarkerAttacked);
     }
 
@@ -54,11 +53,6 @@ public abstract class SharedDamageMarkerSystem : EntitySystem
         }
     }
 
-    private void OnMarkerUnpaused(EntityUid uid, DamageMarkerComponent component, ref EntityUnpausedEvent args)
-    {
-        component.EndTime += args.PausedTime;
-    }
-
     private void OnMarkerCollide(EntityUid uid, DamageMarkerOnCollideComponent component, ref StartCollideEvent args)
     {
         if (!args.OtherFixture.Hard ||
index 27c3a5f0dfa500f0b64b8d90bb89efc1d7a89d57..e5b35f6c0bb5b0c428d1f898e5a0515a2fb3feee 100644 (file)
@@ -10,7 +10,7 @@ namespace Content.Shared.Weapons.Melee;
 /// <summary>
 /// When given to a mob lets them do unarmed attacks, or when given to an item lets someone wield it to do attacks.
 /// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 public sealed partial class MeleeWeaponComponent : Component
 {
     // TODO: This is becoming bloated as shit.
@@ -33,6 +33,7 @@ public sealed partial class MeleeWeaponComponent : Component
     /// </summary>
     [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
     [ViewVariables(VVAccess.ReadWrite)]
+    [AutoPausedField]
     public TimeSpan NextAttack;
 
     /// <summary>
index 12455a1f49699a58bc9243f27f5a774388a07f61..6a5127f2c950163a335b2633efed878d417158fa 100644 (file)
@@ -68,7 +68,6 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
     {
         base.Initialize();
 
-        SubscribeLocalEvent<MeleeWeaponComponent, EntityUnpausedEvent>(OnMeleeUnpaused);
         SubscribeLocalEvent<MeleeWeaponComponent, HandSelectedEvent>(OnMeleeSelected);
         SubscribeLocalEvent<MeleeWeaponComponent, ShotAttemptedEvent>(OnMeleeShotAttempted);
         SubscribeLocalEvent<MeleeWeaponComponent, GunShotEvent>(OnMeleeShot);
@@ -112,11 +111,6 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
         }
     }
 
-    private void OnMeleeUnpaused(EntityUid uid, MeleeWeaponComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextAttack += args.PausedTime;
-    }
-
     private void OnMeleeSelected(EntityUid uid, MeleeWeaponComponent component, HandSelectedEvent args)
     {
         var attackRate = GetAttackRate(uid, args.User, component);
index 8d7d548ad8fc42b6c29448413e9a0497b16ee785..5a335e7e5c72e862ee5319ea02364ff7554537fd 100644 (file)
@@ -9,7 +9,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
 namespace Content.Shared.Weapons.Ranged.Components;
 
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 [Access(typeof(SharedGunSystem))]
 public sealed partial class GunComponent : Component
 {
@@ -198,6 +198,7 @@ public sealed partial class GunComponent : Component
     /// </summary>
     [DataField(customTypeSerializer:typeof(TimeOffsetSerializer))]
     [AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan NextFire = TimeSpan.Zero;
 
     /// <summary>
index 923f95e2079e9f8b313eb580474229a0a1de8f1e..f478405bec5aa5184bb9aeac3af5dca605d95d03 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Shared.Weapons.Ranged.Components;
 /// <summary>
 ///     Responsible for handling recharging a basic entity ammo provider over time.
 /// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
 public sealed partial class RechargeBasicEntityAmmoComponent : Component
 {
     [ViewVariables(VVAccess.ReadWrite)]
@@ -25,5 +25,6 @@ public sealed partial class RechargeBasicEntityAmmoComponent : Component
     [ViewVariables(VVAccess.ReadWrite),
      DataField("nextCharge", customTypeSerializer:typeof(TimeOffsetSerializer)),
     AutoNetworkedField]
+    [AutoPausedField]
     public TimeSpan? NextCharge;
 }
index 536f3da8112e50a822d66b4019a6b4cf7b25b33d..b774c8ab450dab8022fafcbbdce7a51fadf5c59d 100644 (file)
@@ -21,19 +21,10 @@ public sealed class RechargeBasicEntityAmmoSystem : EntitySystem
     {
         base.Initialize();
 
-        SubscribeLocalEvent<RechargeBasicEntityAmmoComponent, EntityUnpausedEvent>(OnUnpaused);
         SubscribeLocalEvent<RechargeBasicEntityAmmoComponent, MapInitEvent>(OnInit);
         SubscribeLocalEvent<RechargeBasicEntityAmmoComponent, ExaminedEvent>(OnExamined);
     }
 
-    private void OnUnpaused(EntityUid uid, RechargeBasicEntityAmmoComponent component, ref EntityUnpausedEvent args)
-    {
-        if (component.NextCharge == null)
-            return;
-
-        component.NextCharge = component.NextCharge.Value + args.PausedTime;
-    }
-
     public override void Update(float frameTime)
     {
         base.Update(frameTime);
index ba22ba2cdc8fe0cd5e172d346bee2c9a0b65a60e..71e3e80764f002485e68bcc8c727faeba54f16bb 100644 (file)
@@ -94,7 +94,6 @@ public abstract partial class SharedGunSystem : EntitySystem
         SubscribeLocalEvent<GunComponent, ExaminedEvent>(OnExamine);
         SubscribeLocalEvent<GunComponent, CycleModeEvent>(OnCycleMode);
         SubscribeLocalEvent<GunComponent, HandSelectedEvent>(OnGunSelected);
-        SubscribeLocalEvent<GunComponent, EntityUnpausedEvent>(OnGunUnpaused);
         SubscribeLocalEvent<GunComponent, MapInitEvent>(OnMapInit);
     }
 
@@ -122,11 +121,6 @@ public abstract partial class SharedGunSystem : EntitySystem
         }
     }
 
-    private void OnGunUnpaused(EntityUid uid, GunComponent component, ref EntityUnpausedEvent args)
-    {
-        component.NextFire += args.PausedTime;
-    }
-
     private void OnShootRequest(RequestShootEvent msg, EntitySessionEventArgs args)
     {
         var user = args.SenderSession.AttachedEntity;
index 5a05a09e359e8f71c4a3ffb871faf1e621c0fac0..e0cb455a6db2559c5efd3274b704b9f4be071cf3 100644 (file)
@@ -129,6 +129,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Content.PatreonParser", "Co
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Robust.Analyzers.Tests", "RobustToolbox\Robust.Analyzers.Tests\Robust.Analyzers.Tests.csproj", "{83F510FE-9B50-4D96-AFAB-CC13998D6AFE}"
 EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Roslyn", "Roslyn", "{7844DA69-B0F0-49FB-A05E-ECA37372277A}"
+       ProjectSection(SolutionItems) = preProject
+               RobustToolbox\Robust.Roslyn.Shared\Robust.Roslyn.Shared.props = RobustToolbox\Robust.Roslyn.Shared\Robust.Roslyn.Shared.props
+       EndProjectSection
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Any CPU = Debug|Any CPU
@@ -457,20 +462,21 @@ Global
                {41B450C0-A361-4CD7-8121-7072B8995CFC} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
                {7B9472D3-79D4-48D1-9B22-BCDE518FE842} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
                {1FAE651D-29D8-437A-9864-47CE0D180016} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
-               {3CFEB7DB-12C6-46F3-89FC-1450F3016FFA} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
                {8922428F-17C3-47A7-BFE9-570DEB2464DA} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
                {16F7DE32-0186-44B9-9345-0C20D1BF2422} = {AFF53804-115F-4E67-B81F-26265EA27880}
                {AFF53804-115F-4E67-B81F-26265EA27880} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
                {23F09C45-950E-4DB7-A465-E937450FF008} = {AFF53804-115F-4E67-B81F-26265EA27880}
                {440426C1-8DCA-43F6-967F-94439B8DAF47} = {AFF53804-115F-4E67-B81F-26265EA27880}
-               {88B0FC0F-7209-40E2-AF16-EB90AF727C5B} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
                {A3C5B00A-D232-4A01-B82E-B0E58BFD5C12} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
                {8A21C7CA-2EB8-40E5-8043-33582C06D139} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
                {952AAF2A-DF63-4A7D-8094-3453893EBA80} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
                {A965CB3B-FD31-44AF-8872-85ABA436098D} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
-               {07CA34A1-1D37-4771-A2E3-495A1044AE0B} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
-               {6FBF108E-5CB5-47DE-8D7E-B496ABA9E3E2} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
-               {83F510FE-9B50-4D96-AFAB-CC13998D6AFE} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
+               {7844DA69-B0F0-49FB-A05E-ECA37372277A} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE}
+               {3CFEB7DB-12C6-46F3-89FC-1450F3016FFA} = {7844DA69-B0F0-49FB-A05E-ECA37372277A}
+               {6FBF108E-5CB5-47DE-8D7E-B496ABA9E3E2} = {7844DA69-B0F0-49FB-A05E-ECA37372277A}
+               {07CA34A1-1D37-4771-A2E3-495A1044AE0B} = {7844DA69-B0F0-49FB-A05E-ECA37372277A}
+               {88B0FC0F-7209-40E2-AF16-EB90AF727C5B} = {7844DA69-B0F0-49FB-A05E-ECA37372277A}
+               {83F510FE-9B50-4D96-AFAB-CC13998D6AFE} = {7844DA69-B0F0-49FB-A05E-ECA37372277A}
        EndGlobalSection
        GlobalSection(ExtensibilityGlobals) = postSolution
                SolutionGuid = {AA37ED9F-F8D6-468E-A101-658AD605B09A}