diff --git a/Content.Server/GameObjects/Components/ActionBlocking/HandcuffComponent.cs b/Content.Server/GameObjects/Components/ActionBlocking/HandcuffComponent.cs index 864d4e58d4..8fb013e5ea 100644 --- a/Content.Server/GameObjects/Components/ActionBlocking/HandcuffComponent.cs +++ b/Content.Server/GameObjects/Components/ActionBlocking/HandcuffComponent.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Content.Server.GameObjects.Components.GUI; using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.EntitySystems.DoAfter; @@ -146,7 +147,7 @@ namespace Content.Server.GameObjects.Components.ActionBlocking return new HandcuffedComponentState(Broken ? BrokenState : string.Empty); } - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { if (eventArgs.Target == null || !ActionBlockerSystem.CanUse(eventArgs.User) || !eventArgs.Target.TryGetComponent(out var cuffed)) { diff --git a/Content.Server/GameObjects/Components/Atmos/GasAnalyzerComponent.cs b/Content.Server/GameObjects/Components/Atmos/GasAnalyzerComponent.cs index 1f86632d0c..4f3c527292 100644 --- a/Content.Server/GameObjects/Components/Atmos/GasAnalyzerComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/GasAnalyzerComponent.cs @@ -20,6 +20,7 @@ using Robust.Shared.Localization; using Robust.Shared.Map; using Robust.Shared.ViewVariables; using System.Collections.Generic; +using System.Threading.Tasks; namespace Content.Server.GameObjects.Components.Atmos { @@ -252,7 +253,7 @@ namespace Content.Server.GameObjects.Components.Atmos } } - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { if (!eventArgs.CanReach) { diff --git a/Content.Server/GameObjects/Components/Body/MechanismComponent.cs b/Content.Server/GameObjects/Components/Body/MechanismComponent.cs index 9a419c2e86..1ff3f77f52 100644 --- a/Content.Server/GameObjects/Components/Body/MechanismComponent.cs +++ b/Content.Server/GameObjects/Components/Body/MechanismComponent.cs @@ -1,5 +1,6 @@ #nullable enable using System.Collections.Generic; +using System.Threading.Tasks; using Content.Server.Utility; using Content.Shared.GameObjects.Components.Body; using Content.Shared.GameObjects.Components.Body.Mechanism; @@ -35,7 +36,7 @@ namespace Content.Server.GameObjects.Components.Body } } - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { if (eventArgs.Target == null) { diff --git a/Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs b/Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs index 13fec9b2ad..450d400c40 100644 --- a/Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs +++ b/Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs @@ -1,6 +1,7 @@ #nullable enable using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Content.Server.Commands; using Content.Server.Utility; using Content.Shared.GameObjects.Components.Body; @@ -96,7 +97,7 @@ namespace Content.Server.GameObjects.Components.Body.Part } } - public void AfterInteract(AfterInteractEventArgs eventArgs) + public async Task AfterInteract(AfterInteractEventArgs eventArgs) { // TODO BODY if (eventArgs.Target == null) diff --git a/Content.Server/GameObjects/Components/Body/SurgeryToolComponent.cs b/Content.Server/GameObjects/Components/Body/SurgeryToolComponent.cs index afa088a27c..9f350893ac 100644 --- a/Content.Server/GameObjects/Components/Body/SurgeryToolComponent.cs +++ b/Content.Server/GameObjects/Components/Body/SurgeryToolComponent.cs @@ -1,6 +1,7 @@ #nullable enable using System; using System.Collections.Generic; +using System.Threading.Tasks; using Content.Server.Utility; using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components.Body; @@ -48,7 +49,7 @@ namespace Content.Server.GameObjects.Components.Body [ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(SurgeryUIKey.Key); - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { if (eventArgs.Target == null) { diff --git a/Content.Server/GameObjects/Components/Chemistry/InjectorComponent.cs b/Content.Server/GameObjects/Components/Chemistry/InjectorComponent.cs index f14836feeb..2f59c9fad5 100644 --- a/Content.Server/GameObjects/Components/Chemistry/InjectorComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/InjectorComponent.cs @@ -1,5 +1,6 @@ #nullable enable using System; +using System.Threading.Tasks; using Content.Server.GameObjects.Components.Body.Circulatory; using Content.Shared.Chemistry; using Content.Shared.GameObjects.Components.Chemistry; @@ -106,7 +107,7 @@ namespace Content.Server.GameObjects.Components.Chemistry /// Called when clicking on entities while holding in active hand /// /// - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { if (!eventArgs.InRangeUnobstructed(ignoreInsideBlocker: true, popup: true)) return; diff --git a/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs b/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs index d8d071ddff..638257ac8a 100644 --- a/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Threading.Tasks; using Content.Server.GameObjects.Components.Body.Behavior; using Content.Server.GameObjects.Components.Nutrition; using Content.Server.GameObjects.Components.Utensil; @@ -59,7 +60,7 @@ namespace Content.Server.GameObjects.Components.Chemistry } // Feeding someone else - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + public async Task AfterInteract(AfterInteractEventArgs eventArgs) { if (eventArgs.Target == null) { diff --git a/Content.Server/GameObjects/Components/CrayonComponent.cs b/Content.Server/GameObjects/Components/CrayonComponent.cs index 5355bc01cd..5c0067a4f7 100644 --- a/Content.Server/GameObjects/Components/CrayonComponent.cs +++ b/Content.Server/GameObjects/Components/CrayonComponent.cs @@ -18,6 +18,7 @@ using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; using System.Linq; +using System.Threading.Tasks; namespace Content.Server.GameObjects.Components { @@ -108,7 +109,7 @@ namespace Content.Server.GameObjects.Components return false; } - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { if (!eventArgs.InRangeUnobstructed(ignoreInsideBlocker: false, popup: true, collisionMask: Shared.Physics.CollisionGroup.MobImpassable)) return; diff --git a/Content.Server/GameObjects/Components/Fluids/MopComponent.cs b/Content.Server/GameObjects/Components/Fluids/MopComponent.cs index 47260bb4d8..ad6e85b951 100644 --- a/Content.Server/GameObjects/Components/Fluids/MopComponent.cs +++ b/Content.Server/GameObjects/Components/Fluids/MopComponent.cs @@ -9,6 +9,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Localization; using Robust.Shared.Serialization; +using System.Threading.Tasks; namespace Content.Server.GameObjects.Components.Fluids { @@ -61,7 +62,7 @@ namespace Content.Server.GameObjects.Components.Fluids Owner.EnsureComponentWarn(out SolutionContainerComponent _); } - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { if (!Owner.TryGetComponent(out SolutionContainerComponent? contents)) return; if (!eventArgs.InRangeUnobstructed(ignoreInsideBlocker: true, popup: true)) return; diff --git a/Content.Server/GameObjects/Components/Fluids/SprayComponent.cs b/Content.Server/GameObjects/Components/Fluids/SprayComponent.cs index 1e90818ece..5d0c4ef416 100644 --- a/Content.Server/GameObjects/Components/Fluids/SprayComponent.cs +++ b/Content.Server/GameObjects/Components/Fluids/SprayComponent.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Content.Server.GameObjects.Components.Chemistry; using Content.Shared.Audio; using Content.Shared.Chemistry; @@ -98,7 +99,7 @@ namespace Content.Server.GameObjects.Components.Fluids serializer.DataField(ref _safety, "safety", true); } - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { if (!ActionBlockerSystem.CanInteract(eventArgs.User)) return; diff --git a/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs b/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs index 5b0fdd854a..3099b9779c 100644 --- a/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs @@ -8,6 +8,7 @@ using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Serialization; +using System.Threading.Tasks; namespace Content.Server.GameObjects.Components.Interactable { @@ -20,7 +21,7 @@ namespace Content.Server.GameObjects.Components.Interactable public override string Name => "TilePrying"; private bool _toolComponentNeeded = true; - public void AfterInteract(AfterInteractEventArgs eventArgs) + public async Task AfterInteract(AfterInteractEventArgs eventArgs) { TryPryTile(eventArgs.User, eventArgs.ClickLocation); } diff --git a/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs b/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs index cf504d52c6..57969eda49 100644 --- a/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs +++ b/Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs @@ -12,6 +12,7 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Serialization; using System.Collections.Generic; +using System.Threading.Tasks; namespace Content.Server.GameObjects.Components.Items { @@ -55,7 +56,7 @@ namespace Content.Server.GameObjects.Components.Items EntitySystem.Get().PlayAtCoords("/Audio/Items/genhit.ogg", location, AudioHelpers.WithVariation(0.125f)); } - public void AfterInteract(AfterInteractEventArgs eventArgs) + public async Task AfterInteract(AfterInteractEventArgs eventArgs) { if (!eventArgs.InRangeUnobstructed(ignoreInsideBlocker: true, popup: true)) return; if (!Owner.TryGetComponent(out StackComponent stack)) return; diff --git a/Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs b/Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs index 728d5a6a09..b79f422205 100644 --- a/Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs +++ b/Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Content.Server.Interfaces.GameObjects.Components.Items; using Content.Shared.GameObjects.EntitySystems; using Content.Shared.Interfaces; @@ -31,7 +32,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD message.AddMarkup(Loc.GetString("It holds {0} charges.", refillAmmo)); } - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + public async Task AfterInteract(AfterInteractEventArgs eventArgs) { if (eventArgs.Target == null || !eventArgs.Target.TryGetComponent(out RCDComponent rcdComponent) || !eventArgs.User.TryGetComponent(out IHandsComponent hands)) { diff --git a/Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs b/Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs index 88c3f711ab..bef07051db 100644 --- a/Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs +++ b/Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs @@ -1,5 +1,6 @@ using System; using System.Threading; +using System.Threading.Tasks; using Content.Server.GameObjects.EntitySystems.DoAfter; using Content.Shared.GameObjects.EntitySystems; using Content.Shared.Interfaces; @@ -93,7 +94,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD message.AddMarkup(Loc.GetString("It's currently on {0} mode, and holds {1} charges.",_mode.ToString(), _ammo)); } - public async void AfterInteract(AfterInteractEventArgs eventArgs) + public async Task AfterInteract(AfterInteractEventArgs eventArgs) { //No changing mode mid-RCD var startingMode = _mode; diff --git a/Content.Server/GameObjects/Components/Medical/HealingComponent.cs b/Content.Server/GameObjects/Components/Medical/HealingComponent.cs index dd7d77698d..f717e831de 100644 --- a/Content.Server/GameObjects/Components/Medical/HealingComponent.cs +++ b/Content.Server/GameObjects/Components/Medical/HealingComponent.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Threading.Tasks; using Content.Server.GameObjects.Components.Stack; using Content.Shared.Damage; using Content.Shared.GameObjects.Components.Damage; @@ -24,7 +25,7 @@ namespace Content.Server.GameObjects.Components.Medical serializer.DataField(this, h => h.Heal, "heal", new Dictionary()); } - public void AfterInteract(AfterInteractEventArgs eventArgs) + public async Task AfterInteract(AfterInteractEventArgs eventArgs) { if (eventArgs.Target == null) { diff --git a/Content.Server/GameObjects/Components/Nutrition/DrinkComponent.cs b/Content.Server/GameObjects/Components/Nutrition/DrinkComponent.cs index 709bc3bf32..0507646acb 100644 --- a/Content.Server/GameObjects/Components/Nutrition/DrinkComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/DrinkComponent.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Threading.Tasks; using Content.Server.GameObjects.Components.Body.Behavior; using Content.Server.GameObjects.Components.Chemistry; using Content.Server.GameObjects.Components.Fluids; @@ -113,7 +114,7 @@ namespace Content.Server.GameObjects.Components.Nutrition } //Force feeding a drink to someone. - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { TryUseDrink(eventArgs.Target, forced: true); } diff --git a/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs b/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs index 071866c0df..bea683e309 100644 --- a/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Content.Server.GameObjects.Components.Body.Behavior; using Content.Server.GameObjects.Components.Chemistry; using Content.Server.GameObjects.Components.GUI; @@ -103,7 +104,7 @@ namespace Content.Server.GameObjects.Components.Nutrition } // Feeding someone else - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { if (eventArgs.Target == null) { diff --git a/Content.Server/GameObjects/Components/Portal/TeleporterComponent.cs b/Content.Server/GameObjects/Components/Portal/TeleporterComponent.cs index cc0f0bf0c9..f53d4b8f1d 100644 --- a/Content.Server/GameObjects/Components/Portal/TeleporterComponent.cs +++ b/Content.Server/GameObjects/Components/Portal/TeleporterComponent.cs @@ -1,6 +1,7 @@ #nullable enable using System; using System.Linq; +using System.Threading.Tasks; using Content.Shared.GameObjects.Components.Portal; using Content.Shared.Interfaces.GameObjects.Components; using Robust.Server.GameObjects; @@ -22,7 +23,7 @@ using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Portal { [RegisterComponent] - public class TeleporterComponent : Component, IAfterInteract + public class TeleporterComponent : Component, IAfterInteract { [Dependency] private readonly IServerEntityManager _serverEntityManager = default!; [Dependency] private readonly IRobustRandom _spreadRandom = default!; @@ -77,7 +78,7 @@ namespace Content.Server.GameObjects.Components.Portal _state = newState; } - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { if (_teleporterType == TeleporterType.Directed) { diff --git a/Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs b/Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs index feb36ce473..0330bd1c4a 100644 --- a/Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs +++ b/Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs @@ -8,6 +8,7 @@ using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; +using System.Threading.Tasks; namespace Content.Server.GameObjects.Components.Power { @@ -33,7 +34,7 @@ namespace Content.Server.GameObjects.Components.Power } /// - public void AfterInteract(AfterInteractEventArgs eventArgs) + public async Task AfterInteract(AfterInteractEventArgs eventArgs) { if (!eventArgs.InRangeUnobstructed(ignoreInsideBlocker: true, popup: true)) return; if(!_mapManager.TryGetGrid(eventArgs.ClickLocation.GetGridId(Owner.EntityManager), out var grid)) diff --git a/Content.Server/GameObjects/Components/Utensil/UtensilComponent.cs b/Content.Server/GameObjects/Components/Utensil/UtensilComponent.cs index 1d52b2e8af..870931026e 100644 --- a/Content.Server/GameObjects/Components/Utensil/UtensilComponent.cs +++ b/Content.Server/GameObjects/Components/Utensil/UtensilComponent.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using Content.Server.GameObjects.Components.Nutrition; using Content.Shared.GameObjects.Components.Utensil; using Content.Shared.Interfaces.GameObjects.Components; @@ -104,7 +105,7 @@ namespace Content.Server.GameObjects.Components.Utensil serializer.DataField(ref _breakSound, "breakSound", "/Audio/Items/snap.ogg"); } - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { TryUseUtensil(eventArgs.User, eventArgs.Target); } diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/SpeedLoaderComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/SpeedLoaderComponent.cs index 86c7ab25c7..f674459c2a 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/SpeedLoaderComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/SpeedLoaderComponent.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Content.Server.GameObjects.Components.GUI; using Content.Server.GameObjects.Components.Items.Storage; @@ -146,7 +146,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition return entity; } - void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) + async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) { if (eventArgs.Target == null) { diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index b1cb6b286c..f2ac56a7f7 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -466,7 +466,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click foreach (var afterAttack in afterAttacks) { - afterAttack.AfterInteract(afterAttackEventArgs); + await afterAttack.AfterInteract(afterAttackEventArgs); } } diff --git a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs index 55ca853924..8225b0d4e9 100644 --- a/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs +++ b/Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using JetBrains.Annotations; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; @@ -16,7 +17,7 @@ namespace Content.Shared.Interfaces.GameObjects.Components /// /// Called when we interact with nothing, or when we interact with an entity out of range that has no behavior /// - void AfterInteract(AfterInteractEventArgs eventArgs); + Task AfterInteract(AfterInteractEventArgs eventArgs); } public class AfterInteractEventArgs : EventArgs