]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Content audio (#20862)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sun, 29 Oct 2023 03:58:23 +0000 (14:58 +1100)
committerGitHub <noreply@github.com>
Sun, 29 Oct 2023 03:58:23 +0000 (14:58 +1100)
326 files changed:
Content.Client/Access/AccessOverlay.cs
Content.Client/Access/Commands/ShowAccessReadersCommand.cs
Content.Client/Administration/AdminNameOverlay.cs
Content.Client/Administration/Systems/AdminSystem.Overlay.cs
Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs
Content.Client/Arcade/BlockGameMenu.cs
Content.Client/Atmos/EntitySystems/GasTileOverlaySystem.cs
Content.Client/Atmos/Overlays/GasTileOverlay.cs
Content.Client/Audio/AmbientSoundSystem.cs
Content.Client/Audio/BackgroundAudioSystem.cs
Content.Client/Audio/ClientGlobalSoundSystem.cs
Content.Client/Audio/ContentAudioSystem.AmbientMusic.cs
Content.Client/Audio/ContentAudioSystem.cs
Content.Client/Changelog/ChangelogTab.xaml.cs
Content.Client/Clickable/ClickMapManager.cs
Content.Client/Clothing/ClientClothingSystem.cs
Content.Client/Credits/CreditsWindow.xaml.cs
Content.Client/Decals/UI/PaletteColorPicker.xaml.cs
Content.Client/Disposal/Systems/DisposalUnitSystem.cs
Content.Client/Doors/DoorSystem.cs
Content.Client/Explosion/ExplosionOverlaySystem.cs
Content.Client/Fax/AdminUI/AdminFaxWindow.xaml.cs
Content.Client/Fluids/PuddleOverlay.cs
Content.Client/GameTicking/Managers/ClientGameTicker.cs
Content.Client/Gravity/GravitySystem.Shake.cs
Content.Client/Guidebook/GuidebookSystem.cs
Content.Client/Info/RulesAndInfoWindow.cs
Content.Client/IoC/StaticIoC.cs
Content.Client/Items/Systems/ItemSystem.cs
Content.Client/Light/Components/ExpendableLightComponent.cs
Content.Client/Light/EntitySystems/ExpendableLightSystem.cs
Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs
Content.Client/Lobby/LobbyState.cs
Content.Client/MainMenu/MainMenu.cs
Content.Client/MainMenu/UI/MainMenuControl.xaml.cs
Content.Client/NPC/HTN/HTNOverlay.cs
Content.Client/NPC/HTN/HTNSystem.cs
Content.Client/NPC/PathfindingSystem.cs
Content.Client/NodeContainer/NodeGroupSystem.cs
Content.Client/NodeContainer/NodeVisualizationOverlay.cs
Content.Client/Options/UI/Tabs/AudioTab.xaml.cs
Content.Client/Paper/UI/PaperWindow.xaml.cs
Content.Client/Paper/UI/StampWidget.xaml.cs
Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs
Content.Client/ParticleAccelerator/UI/ParticleAcceleratorControlMenu.cs
Content.Client/Pinpointer/UI/NavMapControl.cs
Content.Client/Popups/PopupOverlay.cs
Content.Client/Popups/PopupSystem.cs
Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs
Content.Client/Radiation/Overlays/RadiationDebugOverlay.cs
Content.Client/Replay/ContentReplayPlaybackManager.cs
Content.Client/Replay/UI/Loading/LoadingScreen.cs
Content.Client/Replay/UI/Loading/LoadingScreenControl.xaml.cs
Content.Client/Resources/ResourceCacheExtensions.cs
Content.Client/SprayPainter/SprayPainterSystem.cs
Content.Client/Stylesheets/StyleBase.cs
Content.Client/Stylesheets/StyleNano.cs
Content.Client/Stylesheets/StyleSpace.cs
Content.Client/Stylesheets/StylesheetManager.cs
Content.Client/SurveillanceCamera/UI/SurveillanceCameraMonitorWindow.xaml.cs
Content.Client/Traits/ParacusiaSystem.cs
Content.Client/Trigger/TimerTriggerVisualizerSystem.cs
Content.Client/UserInterface/Controls/FancyTree/FancyTree.xaml.cs
Content.Client/UserInterface/Systems/Atmos/GasTank/GasTankWindow.cs
Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs
Content.Client/UserInterface/Systems/Chat/Controls/ChannelFilterButton.cs
Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
Content.Client/UserInterface/XamlExtensions/TextureExtension.cs
Content.Client/Voting/VoteManager.cs
Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs
Content.Client/Weather/WeatherOverlay.cs
Content.Client/Weather/WeatherSystem.cs
Content.Client/Wires/UI/WiresMenu.cs
Content.IntegrationTests/Tests/Destructible/DestructibleThresholdActivationTest.cs
Content.IntegrationTests/Tests/DummyIconTest.cs
Content.IntegrationTests/Tests/Interaction/InteractionTest.Helpers.cs
Content.MapRenderer/Painters/DecalPainter.cs
Content.MapRenderer/Painters/EntityPainter.cs
Content.MapRenderer/Painters/TilePainter.cs
Content.Replay/Menu/ReplayMainMenu.cs
Content.Replay/Menu/ReplayMainMenuControl.xaml.cs
Content.Server/Access/Systems/AccessOverriderSystem.cs
Content.Server/Administration/Systems/AdminSystem.cs
Content.Server/AlertLevel/AlertLevelSystem.cs
Content.Server/Ame/EntitySystems/AmeControllerSystem.cs
Content.Server/Ame/EntitySystems/AmePartSystem.cs
Content.Server/Animals/Systems/EggLayerSystem.cs
Content.Server/Anomaly/AnomalySystem.Generator.cs
Content.Server/Anomaly/AnomalySystem.cs
Content.Server/Anomaly/Components/GeneratingAnomalyGeneratorComponent.cs
Content.Server/Anomaly/Effects/BluespaceAnomalySystem.cs
Content.Server/Anomaly/Effects/ReagentProducerAnomalySystem.cs
Content.Server/Antag/AntagSelectionSystem.cs
Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs
Content.Server/Arcade/SpaceVillainGame/SpaceVillainGame.cs
Content.Server/Atmos/Components/GasTankComponent.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs
Content.Server/Atmos/EntitySystems/GasTankSystem.cs
Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs
Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs
Content.Server/Audio/ContentAudioSystem.cs
Content.Server/Beam/BeamSystem.cs
Content.Server/Bed/Sleep/SleepingSystem.cs
Content.Server/Bible/BibleSystem.cs
Content.Server/Body/Systems/BloodstreamSystem.cs
Content.Server/Body/Systems/BodySystem.cs
Content.Server/Botany/Systems/PlantHolderSystem.cs
Content.Server/CardboardBox/CardboardBoxSystem.cs
Content.Server/Cargo/Systems/CargoSystem.cs
Content.Server/CartridgeLoader/Cartridges/NetProbeCartridgeSystem.cs
Content.Server/Chat/Systems/ChatSystem.cs
Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs
Content.Server/Chemistry/EntitySystems/ChemistrySystem.cs
Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs
Content.Server/Chemistry/ReactionEffects/AreaReactionEffect.cs
Content.Server/Cloning/CloningSystem.cs
Content.Server/Cluwne/CluwneSystem.cs
Content.Server/Construction/Completions/PlaySound.cs
Content.Server/Construction/Components/PartExchangerComponent.cs
Content.Server/Construction/PartExchangerSystem.cs
Content.Server/Crayon/CrayonSystem.cs
Content.Server/Damage/Systems/DamageOnHighSpeedImpactSystem.cs
Content.Server/Defusable/Systems/DefusableSystem.cs
Content.Server/Destructible/DestructibleSystem.cs
Content.Server/Destructible/Thresholds/Behaviors/PlaySoundBehavior.cs
Content.Server/DeviceLinking/Systems/DeviceLinkOverloadSystem.cs
Content.Server/DeviceLinking/Systems/LogicGateSystem.cs
Content.Server/DeviceLinking/Systems/SignalSwitchSystem.cs
Content.Server/DeviceLinking/Systems/SignalTimerSystem.cs
Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs
Content.Server/Dice/DiceSystem.cs
Content.Server/Disposal/Tube/DisposalTubeSystem.cs
Content.Server/Dragon/DragonRiftSystem.cs
Content.Server/Dragon/DragonSystem.cs
Content.Server/Electrocution/ElectrocutionSystem.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.Visuals.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Content.Server/Extinguisher/FireExtinguisherSystem.cs
Content.Server/Fax/FaxSystem.cs
Content.Server/Flash/FlashSystem.cs
Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs
Content.Server/Fluids/EntitySystems/DrainSystem.cs
Content.Server/Fluids/EntitySystems/PuddleSystem.cs
Content.Server/Fluids/EntitySystems/SpraySystem.cs
Content.Server/Forensics/Systems/ForensicScannerSystem.cs
Content.Server/GameTicking/GameTicker.Player.cs
Content.Server/GameTicking/GameTicker.RoundFlow.cs
Content.Server/GameTicking/GameTicker.cs
Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs
Content.Server/GameTicking/Rules/PiratesRuleSystem.cs
Content.Server/GameTicking/Rules/TraitorRuleSystem.cs
Content.Server/GameTicking/Rules/ZombieRuleSystem.cs
Content.Server/Gateway/Systems/GatewaySystem.cs
Content.Server/Gatherable/GatherableSystem.cs
Content.Server/Glue/GlueSystem.cs
Content.Server/Guardian/GuardianSystem.cs
Content.Server/Holiday/Christmas/RandomGiftSystem.cs
Content.Server/IgnitionSource/IgniteOnTriggerSystem.cs
Content.Server/ImmovableRod/ImmovableRodSystem.cs
Content.Server/Interaction/InteractionPopupSystem.cs
Content.Server/Item/ItemToggleSystem.cs
Content.Server/Kitchen/Components/MicrowaveComponent.cs
Content.Server/Kitchen/Components/ReagentGrinderComponent.cs
Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs
Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs
Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs
Content.Server/Lathe/LatheSystem.cs
Content.Server/Light/EntitySystems/ExpendableLightSystem.cs
Content.Server/Light/EntitySystems/HandheldLightSystem.cs
Content.Server/Light/EntitySystems/LightBulbSystem.cs
Content.Server/Light/EntitySystems/LightReplacerSystem.cs
Content.Server/Light/EntitySystems/MatchstickSystem.cs
Content.Server/Light/EntitySystems/PoweredLightSystem.cs
Content.Server/Light/EntitySystems/UnpoweredFlashlightSystem.cs
Content.Server/Lube/LubeSystem.cs
Content.Server/Magic/MagicSystem.cs
Content.Server/MassMedia/Systems/NewsSystem.cs
Content.Server/Materials/MaterialStorageSystem.cs
Content.Server/Mech/Equipment/Components/MechGrabberComponent.cs
Content.Server/Mech/Equipment/EntitySystems/MechGrabberSystem.cs
Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs
Content.Server/Medical/DefibrillatorSystem.cs
Content.Server/Medical/HealingSystem.cs
Content.Server/Medical/HealthAnalyzerSystem.cs
Content.Server/Medical/VomitSystem.cs
Content.Server/Mind/MindSystem.cs
Content.Server/Morgue/CrematoriumSystem.cs
Content.Server/Morgue/MorgueSystem.cs
Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs
Content.Server/NPC/Systems/NPCCombatSystem.cs
Content.Server/Ninja/Systems/BatteryDrainerSystem.cs
Content.Server/Ninja/Systems/SpaceNinjaSystem.cs
Content.Server/Ninja/Systems/StunProviderSystem.cs
Content.Server/Nuke/NukeComponent.cs
Content.Server/Nuke/NukeSystem.cs
Content.Server/Nutrition/Components/FatExtractorComponent.cs
Content.Server/Nutrition/EntitySystems/AnimalHusbandrySystem.cs
Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs
Content.Server/Nutrition/EntitySystems/DrinkSystem.cs
Content.Server/Nutrition/EntitySystems/FatExtractorSystem.cs
Content.Server/Nutrition/EntitySystems/FoodSystem.cs
Content.Server/Nutrition/EntitySystems/OpenableSystem.cs
Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs
Content.Server/Nutrition/EntitySystems/UtensilSystem.cs
Content.Server/PDA/Ringer/RingerSystem.cs
Content.Server/Paper/PaperSystem.cs
Content.Server/Pinpointer/ProximityBeeperSystem.cs
Content.Server/Plants/Systems/PottedPlantHideSystem.cs
Content.Server/Points/PointSystem.cs
Content.Server/Polymorph/Systems/PolymorphSystem.cs
Content.Server/Power/EntitySystems/ApcSystem.cs
Content.Server/Power/EntitySystems/PowerReceiverSystem.cs
Content.Server/Power/Generator/PortableGeneratorSystem.cs
Content.Server/Power/Generator/PowerSwitchableSystem.cs
Content.Server/PowerSink/PowerSinkSystem.cs
Content.Server/Radiation/Systems/GeigerSystem.cs
Content.Server/Research/TechnologyDisk/Systems/DiskConsoleSystem.cs
Content.Server/RoundEnd/RoundEndSystem.cs
Content.Server/Salvage/Expeditions/SalvageExpeditionComponent.cs
Content.Server/Salvage/SalvageSystem.Expeditions.cs
Content.Server/Salvage/SalvageSystem.Runner.cs
Content.Server/Salvage/SalvageSystem.cs
Content.Server/Shuttles/Components/FTLComponent.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs
Content.Server/Shuttles/Systems/ShuttleSystem.Impact.cs
Content.Server/Shuttles/Systems/ShuttleSystem.cs
Content.Server/Singularity/EntitySystems/SingularitySystem.cs
Content.Server/Speech/EntitySystems/VocalSystem.cs
Content.Server/Speech/SpeechNoiseSystem.cs
Content.Server/SprayPainter/SprayPainterSystem.cs
Content.Server/StationEvents/Events/StationEventSystem.cs
Content.Server/Storage/EntitySystems/CursedEntityStorageSystem.cs
Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs
Content.Server/Storage/EntitySystems/StorageSystem.cs
Content.Server/Store/Systems/StoreSystem.Ui.cs
Content.Server/Stunnable/Systems/StunbatonSystem.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSpeakerSystem.cs
Content.Server/Teleportation/HandTeleporterSystem.cs
Content.Server/Toilet/ToiletSystem.cs
Content.Server/Tools/ToolSystem.cs
Content.Server/Weapons/Melee/Balloon/BalloonPopperSystem.cs
Content.Server/Weapons/Melee/EnergySword/EnergySwordSystem.cs
Content.Server/Weapons/Melee/WeaponRandom/WeaponRandomSystem.cs
Content.Server/Wires/WiresSystem.cs
Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs
Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs
Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/PolyArtifactSystem.cs
Content.Server/Zombies/ZombieSystem.Transform.cs
Content.Shared/Actions/SharedActionsSystem.cs
Content.Shared/Anomaly/SharedAnomalySystem.cs
Content.Shared/Audio/SharedAmbientSoundSystem.cs
Content.Shared/Audio/SharedContentAudioSystem.cs
Content.Shared/Blocking/BlockingSystem.User.cs
Content.Shared/Blocking/Components/BlockingComponent.cs
Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs
Content.Shared/Buckle/SharedBuckleSystem.cs
Content.Shared/CCVar/CCVars.cs
Content.Shared/Cabinet/SharedItemCabinetSystem.cs
Content.Shared/Chasm/ChasmSystem.cs
Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs
Content.Shared/Climbing/Systems/BonkSystem.cs
Content.Shared/Climbing/Systems/ClimbSystem.cs
Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs
Content.Shared/Cuffs/SharedCuffableSystem.cs
Content.Shared/Damage/Systems/StaminaSystem.cs
Content.Shared/Devour/SharedDevourSystem.cs
Content.Shared/Doors/Systems/SharedDoorBoltSystem.cs
Content.Shared/Doors/Systems/SharedDoorSystem.cs
Content.Shared/Inventory/InventorySystem.Equip.cs
Content.Shared/Light/SharedHandheldLightSystem.cs
Content.Shared/Lock/LockComponent.cs
Content.Shared/Lock/LockSystem.cs
Content.Shared/Materials/MaterialReclaimerComponent.cs
Content.Shared/Materials/SharedMaterialReclaimerSystem.cs
Content.Shared/Mech/Equipment/Systems/MechSoundboardSystem.cs
Content.Shared/Movement/Systems/SharedMoverController.cs
Content.Shared/Ninja/Systems/DashAbilitySystem.cs
Content.Shared/Ninja/Systems/SharedNinjaSuitSystem.cs
Content.Shared/Projectiles/SharedProjectileSystem.cs
Content.Shared/Prying/Systems/PryingSystem.cs
Content.Shared/RCD/Systems/RCDSystem.cs
Content.Shared/Radiation/Components/GeigerComponent.cs
Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs
Content.Shared/RatKing/SharedRatKingSystem.cs
Content.Shared/Salvage/Fulton/SharedFultonSystem.cs
Content.Shared/Silicons/Bots/EmaggableMedibotComponent.cs
Content.Shared/Silicons/Bots/MedibotSystem.cs
Content.Shared/Singularity/Components/SingularityComponent.cs
Content.Shared/Slippery/SlipperySystem.cs
Content.Shared/Sound/SharedEmitSoundSystem.cs
Content.Shared/Standing/StandingStateSystem.cs
Content.Shared/Storage/EntitySystems/DumpableSystem.cs
Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs
Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs
Content.Shared/Stunnable/SharedStunSystem.cs
Content.Shared/Teleportation/Systems/SharedPortalSystem.cs
Content.Shared/Tiles/FloorTileComponent.cs
Content.Shared/Tiles/FloorTileSystem.cs
Content.Shared/Tools/Systems/SharedToolSystem.cs
Content.Shared/Traits/Assorted/ParacusiaComponent.cs
Content.Shared/Vehicle/Components/VehicleComponent.cs
Content.Shared/Vehicle/SharedVehicleSystem.cs
Content.Shared/VendingMachines/SharedVendingMachineSystem.cs
Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs
Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs
Content.Shared/Weapons/Misc/BaseForceGunComponent.cs
Content.Shared/Weapons/Misc/SharedGrapplingGunSystem.cs
Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs
Content.Shared/Weapons/Ranged/Components/GrapplingGunComponent.cs
Content.Shared/Weapons/Ranged/Systems/RechargeBasicEntityAmmoSystem.cs
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs
Content.Shared/Weapons/Reflect/SharedReflectSystem.cs
Content.Shared/Weather/SharedWeatherSystem.cs
Content.Shared/Weather/WeatherComponent.cs
Content.Shared/Wieldable/WieldableSystem.cs
Resources/Prototypes/Entities/Objects/Fun/toys.yml
Resources/Prototypes/Entities/Objects/Misc/paper.yml
Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml
Resources/Prototypes/Entities/Structures/Machines/fatextractor.yml
Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml
Resources/Prototypes/Voice/speech_emote_sounds.yml

index 2be3d07e90d50de224eefae304c7529961f967a5..90b872b4a40f8d3ea2a6c79b4ec50c9cefbe89be 100644 (file)
@@ -16,7 +16,7 @@ public sealed class AccessOverlay : Overlay
 
     public override OverlaySpace Space => OverlaySpace.ScreenSpace;
 
-    public AccessOverlay(IEntityManager entManager, IResourceCache cache, EntityLookupSystem lookup, SharedTransformSystem xform)
+    public AccessOverlay(IEntityManager entManager, IClientResourceCache cache, EntityLookupSystem lookup, SharedTransformSystem xform)
     {
         _entityManager = entManager;
         _lookup = lookup;
index 7c804dd969801bc9efb38b1d1dd7276fbcf2ba8f..91a94138c836d461391ad5108125e7abe7ee7320 100644 (file)
@@ -25,7 +25,7 @@ public sealed class ShowAccessReadersCommand : IConsoleCommand
         }
 
         var entManager = collection.Resolve<IEntityManager>();
-        var cache = collection.Resolve<IResourceCache>();
+        var cache = collection.Resolve<IClientResourceCache>();
         var lookup = entManager.System<EntityLookupSystem>();
         var xform = entManager.System<SharedTransformSystem>();
 
index c21ba2e32cadc6f5718ad1780d4d47518fe7edc1..fca50e1d95d79a7ff5cd558877141f55275635a6 100644 (file)
@@ -17,7 +17,7 @@ namespace Content.Client.Administration
         private readonly EntityLookupSystem _entityLookup;
         private readonly Font _font;
 
-        public AdminNameOverlay(AdminSystem system, IEntityManager entityManager, IEyeManager eyeManager, IResourceCache resourceCache, EntityLookupSystem entityLookup)
+        public AdminNameOverlay(AdminSystem system, IEntityManager entityManager, IEyeManager eyeManager, IClientResourceCache resourceCache, EntityLookupSystem entityLookup)
         {
             _system = system;
             _entityManager = entityManager;
index 3502faf9e8e83eac971f10d0729c9000dc9ed3f1..4093dcfbd77d76084a4373433c9d864a37130f62 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Client.Administration.Systems
     public sealed partial class AdminSystem
     {
         [Dependency] private readonly IOverlayManager _overlayManager = default!;
-        [Dependency] private readonly IResourceCache _resourceCache = default!;
+        [Dependency] private readonly IClientResourceCache _resourceCache = default!;
         [Dependency] private readonly IClientAdminManager _adminManager = default!;
         [Dependency] private readonly IEyeManager _eyeManager = default!;
         [Dependency] private readonly EntityLookupSystem _entityLookup = default!;
index eede3a6217f007d7d9e794968027fc73985f39d7..89c4d8d7cf2bb527e02ec22a38ca557f02a99e74 100644 (file)
@@ -34,7 +34,7 @@ public sealed class ExplosionDebugOverlay : Overlay
     {
         IoCManager.InjectDependencies(this);
 
-        var cache = IoCManager.Resolve<IResourceCache>();
+        var cache = IoCManager.Resolve<IClientResourceCache>();
         _font = new VectorFont(cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8);
     }
 
index eeda2a31020988be629f0b101b42e2d0e7633426..4832aa5a9395c7740a17ec4475fa271e32da9968 100644 (file)
@@ -65,7 +65,7 @@ namespace Content.Client.Arcade
 
             MinSize = SetSize = new Vector2(410, 490);
 
-            var resourceCache = IoCManager.Resolve<IResourceCache>();
+            var resourceCache = IoCManager.Resolve<IClientResourceCache>();
             var backgroundTexture = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png");
 
             _mainPanel = new PanelContainer();
index 78185ce6b0e679f9599e38dcf4595cfd1c59a8ac..132f404acdcdd4d1bb36c3376aa867d031b23838 100644 (file)
@@ -12,7 +12,7 @@ namespace Content.Client.Atmos.EntitySystems
     [UsedImplicitly]
     public sealed class GasTileOverlaySystem : SharedGasTileOverlaySystem
     {
-        [Dependency] private readonly IResourceCache _resourceCache = default!;
+        [Dependency] private readonly IClientResourceCache _resourceCache = default!;
         [Dependency] private readonly IOverlayManager _overlayMan = default!;
         [Dependency] private readonly SpriteSystem _spriteSys = default!;
 
index ef65d43fe85ecaa019955524eb1013323b61de9b..90df195485ce385ab7be63d20cc144b95f85e215 100644 (file)
@@ -47,7 +47,7 @@ namespace Content.Client.Atmos.Overlays
 
         public const int GasOverlayZIndex = (int) Shared.DrawDepth.DrawDepth.Effects; // Under ghosts, above mostly everything else
 
-        public GasTileOverlay(GasTileOverlaySystem system, IEntityManager entManager, IResourceCache resourceCache, IPrototypeManager protoMan, SpriteSystem spriteSys)
+        public GasTileOverlay(GasTileOverlaySystem system, IEntityManager entManager, IClientResourceCache resourceCache, IPrototypeManager protoMan, SpriteSystem spriteSys)
         {
             _entManager = entManager;
             _mapManager = IoCManager.Resolve<IMapManager>();
index aebacb94f63be0e05b9dc1fa392e8b57e356ad59..10065b6583e2cc161ff78209321aa78f1f02306b 100644 (file)
@@ -1,16 +1,21 @@
-using System.Linq;
-using System.Numerics;
 using Content.Shared.Audio;
 using Content.Shared.CCVar;
-using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Log;
 using Robust.Shared.Configuration;
+using Robust.Shared.Map;
 using Robust.Shared.Physics;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
+using System.Linq;
+using System.Numerics;
+using Robust.Client.GameObjects;
+using Robust.Shared.Audio.Effects;
+using Robust.Shared.Audio.Systems;
+using Robust.Shared.Player;
 
 namespace Content.Client.Audio;
 //TODO: This is using a incomplete version of the whole "only play nearest sounds" algo, that breaks down a bit should the ambient sound cap get hit.
@@ -41,14 +46,18 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
     private TimeSpan _targetTime = TimeSpan.Zero;
     private float _ambienceVolume = 0.0f;
 
-    private static AudioParams _params = AudioParams.Default.WithVariation(0.01f).WithLoop(true).WithAttenuation(Attenuation.LinearDistance);
+    private static AudioParams _params = AudioParams.Default
+        .WithVariation(0.01f)
+        .WithLoop(true)
+        .WithAttenuation(Attenuation.LinearDistance)
+        .WithMaxDistance(7f);
 
     /// <summary>
     /// How many times we can be playing 1 particular sound at once.
     /// </summary>
     private int MaxSingleSound => (int) (_maxAmbientCount / (16.0f / 6.0f));
 
-    private readonly Dictionary<Entity<AmbientSoundComponent>, (IPlayingAudioStream? Stream, SoundSpecifier Sound, string Path)> _playingSounds = new();
+    private readonly Dictionary<AmbientSoundComponent, (EntityUid? Stream, SoundSpecifier Sound, string Path)> _playingSounds = new();
     private readonly Dictionary<string, int> _playingCount = new();
 
     public bool OverlayEnabled
@@ -98,10 +107,10 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
 
     private void OnShutdown(EntityUid uid, AmbientSoundComponent component, ComponentShutdown args)
     {
-        if (!_playingSounds.Remove((uid, component), out var sound))
+        if (!_playingSounds.Remove(component, out var sound))
             return;
 
-        sound.Stream?.Stop();
+        _audio.Stop(sound.Stream);
         _playingCount[sound.Path] -= 1;
         if (_playingCount[sound.Path] == 0)
             _playingCount.Remove(sound.Path);
@@ -111,13 +120,13 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
     {
         _ambienceVolume = value;
 
-        foreach (var ((_, comp), values) in _playingSounds)
+        foreach (var (comp, values) in _playingSounds)
         {
             if (values.Stream == null)
                 continue;
 
-            var stream = (AudioSystem.PlayingStream) values.Stream;
-            stream.Volume = _params.Volume + comp.Volume + _ambienceVolume;
+            var stream = values.Stream;
+            _audio.SetVolume(stream, _params.Volume + comp.Volume + _ambienceVolume);
         }
     }
     private void SetCooldown(float value) => _cooldown = value;
@@ -177,7 +186,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
     {
         foreach (var (stream, _, _) in _playingSounds.Values)
         {
-            stream?.Stop();
+            _audio.Stop(stream);
         }
 
         _playingSounds.Clear();
@@ -186,7 +195,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
 
     private readonly struct QueryState
     {
-        public readonly Dictionary<string, List<(float Importance, Entity<AmbientSoundComponent>)>> SourceDict = new();
+        public readonly Dictionary<string, List<(float Importance, AmbientSoundComponent)>> SourceDict = new();
         public readonly Vector2 MapPos;
         public readonly TransformComponent Player;
         public readonly EntityQuery<TransformComponent> Query;
@@ -224,7 +233,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
 
         // Prioritize far away & loud sounds.
         var importance = range * (ambientComp.Volume + 32);
-        state.SourceDict.GetOrNew(key).Add((importance, (ambientComp.Owner, ambientComp)));
+        state.SourceDict.GetOrNew(key).Add((importance, ambientComp));
         return true;
     }
 
@@ -238,10 +247,9 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
         var mapPos = playerXform.MapPosition;
 
         // Remove out-of-range ambiences
-        foreach (var (ent, sound) in _playingSounds)
+        foreach (var (comp, sound) in _playingSounds)
         {
-            var entity = ent.Owner;
-            var comp = ent.Comp;
+            var entity = comp.Owner;
 
             if (comp.Enabled &&
                 // Don't keep playing sounds that have changed since.
@@ -258,8 +266,8 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
                     continue;
             }
 
-            sound.Stream?.Stop();
-            _playingSounds.Remove((entity, comp));
+            _audio.Stop(sound.Stream);
+            _playingSounds.Remove(comp);
             _playingCount[sound.Path] -= 1;
             if (_playingCount[sound.Path] == 0)
                 _playingCount.Remove(sound.Path);
@@ -284,12 +292,11 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
 
             sources.Sort(static (a, b) => b.Importance.CompareTo(a.Importance));
 
-            foreach (var (_, ent) in sources)
+            foreach (var (_, comp) in sources)
             {
-                var uid = ent.Owner;
-                var comp = ent.Comp;
+                var uid = comp.Owner;
 
-                if (_playingSounds.ContainsKey(ent) ||
+                if (_playingSounds.ContainsKey(comp) ||
                     metaQuery.GetComponent(uid).EntityPaused)
                     continue;
 
@@ -299,11 +306,8 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
                     .WithPlayOffset(_random.NextFloat(0.0f, 100.0f))
                     .WithMaxDistance(comp.Range);
 
-                var stream = _audio.PlayPvs(comp.Sound, uid, audioParams);
-                if (stream == null)
-                    continue;
-
-                _playingSounds[ent] = (stream, comp.Sound, key);
+                var stream = _audio.PlayEntity(comp.Sound, Filter.Local(), uid, false, audioParams);
+                _playingSounds[comp] = (stream.Value.Entity, comp.Sound, key);
                 playingCount++;
 
                 if (_playingSounds.Count >= _maxAmbientCount)
index 0b31db24639e1ddb69171a23de5dec44490b9eef..a26603bf7463ed9ecfcf5a59497bbfd0800542b5 100644 (file)
@@ -5,6 +5,7 @@ using JetBrains.Annotations;
 using Robust.Client;
 using Robust.Client.State;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 
@@ -21,7 +22,7 @@ public sealed class BackgroundAudioSystem : EntitySystem
 
     private readonly AudioParams _lobbyParams = new(-5f, 1, "Master", 0, 0, 0, true, 0f);
 
-    private IPlayingAudioStream? _lobbyStream;
+    private EntityUid? _lobbyStream;
 
     public override void Initialize()
     {
@@ -118,12 +119,11 @@ public sealed class BackgroundAudioSystem : EntitySystem
         }
 
         _lobbyStream = _audio.PlayGlobal(file, Filter.Local(), false,
-            _lobbyParams.WithVolume(_lobbyParams.Volume + _configManager.GetCVar(CCVars.LobbyMusicVolume)));
+            _lobbyParams.WithVolume(_lobbyParams.Volume + _configManager.GetCVar(CCVars.LobbyMusicVolume)))?.Entity;
     }
 
     private void EndLobbyMusic()
     {
-        _lobbyStream?.Stop();
-        _lobbyStream = null;
+        _lobbyStream = _audio.Stop(_lobbyStream);
     }
 }
index 792f149d1808734519c73b2168f0be271c491866..1d98564090a14f0ec9069624c1b0d955a912a61b 100644 (file)
@@ -2,6 +2,7 @@
 using Content.Shared.CCVar;
 using Content.Shared.GameTicking;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 
@@ -14,11 +15,11 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
 
     // Admin music
     private bool _adminAudioEnabled = true;
-    private List<IPlayingAudioStream?> _adminAudio = new(1);
+    private List<EntityUid?> _adminAudio = new(1);
 
     // Event sounds (e.g. nuke timer)
     private bool _eventAudioEnabled = true;
-    private Dictionary<StationEventMusicType, IPlayingAudioStream?> _eventAudio = new(1);
+    private Dictionary<StationEventMusicType, EntityUid?> _eventAudio = new(1);
 
     public override void Initialize()
     {
@@ -49,13 +50,13 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
     {
         foreach (var stream in _adminAudio)
         {
-            stream?.Stop();
+            _audio.Stop(stream);
         }
         _adminAudio.Clear();
 
-        foreach (var (_, stream) in _eventAudio)
+        foreach (var stream in _eventAudio.Values)
         {
-            stream?.Stop();
+            _audio.Stop(stream);
         }
 
         _eventAudio.Clear();
@@ -66,7 +67,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
         if(!_adminAudioEnabled) return;
 
         var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
-        _adminAudio.Add(stream);
+        _adminAudio.Add(stream.Value.Entity);
     }
 
     private void PlayStationEventMusic(StationEventMusicEvent soundEvent)
@@ -75,7 +76,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
         if(!_eventAudioEnabled || _eventAudio.ContainsKey(soundEvent.Type)) return;
 
         var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
-        _eventAudio.Add(soundEvent.Type, stream);
+        _eventAudio.Add(soundEvent.Type, stream.Value.Entity);
     }
 
     private void PlayGameSound(GameGlobalSoundEvent soundEvent)
@@ -85,8 +86,10 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
 
     private void StopStationEventMusic(StopStationEventMusic soundEvent)
     {
-        if (!_eventAudio.TryGetValue(soundEvent.Type, out var stream)) return;
-        stream?.Stop();
+        if (!_eventAudio.TryGetValue(soundEvent.Type, out var stream))
+            return;
+
+        _audio.Stop(stream);
         _eventAudio.Remove(soundEvent.Type);
     }
 
@@ -96,7 +99,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
         if (_adminAudioEnabled) return;
         foreach (var stream in _adminAudio)
         {
-            stream?.Stop();
+            _audio.Stop(stream);
         }
         _adminAudio.Clear();
     }
@@ -107,7 +110,7 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
         if (_eventAudioEnabled) return;
         foreach (var stream in _eventAudio)
         {
-            stream.Value?.Stop();
+            _audio.Stop(stream.Value);
         }
         _eventAudio.Clear();
     }
index 15fc53222e8dd9974738889be54e835475cb309c..525b09b2c6f9ef7765ee0e7284f34769cc7b8fd0 100644 (file)
@@ -9,10 +9,12 @@ using Robust.Client.Player;
 using Robust.Client.ResourceManagement;
 using Robust.Client.State;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
+using Robust.Shared.ResourceManagement.ResourceTypes;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
 
@@ -24,7 +26,7 @@ public sealed partial class ContentAudioSystem
     [Dependency] private readonly IGameTiming _timing = default!;
     [Dependency] private readonly IPlayerManager _player = default!;
     [Dependency] private readonly IPrototypeManager _proto = default!;
-    [Dependency] private readonly IResourceCache _resource = default!;
+    [Dependency] private readonly IClientResourceCache _resource = default!;
     [Dependency] private readonly IRobustRandom _random = default!;
     [Dependency] private readonly IStateManager _state = default!;
     [Dependency] private readonly RulesSystem _rules = default!;
@@ -39,7 +41,7 @@ public sealed partial class ContentAudioSystem
     // Don't need to worry about this being serializable or pauseable as it doesn't affect the sim.
     private TimeSpan _nextAudio;
 
-    private AudioSystem.PlayingStream? _ambientMusicStream;
+    private EntityUid? _ambientMusicStream;
     private AmbientMusicPrototype? _musicProto;
 
     /// <summary>
@@ -83,7 +85,7 @@ public sealed partial class ContentAudioSystem
 
         if (_ambientMusicStream != null && _musicProto != null)
         {
-            _ambientMusicStream.Volume = _musicProto.Sound.Params.Volume + _volumeSlider;
+            _audio.SetVolume(_ambientMusicStream, _musicProto.Sound.Params.Volume + _volumeSlider);
         }
     }
 
@@ -92,7 +94,7 @@ public sealed partial class ContentAudioSystem
         _configManager.UnsubValueChanged(CCVars.AmbientMusicVolume, AmbienceCVarChanged);
         _proto.PrototypesReloaded -= OnProtoReload;
         _state.OnStateChanged -= OnStateChange;
-        _ambientMusicStream?.Stop();
+        _ambientMusicStream = _audio.Stop(_ambientMusicStream);
     }
 
     private void OnProtoReload(PrototypesReloadedEventArgs obj)
@@ -129,8 +131,7 @@ public sealed partial class ContentAudioSystem
     private void OnRoundEndMessage(RoundEndMessageEvent ev)
     {
         // If scoreboard shows then just stop the music
-        _ambientMusicStream?.Stop();
-        _ambientMusicStream = null;
+        _ambientMusicStream = _audio.Stop(_ambientMusicStream);
         _nextAudio = TimeSpan.FromMinutes(3);
     }
 
@@ -170,7 +171,7 @@ public sealed partial class ContentAudioSystem
             return;
         }
 
-        var isDone = _ambientMusicStream?.Done;
+        var isDone = !Exists(_ambientMusicStream);
 
         if (_interruptable)
         {
@@ -178,7 +179,7 @@ public sealed partial class ContentAudioSystem
 
             if (player == null || _musicProto == null || !_rules.IsTrue(player.Value, _proto.Index<RulesPrototype>(_musicProto.Rules)))
             {
-                FadeOut(_ambientMusicStream, AmbientMusicFadeTime);
+                FadeOut(_ambientMusicStream, duration: AmbientMusicFadeTime);
                 _musicProto = null;
                 _interruptable = false;
                 isDone = true;
@@ -221,14 +222,11 @@ public sealed partial class ContentAudioSystem
             false,
             AudioParams.Default.WithVolume(_musicProto.Sound.Params.Volume + _volumeSlider));
 
-        if (strim != null)
-        {
-            _ambientMusicStream = (AudioSystem.PlayingStream) strim;
+        _ambientMusicStream = strim.Value.Entity;
 
-            if (_musicProto.FadeIn)
-            {
-                FadeIn(_ambientMusicStream, AmbientMusicFadeTime);
-            }
+        if (_musicProto.FadeIn)
+        {
+            FadeIn(_ambientMusicStream, strim.Value.Component, AmbientMusicFadeTime);
         }
 
         // Refresh the list
index 696a5eb32dbbdb9624709b6cf8079d3fcdc718a6..726493fdab165756fc9af657baaa8aded7dad9ec 100644 (file)
@@ -1,17 +1,19 @@
 using Content.Shared.Audio;
 using Robust.Client.GameObjects;
+using Robust.Shared.Audio;
+using AudioComponent = Robust.Shared.Audio.Components.AudioComponent;
 
 namespace Content.Client.Audio;
 
 public sealed partial class ContentAudioSystem : SharedContentAudioSystem
 {
     // Need how much volume to change per tick and just remove it when it drops below "0"
-    private readonly Dictionary<AudioSystem.PlayingStream, float> _fadingOut = new();
+    private readonly Dictionary<EntityUid, float> _fadingOut = new();
 
     // Need volume change per tick + target volume.
-    private readonly Dictionary<AudioSystem.PlayingStream, (float VolumeChange, float TargetVolume)> _fadingIn = new();
+    private readonly Dictionary<EntityUid, (float VolumeChange, float TargetVolume)> _fadingIn = new();
 
-    private readonly List<AudioSystem.PlayingStream> _fadeToRemove = new();
+    private readonly List<EntityUid> _fadeToRemove = new();
 
     private const float MinVolume = -32f;
     private const float DefaultDuration = 2f;
@@ -42,28 +44,28 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem
 
     #region Fades
 
-    public void FadeOut(AudioSystem.PlayingStream? stream, float duration = DefaultDuration)
+    public void FadeOut(EntityUid? stream, AudioComponent? component = null, float duration = DefaultDuration)
     {
-        if (stream == null || duration <= 0f)
+        if (stream == null || duration <= 0f || !Resolve(stream.Value, ref component))
             return;
 
         // Just in case
         // TODO: Maybe handle the removals by making it seamless?
-        _fadingIn.Remove(stream);
-        var diff = stream.Volume - MinVolume;
-        _fadingOut.Add(stream, diff / duration);
+        _fadingIn.Remove(stream.Value);
+        var diff = component.Volume - MinVolume;
+        _fadingOut.Add(stream.Value, diff / duration);
     }
 
-    public void FadeIn(AudioSystem.PlayingStream? stream, float duration = DefaultDuration)
+    public void FadeIn(EntityUid? stream, AudioComponent? component = null, float duration = DefaultDuration)
     {
-        if (stream == null || duration <= 0f || stream.Volume < MinVolume)
+        if (stream == null || duration <= 0f || !Resolve(stream.Value, ref component) || component.Volume < MinVolume)
             return;
 
-        _fadingOut.Remove(stream);
-        var curVolume = stream.Volume;
+        _fadingOut.Remove(stream.Value);
+        var curVolume = component.Volume;
         var change = (curVolume - MinVolume) / duration;
-        _fadingIn.Add(stream, (change, stream.Volume));
-        stream.Volume = MinVolume;
+        _fadingIn.Add(stream.Value, (change, component.Volume));
+        component.Volume = MinVolume;
     }
 
     private void UpdateFades(float frameTime)
@@ -72,19 +74,18 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem
 
         foreach (var (stream, change) in _fadingOut)
         {
-            // Cancelled elsewhere
-            if (stream.Done)
+            if (!TryComp(stream, out AudioComponent? component))
             {
                 _fadeToRemove.Add(stream);
                 continue;
             }
 
-            var volume = stream.Volume - change * frameTime;
-            stream.Volume = MathF.Max(MinVolume, volume);
+            var volume = component.Volume - change * frameTime;
+            component.Volume = MathF.Max(MinVolume, volume);
 
-            if (stream.Volume.Equals(MinVolume))
+            if (component.Volume.Equals(MinVolume))
             {
-                stream.Stop();
+                _audio.Stop(stream);
                 _fadeToRemove.Add(stream);
             }
         }
@@ -99,16 +100,16 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem
         foreach (var (stream, (change, target)) in _fadingIn)
         {
             // Cancelled elsewhere
-            if (stream.Done)
+            if (!TryComp(stream, out AudioComponent? component))
             {
                 _fadeToRemove.Add(stream);
                 continue;
             }
 
-            var volume = stream.Volume + change * frameTime;
-            stream.Volume = MathF.Min(target, volume);
+            var volume = component.Volume + change * frameTime;
+            component.Volume = MathF.Min(target, volume);
 
-            if (stream.Volume.Equals(target))
+            if (component.Volume.Equals(target))
             {
                 _fadeToRemove.Add(stream);
             }
index d1e2bc7533edbc43859735f708ccb5f5645a5148..83397d6a36d215963b1452a0583609bcf802e6ab 100644 (file)
@@ -7,6 +7,7 @@ using Robust.Client.ResourceManagement;
 using Robust.Client.UserInterface;
 using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.XAML;
+using Robust.Shared.ContentPack;
 using Robust.Shared.Utility;
 using static Content.Client.Changelog.ChangelogManager;
 using static Robust.Client.UserInterface.Controls.BoxContainer;
@@ -17,7 +18,7 @@ namespace Content.Client.Changelog;
 public sealed partial class ChangelogTab : Control
 {
     [Dependency] private readonly ChangelogManager _changelog = default!;
-    [Dependency] private readonly IResourceCache _resourceCache = default!;
+    [Dependency] private readonly IClientResourceCache _resourceCache = default!;
 
     public bool AdminOnly;
 
index 6a77c7e05436a1133433237bba86345dbd76f0b7..b90289a02211b0093c1e98b83dbdc24d2512a50f 100644 (file)
@@ -23,7 +23,7 @@ namespace Content.Client.Clickable
         private const float Threshold = 0.25f;
         private const int ClickRadius = 2;
 
-        [Dependency] private readonly IResourceCache _resourceCache = default!;
+        [Dependency] private readonly IClientResourceCache _resourceCache = default!;
 
         [ViewVariables]
         private readonly Dictionary<Texture, ClickMap> _textureMaps = new();
index b16e14d65355797af7981afbf797c53304a93e19..1dd0fed137184f68aa664faecbd88976d075b74d 100644 (file)
@@ -45,7 +45,7 @@ public sealed class ClientClothingSystem : ClothingSystem
         {"suitstorage", "SUITSTORAGE"},
     };
 
-    [Dependency] private readonly IResourceCache _cache = default!;
+    [Dependency] private readonly IClientResourceCache _cache = default!;
     [Dependency] private readonly InventorySystem _inventorySystem = default!;
 
     public override void Initialize()
index 666ff2aa48bb0bb153c6920554a291061ec3c74b..60ac57984546e3c94332ebd7585f4bfba1b6d1ef 100644 (file)
@@ -11,6 +11,7 @@ using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.CustomControls;
 using Robust.Client.UserInterface.XAML;
 using Robust.Shared.Configuration;
+using Robust.Shared.ContentPack;
 using Robust.Shared.IoC;
 using Robust.Shared.Localization;
 using Robust.Shared.Maths;
@@ -23,7 +24,7 @@ namespace Content.Client.Credits
     [GenerateTypedNameReferences]
     public sealed partial class CreditsWindow : DefaultWindow
     {
-        [Dependency] private readonly IResourceCache _resourceManager = default!;
+        [Dependency] private readonly IResourceManager _resourceManager = default!;
         [Dependency] private readonly IConfigurationManager _cfg = default!;
 
         private static readonly Dictionary<string, int> PatronTierPriority = new()
@@ -49,7 +50,7 @@ namespace Content.Client.Credits
 
         private void PopulateLicenses(BoxContainer licensesContainer)
         {
-            foreach (var entry in CreditsManager.GetLicenses().OrderBy(p => p.Name))
+            foreach (var entry in CreditsManager.GetLicenses(_resourceManager).OrderBy(p => p.Name))
             {
                 licensesContainer.AddChild(new Label {StyleClasses = {StyleBase.StyleClassLabelHeading}, Text = entry.Name});
 
index 2d6a89101c7166196f7600716d1340e0fc310dc0..b491dbaa480a9ee650534a318cdc84fc83003f50 100644 (file)
@@ -12,7 +12,7 @@ namespace Content.Client.Decals.UI;
 public sealed partial class PaletteColorPicker : DefaultWindow
 {
     [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
-    [Dependency] private readonly IResourceCache _resourceCache = default!;
+    [Dependency] private readonly IClientResourceCache _resourceCache = default!;
 
     private readonly TextureResource _tex;
 
index d10101754cc783ce0eb18df31c7a4d2dc5ec83b9..344bd2ec979ab525c4f82c1e9b35d993478356c4 100644 (file)
@@ -6,6 +6,8 @@ using Content.Shared.Emag.Systems;
 using Robust.Client.GameObjects;
 using Robust.Client.Animations;
 using Robust.Client.Graphics;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 using Robust.Shared.Physics.Events;
 using static Content.Shared.Disposal.Components.SharedDisposalUnitComponent;
index 4b82d3506aedd143d8c56c4317fed063fc5f1062..ccdd9c48cd5935fdd2ba336df90be1f3a78f5ea3 100644 (file)
@@ -14,7 +14,7 @@ public sealed class DoorSystem : SharedDoorSystem
 {
     [Dependency] private readonly AnimationPlayerSystem _animationSystem = default!;
     [Dependency] private readonly IGameTiming _gameTiming = default!;
-    [Dependency] private readonly IResourceCache _resourceCache = default!;
+    [Dependency] private readonly IClientResourceCache _resourceCache = default!;
 
     public override void Initialize()
     {
@@ -138,6 +138,6 @@ public sealed class DoorSystem : SharedDoorSystem
     protected override void PlaySound(EntityUid uid, SoundSpecifier soundSpecifier, AudioParams audioParams, EntityUid? predictingPlayer, bool predicted)
     {
         if (GameTiming.InPrediction && GameTiming.IsFirstTimePredicted)
-            Audio.Play(soundSpecifier, Filter.Local(), uid, false, audioParams);
+            Audio.PlayEntity(soundSpecifier, Filter.Local(), uid, false, audioParams);
     }
 }
index 60208ea1a0d1414a6bbf3537785efd4f21ff4910..a6188bf948be0c39809916335e380f1e2f41a4b8 100644 (file)
@@ -15,7 +15,7 @@ namespace Content.Client.Explosion;
 public sealed class ExplosionOverlaySystem : EntitySystem
 {
     [Dependency] private readonly IPrototypeManager _protoMan = default!;
-    [Dependency] private readonly IResourceCache _resCache = default!;
+    [Dependency] private readonly IClientResourceCache _resCache = default!;
     [Dependency] private readonly IOverlayManager _overlayMan = default!;
     [Dependency] private readonly SharedPointLightSystem _lights = default!;
 
index c1fba48309456b868527a9a7f05363c7e4928e3c..021582faa514c6b124c9dcd29688842337a8b4f3 100644 (file)
@@ -17,7 +17,7 @@ public sealed partial class AdminFaxWindow : DefaultWindow
     public Action<(NetEntity entity, string title, string stampedBy, string message, string stampSprite, Color stampColor)>? OnMessageSend;
     public Action<NetEntity>? OnFollowFax;
 
-    [Dependency] private readonly IResourceCache _resCache = default!;
+    [Dependency] private readonly IClientResourceCache _resCache = default!;
 
     public AdminFaxWindow()
     {
index 8c8b13a1efe78ca8fb1d78ed0f91b50f0c6df4de..035d7e893b50bea0be7b5b3e035e0ba0d2688551 100644 (file)
@@ -27,7 +27,7 @@ public sealed class PuddleOverlay : Overlay
     {
         IoCManager.InjectDependencies(this);
         _debugOverlaySystem = _entitySystemManager.GetEntitySystem<PuddleDebugOverlaySystem>();
-        var cache = IoCManager.Resolve<IResourceCache>();
+        var cache = IoCManager.Resolve<IClientResourceCache>();
         _font = new VectorFont(cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8);
     }
 
index e363ae764bf7dba46ff0a58c1370014e4e16112f..a25b592f574ad30f2fe1477af785ec1ef7928c87 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.GameWindow;
 using JetBrains.Annotations;
 using Robust.Client.Graphics;
 using Robust.Client.State;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Utility;
index fee072051ab3e4d53212cf63403149d7ca6ea2b0..55becdd3950fa61b292ff5e62156eef37dd95522 100644 (file)
@@ -3,6 +3,7 @@ using Content.Shared.Camera;
 using Content.Shared.Gravity;
 using Robust.Client.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 
index 8ef6f13e31d5e4c08fad859b44b98220c9920299..dffc625cb8623c05b9ba28296b2429f26fd6d935 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Tag;
 using Content.Shared.Verbs;
 using Robust.Client.GameObjects;
 using Robust.Client.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
index 2905857b393e667472458aa00fb293d78600626a..7a763a1d6f4b2e4d2d1ec53a8419aefa315e245e 100644 (file)
@@ -11,7 +11,7 @@ namespace Content.Client.Info
 {
     public sealed class RulesAndInfoWindow : DefaultWindow
     {
-        [Dependency] private readonly IResourceCache _resourceManager = default!;
+        [Dependency] private readonly IResourceManager _resourceManager = default!;
         [Dependency] private readonly RulesManager _rules = default!;
 
         public RulesAndInfoWindow()
index 9cbe8053e3818f447271e420aaf6f5ae64d1c674..767a9f01ecc7eb58e6d14d424ce5ced220e39ce6 100644 (file)
@@ -1,10 +1,11 @@
 using Robust.Client.ResourceManagement;
+using Robust.Shared.ContentPack;
 using Robust.Shared.IoC;
 
 namespace Content.Client.IoC
 {
     public static class StaticIoC
     {
-        public static IResourceCache ResC => IoCManager.Resolve<IResourceCache>();
+        public static IClientResourceCache ResC => IoCManager.Resolve<IClientResourceCache>();
     }
 }
index e406ba2b5574639d6d2d5a73d9c8ee0716397cf1..70a845f57e440889614b3dcb4cd15c14b107a904 100644 (file)
@@ -12,7 +12,7 @@ namespace Content.Client.Items.Systems;
 
 public sealed class ItemSystem : SharedItemSystem
 {
-    [Dependency] private readonly IResourceCache _resCache = default!;
+    [Dependency] private readonly IClientResourceCache _resCache = default!;
 
     public override void Initialize()
     {
index 2ce0249fc1f088d0a3ad7286a046619c637916f9..f5dbcc297e7aef8d8d62b7d8e0703ba740b40220 100644 (file)
@@ -44,7 +44,7 @@ public sealed partial class ExpendableLightComponent : SharedExpendableLightComp
     /// The sound that plays when the expendable light is lit.
     /// </summary>
     [Access(typeof(ExpendableLightSystem))]
-    public IPlayingAudioStream? PlayingStream;
+    public EntityUid? PlayingStream;
 }
 
 public enum ExpendableLightVisualLayers : byte
index 6e9e546dfa3e66e69e3286aa440d700068e887ee..a2a7fb2531c96402a457470c13468816c9343efa 100644 (file)
@@ -2,6 +2,8 @@ using Content.Client.Light.Components;
 using Content.Shared.Light.Components;
 using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Client.Light.EntitySystems;
 
@@ -19,7 +21,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
 
     private void OnLightShutdown(EntityUid uid, ExpendableLightComponent component, ComponentShutdown args)
     {
-        component.PlayingStream?.Stop();
+        component.PlayingStream = _audioSystem.Stop(component.PlayingStream);
     }
 
     protected override void OnAppearanceChange(EntityUid uid, ExpendableLightComponent comp, ref AppearanceChangeEvent args)
@@ -48,12 +50,10 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
         switch (state)
         {
             case ExpendableLightState.Lit:
-                comp.PlayingStream?.Stop();
+                _audioSystem.Stop(comp.PlayingStream);
                 comp.PlayingStream = _audioSystem.PlayPvs(
-                    comp.LoopedSound,
-                    uid,
-                    SharedExpendableLightComponent.LoopedSoundParams
-                );
+                    comp.LoopedSound, uid, SharedExpendableLightComponent.LoopedSoundParams)?.Entity;
+
                 if (args.Sprite.LayerMapTryGet(ExpendableLightVisualLayers.Overlay, out var layerIdx, true))
                 {
                     if (!string.IsNullOrWhiteSpace(comp.IconStateLit))
@@ -73,7 +73,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem<ExpendableLightComp
 
                 break;
             case ExpendableLightState.Dead:
-                comp.PlayingStream?.Stop();
+                comp.PlayingStream = _audioSystem.Stop(comp.PlayingStream);
                 if (args.Sprite.LayerMapTryGet(ExpendableLightVisualLayers.Overlay, out layerIdx, true))
                 {
                     if (!string.IsNullOrWhiteSpace(comp.IconStateSpent))
index bf69053d9a213486ac03c0346cfdee907b60cceb..e7fcf7e219fc48ef3eefa7a08a206ad53b8e3dc1 100644 (file)
@@ -2,6 +2,8 @@ using Content.Shared.Light;
 using Robust.Client.Animations;
 using Robust.Client.GameObjects;
 using Robust.Shared.Animations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Client.Light.Visualizers;
index 457163a5b5bef94a26256f5f81853b2d1aacdab9..eee39e32e019d9078a1906242e629053621ed473 100644 (file)
@@ -13,6 +13,7 @@ using Robust.Client.UserInterface;
 using Robust.Client.UserInterface.Controls;
 using Robust.Shared.Configuration;
 using Robust.Shared.Prototypes;
+using Robust.Shared.ResourceManagement.ResourceTypes;
 using Robust.Shared.Timing;
 
 
@@ -23,7 +24,7 @@ namespace Content.Client.Lobby
         [Dependency] private readonly IBaseClient _baseClient = default!;
         [Dependency] private readonly IClientConsoleHost _consoleHost = default!;
         [Dependency] private readonly IEntityManager _entityManager = default!;
-        [Dependency] private readonly IResourceCache _resourceCache = default!;
+        [Dependency] private readonly IClientResourceCache _resourceCache = default!;
         [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
         [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
         [Dependency] private readonly IClientPreferencesManager _preferencesManager = default!;
index 43c5bfe56748481111b775f81470410a1dae7d9f..e2ea4b3abb16133011e7b55f5b076e8408996a87 100644 (file)
@@ -23,7 +23,7 @@ namespace Content.Client.MainMenu
         [Dependency] private readonly IClientNetManager _netManager = default!;
         [Dependency] private readonly IConfigurationManager _configurationManager = default!;
         [Dependency] private readonly IGameController _controllerProxy = default!;
-        [Dependency] private readonly IResourceCache _resourceCache = default!;
+        [Dependency] private readonly IClientResourceCache _resourceCache = default!;
         [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
 
         private MainMenuControl _mainMenuControl = default!;
index 1d5244305dca3aa761a6cbc6cfb947401ae814f2..5a6484a86fb3eb025c674f994e70de5e853a05e8 100644 (file)
@@ -11,7 +11,7 @@ namespace Content.Client.MainMenu.UI;
 [GenerateTypedNameReferences]
 public sealed partial class MainMenuControl : Control
 {
-    public MainMenuControl(IResourceCache resCache, IConfigurationManager configMan)
+    public MainMenuControl(IClientResourceCache resCache, IConfigurationManager configMan)
     {
         RobustXamlLoader.Load(this);
 
index ad173f3b29c760b7bcefbde76979efbdc93a23ca..7a5fec1e8e47313cc9fc578eacb3f3ec9b1ad853 100644 (file)
@@ -12,7 +12,7 @@ public sealed class HTNOverlay : Overlay
 
     public override OverlaySpace Space => OverlaySpace.ScreenSpace;
 
-    public HTNOverlay(IEntityManager entManager, IResourceCache resourceCache)
+    public HTNOverlay(IEntityManager entManager, IClientResourceCache resourceCache)
     {
         _entManager = entManager;
         _font = new VectorFont(resourceCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 10);
index 7ea914b8c31f1a46a8d0e5eca1be8e869a95ff24..41e9d5cb72af5568be73a53244cb33b3378a2ed7 100644 (file)
@@ -19,7 +19,7 @@ public sealed class HTNSystem : EntitySystem
 
             if (_enableOverlay)
             {
-                overlayManager.AddOverlay(new HTNOverlay(EntityManager, IoCManager.Resolve<IResourceCache>()));
+                overlayManager.AddOverlay(new HTNOverlay(EntityManager, IoCManager.Resolve<IClientResourceCache>()));
                 RaiseNetworkEvent(new RequestHTNMessage()
                 {
                     Enabled = true,
index 548edd601ce871bcd133d033e3aa5f949228feb2..c2579ab5ecf0fb29932620193bca00f02a32d46f 100644 (file)
@@ -20,7 +20,7 @@ namespace Content.Client.NPC
         [Dependency] private readonly IGameTiming _timing = default!;
         [Dependency] private readonly IInputManager _inputManager = default!;
         [Dependency] private readonly IMapManager _mapManager = default!;
-        [Dependency] private readonly IResourceCache _cache = default!;
+        [Dependency] private readonly IClientResourceCache _cache = default!;
         [Dependency] private readonly NPCSteeringSystem _steering = default!;
         [Dependency] private readonly MapSystem _mapSystem = default!;
 
@@ -151,7 +151,7 @@ namespace Content.Client.NPC
             IEyeManager eyeManager,
             IInputManager inputManager,
             IMapManager mapManager,
-            IResourceCache cache,
+            IClientResourceCache cache,
             PathfindingSystem system,
             MapSystem mapSystem)
         {
index 0a3d7ddad02677e980521c0dbfd249799473a6e4..55532b57f06ccfd3646ebba8902453f1eaad99db 100644 (file)
@@ -18,7 +18,7 @@ namespace Content.Client.NodeContainer
         [Dependency] private readonly EntityLookupSystem _entityLookup = default!;
         [Dependency] private readonly IMapManager _mapManager = default!;
         [Dependency] private readonly IInputManager _inputManager = default!;
-        [Dependency] private readonly IResourceCache _resourceCache = default!;
+        [Dependency] private readonly IClientResourceCache _resourceCache = default!;
 
         public bool VisEnabled { get; private set; }
 
index f10eb9ed8b14e0d75ad8862ab7bd026bd20b2787..b8e2e3bbb7627606213d995d8f9b50d58ab5c3dd 100644 (file)
@@ -38,7 +38,7 @@ namespace Content.Client.NodeContainer
             EntityLookupSystem lookup,
             IMapManager mapManager,
             IInputManager inputManager,
-            IResourceCache cache,
+            IClientResourceCache cache,
             IEntityManager entityManager)
         {
             _system = system;
index 5875c4a33a1f15aa025384e5d8c9a8bd500fbcd3..6a9928b8bdd8f244469b8e71052ac2976d5096e7 100644 (file)
@@ -1,5 +1,7 @@
 using Content.Shared.CCVar;
+using Robust.Client.Audio;
 using Robust.Client.AutoGenerated;
+using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.UserInterface;
 using Robust.Client.UserInterface.Controls;
@@ -14,13 +16,14 @@ namespace Content.Client.Options.UI.Tabs
     public sealed partial class AudioTab : Control
     {
         [Dependency] private readonly IConfigurationManager _cfg = default!;
-        [Dependency] private readonly IClydeAudio _clydeAudio = default!;
+        private readonly AudioSystem _audio;
 
         public AudioTab()
         {
             RobustXamlLoader.Load(this);
             IoCManager.InjectDependencies(this);
 
+            _audio = IoCManager.Resolve<IEntityManager>().System<AudioSystem>();
             LobbyMusicCheckBox.Pressed = _cfg.GetCVar(CCVars.LobbyMusicEnabled);
             RestartSoundsCheckBox.Pressed = _cfg.GetCVar(CCVars.RestartSoundsEnabled);
             EventMusicCheckBox.Pressed = _cfg.GetCVar(CCVars.EventMusicEnabled);
@@ -79,7 +82,7 @@ namespace Content.Client.Options.UI.Tabs
 
         private void OnMasterVolumeSliderChanged(Range range)
         {
-            _clydeAudio.SetMasterVolume(MasterVolumeSlider.Value / 100);
+            _audio.SetMasterVolume(MasterVolumeSlider.Value / 100);
             UpdateChanges();
         }
 
@@ -108,7 +111,7 @@ namespace Content.Client.Options.UI.Tabs
 
         private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
         {
-            _cfg.SetCVar(CVars.AudioMasterVolume, MasterVolumeSlider.Value / 100);
+            _cfg.SetCVar(CVars.AudioMasterVolume, LV100ToDB(MasterVolumeSlider.Value, CCVars.MasterMultiplier));
             // Want the CVar updated values to have the multiplier applied
             // For the UI we just display 0-100 still elsewhere
             _cfg.SetCVar(CVars.MidiVolume, LV100ToDB(MidiVolumeSlider.Value, CCVars.MidiMultiplier));
@@ -132,7 +135,7 @@ namespace Content.Client.Options.UI.Tabs
 
         private void Reset()
         {
-            MasterVolumeSlider.Value = _cfg.GetCVar(CVars.AudioMasterVolume) * 100;
+            MasterVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CVars.AudioMasterVolume), CCVars.MasterMultiplier);
             MidiVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CVars.MidiVolume), CCVars.MidiMultiplier);
             AmbienceVolumeSlider.Value = DBToLV100(_cfg.GetCVar(CCVars.AmbienceVolume), CCVars.AmbienceMultiplier);
             AmbientMusicVolumeSlider.Value =
@@ -150,8 +153,8 @@ namespace Content.Client.Options.UI.Tabs
         // Do be sure to rename the setting though
         private float DBToLV100(float db, float multiplier = 1f)
         {
-            var weh = (float) (Math.Pow(10, db / 10) * 100 / multiplier);
-            return weh;
+            var beri = (float) (Math.Pow(10, db / 10) * 100 / multiplier);
+            return beri;
         }
 
         private float LV100ToDB(float lv100, float multiplier = 1f)
@@ -164,7 +167,7 @@ namespace Content.Client.Options.UI.Tabs
         private void UpdateChanges()
         {
             var isMasterVolumeSame =
-                Math.Abs(MasterVolumeSlider.Value - _cfg.GetCVar(CVars.AudioMasterVolume) * 100) < 0.01f;
+                Math.Abs(MasterVolumeSlider.Value - DBToLV100(_cfg.GetCVar(CVars.AudioMasterVolume), CCVars.MasterMultiplier)) < 0.01f;
             var isMidiVolumeSame =
                 Math.Abs(MidiVolumeSlider.Value - DBToLV100(_cfg.GetCVar(CVars.MidiVolume), CCVars.MidiMultiplier)) < 0.01f;
             var isAmbientVolumeSame =
index c3192a495d61eff36e5a3e8404235a3b62ddb411..6ff66b3821cdba6e3b381249f88550a70183f15c 100644 (file)
@@ -61,7 +61,7 @@ namespace Content.Client.Paper.UI
             // Randomize the placement of any stamps based on the entity UID
             // so that there's some variety in different papers.
             StampDisplay.PlacementSeed = (int)entity;
-            var resCache = IoCManager.Resolve<IResourceCache>();
+            var resCache = IoCManager.Resolve<IClientResourceCache>();
 
             // Initialize the background:
             PaperBackground.ModulateSelfOverride = visuals.BackgroundModulate;
index a04508aeba34c4240dd955953128a05761feed08..248185949261dd9ac99ffe6748a5f7deaa352a4e 100644 (file)
@@ -32,7 +32,7 @@ public sealed partial class StampWidget : PanelContainer
     public StampWidget()
     {
         RobustXamlLoader.Load(this);
-        var resCache = IoCManager.Resolve<IResourceCache>();
+        var resCache = IoCManager.Resolve<IClientResourceCache>();
         var borderImage = resCache.GetResource<TextureResource>(
                 "/Textures/Interface/Paper/paper_stamp_border.svg.96dpi.png");
         _borderTexture = new StyleBoxTexture {
index 81f012d93c6927262b7944ca4ab66cf458ef42ba..2e69a5a5625d1f9c3b5f17f5b94db01f15782ad1 100644 (file)
@@ -57,16 +57,17 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou
         }
 
         var debugParallax = IoCManager.Resolve<IConfigurationManager>().GetCVar(CCVars.ParallaxDebug);
+        var resManager = IoCManager.Resolve<IResourceManager>();
 
         if (debugParallax
-            || !StaticIoC.ResC.UserData.TryReadAllText(PreviousParallaxConfigPath, out var previousParallaxConfig)
+            || !resManager.UserData.TryReadAllText(PreviousParallaxConfigPath, out var previousParallaxConfig)
             || previousParallaxConfig != parallaxConfig)
         {
             var table = Toml.ReadString(parallaxConfig);
             await UpdateCachedTexture(table, debugParallax, cancel);
 
             //Update the previous config
-            using var writer = StaticIoC.ResC.UserData.OpenWriteText(PreviousParallaxConfigPath);
+            using var writer = resManager.UserData.OpenWriteText(PreviousParallaxConfigPath);
             writer.Write(parallaxConfig);
         }
 
@@ -81,7 +82,7 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou
             try
             {
                 // Also try to at least sort of fix this if we've been fooled by a config backup
-                StaticIoC.ResC.UserData.Delete(PreviousParallaxConfigPath);
+                resManager.UserData.Delete(PreviousParallaxConfigPath);
             }
             catch (Exception)
             {
@@ -104,31 +105,34 @@ public sealed partial class GeneratedParallaxTextureSource : IParallaxTextureSou
         // And load it in the main thread for safety reasons.
         // But before spending time saving it, make sure to exit out early if it's not wanted.
         cancel.ThrowIfCancellationRequested();
+        var resManager = IoCManager.Resolve<IResourceManager>();
 
         // Store it and CRC so further game starts don't need to regenerate it.
-        using var imageStream = StaticIoC.ResC.UserData.OpenWrite(ParallaxCachedImagePath);
-        newParallexImage.SaveAsPng(imageStream);
+        await using var imageStream = resManager.UserData.OpenWrite(ParallaxCachedImagePath);
+        await newParallexImage.SaveAsPngAsync(imageStream, cancel);
 
         if (saveDebugLayers)
         {
             for (var i = 0; i < debugImages!.Count; i++)
             {
                 var debugImage = debugImages[i];
-                using var debugImageStream = StaticIoC.ResC.UserData.OpenWrite(new ResPath($"/parallax_{Identifier}debug_{i}.png"));
-                debugImage.SaveAsPng(debugImageStream);
+                await using var debugImageStream = resManager.UserData.OpenWrite(new ResPath($"/parallax_{Identifier}debug_{i}.png"));
+                await debugImage.SaveAsPngAsync(debugImageStream, cancel);
             }
         }
     }
 
     private Texture GetCachedTexture()
     {
-        using var imageStream = StaticIoC.ResC.UserData.OpenRead(ParallaxCachedImagePath);
+        var resManager = IoCManager.Resolve<IResourceManager>();
+        using var imageStream = resManager.UserData.OpenRead(ParallaxCachedImagePath);
         return Texture.LoadFromPNGStream(imageStream, "Parallax");
     }
 
     private string? GetParallaxConfig()
     {
-        if (!StaticIoC.ResC.TryContentFileRead(ParallaxConfigPath, out var configStream))
+        var resManager = IoCManager.Resolve<IResourceManager>();
+        if (!resManager.TryContentFileRead(ParallaxConfigPath, out var configStream))
         {
             return null;
         }
index c69e0271372cfa67da0075f4666ce42e44def7bd..0422f1fa66ca0a63adf57d9f086155b7bf7851cf 100644 (file)
@@ -60,7 +60,7 @@ namespace Content.Client.ParticleAccelerator.UI
             _drawNoiseGenerator.SetFractalType(FastNoiseLite.FractalType.FBm);
             _drawNoiseGenerator.SetFrequency(0.5f);
 
-            var resourceCache = IoCManager.Resolve<IResourceCache>();
+            var resourceCache = IoCManager.Resolve<IClientResourceCache>();
             var font = resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 13);
             var panelTex = resourceCache.GetTexture("/Textures/Interface/Nano/button.svg.96dpi.png");
 
@@ -474,7 +474,7 @@ namespace Content.Client.ParticleAccelerator.UI
             private readonly TextureRect _unlit;
             private readonly RSI _rsi;
 
-            public PASegmentControl(ParticleAcceleratorControlMenu menu, IResourceCache cache, string name)
+            public PASegmentControl(ParticleAcceleratorControlMenu menu, IClientResourceCache cache, string name)
             {
                 _menu = menu;
                 _baseState = name;
index 04d8cc76f9b2331948a7057a659680b2569c1847..7c222ee4a8ef11a21ade4a324327f4b80ca8dfff 100644 (file)
@@ -57,7 +57,7 @@ public sealed class NavMapControl : MapGridControl
         IoCManager.InjectDependencies(this);
 
         _transform = _entManager.System<SharedTransformSystem>();
-        var cache = IoCManager.Resolve<IResourceCache>();
+        var cache = IoCManager.Resolve<IClientResourceCache>();
         _font = new VectorFont(cache.GetResource<FontResource>("/EngineFonts/NotoSans/NotoSans-Regular.ttf"), 16);
 
         RectClipContent = true;
index 5adc2e1ff0c70995a4a7dc77cd3378d65f0ee13c..5914c1b9d352b6fc258e0eb6f02b79b47dd1d88b 100644 (file)
@@ -39,7 +39,7 @@ public sealed class PopupOverlay : Overlay
         IEntityManager entManager,
         IPlayerManager playerMgr,
         IPrototypeManager protoManager,
-        IResourceCache cache,
+        IClientResourceCache cache,
         IUserInterfaceManager uiManager,
         PopupSystem popup)
     {
index d68272a107e4f5541b79edc767237a8e677f637e..4e27b119fc540bb8c19b7d8744a30d7faf6f6d25 100644 (file)
@@ -23,7 +23,7 @@ namespace Content.Client.Popups
         [Dependency] private readonly IOverlayManager _overlay = default!;
         [Dependency] private readonly IPlayerManager _playerManager = default!;
         [Dependency] private readonly IPrototypeManager _prototype = default!;
-        [Dependency] private readonly IResourceCache _resource = default!;
+        [Dependency] private readonly IClientResourceCache _resource = default!;
         [Dependency] private readonly IGameTiming _timing = default!;
         [Dependency] private readonly IUserInterfaceManager _uiManager = default!;
         [Dependency] private readonly IReplayRecordingManager _replayRecording = default!;
index f1052086de6603b53ce11cf017b6373ab8506a70..8ff2f6c2d9e90a90ff554aad9791e1ad8d0a6f8e 100644 (file)
@@ -42,7 +42,7 @@ namespace Content.Client.Preferences.UI
 
         public CharacterSetupGui(
             IEntityManager entityManager,
-            IResourceCache resourceCache,
+            IClientResourceCache resourceCache,
             IClientPreferencesManager preferencesManager,
             IPrototypeManager prototypeManager,
             IConfigurationManager configurationManager)
index 8c721fa7771d1fdf18ef8e1c7a2577262a5ea465..cfa7e27fb81e8112ddcbe3fcccc4981f7abf4113 100644 (file)
@@ -23,7 +23,7 @@ public sealed class RadiationDebugOverlay : Overlay
         IoCManager.InjectDependencies(this);
         _radiation = _entityManager.System<RadiationSystem>();
 
-        var cache = IoCManager.Resolve<IResourceCache>();
+        var cache = IoCManager.Resolve<IClientResourceCache>();
         _font = new VectorFont(cache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8);
     }
 
index cbb511725523f74de1ac6f935e17cfbce2029263..b9880f339b0c4cbc1205652d76dbc61265a5f5ee 100644 (file)
@@ -135,7 +135,6 @@ public sealed class ContentReplayPlaybackManager
         {
             case RoundEndMessageEvent:
             case PopupEvent:
-            case AudioMessage:
             case PickupAnimationEvent:
             case MeleeLungeEvent:
             case SharedGunSystem.HitscanEvent:
index f3f75a2950d04ede0b0a59698043b18f94e92b6a..d546a396f521887395225a01e95fa25e6077581c 100644 (file)
@@ -9,7 +9,7 @@ namespace Content.Client.Replay.UI.Loading;
 [Virtual]
 public class LoadingScreen<TResult> : State
 {
-    [Dependency] private readonly IResourceCache _resourceCache = default!;
+    [Dependency] private readonly IClientResourceCache _resourceCache = default!;
     [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
 
     public event Action<TResult?, Exception?>? OnJobFinished;
index bbb51114380be13c8c2fa4c007383451df0e8dbb..6847a73ab9c27c5f8ca46abeae5cf2962540b1eb 100644 (file)
@@ -14,7 +14,7 @@ public sealed partial class LoadingScreenControl : Control
 {
     public static SpriteSpecifier Sprite = new SpriteSpecifier.Rsi(new ("/Textures/Mobs/Silicon/Bots/mommi.rsi"), "wiggle");
 
-    public LoadingScreenControl(IResourceCache resCache)
+    public LoadingScreenControl(IClientResourceCache resCache)
     {
         RobustXamlLoader.Load(this);
 
index be8b8fed3b3a667dd991a44886bda953dee439ec..b5a74afcb6107c58ff77c3971c80fd9805d01b51 100644 (file)
@@ -9,27 +9,27 @@ namespace Content.Client.Resources
     [PublicAPI]
     public static class ResourceCacheExtensions
     {
-        public static Texture GetTexture(this IResourceCache cache, ResPath path)
+        public static Texture GetTexture(this IClientResourceCache cache, ResPath path)
         {
             return cache.GetResource<TextureResource>(path);
         }
 
-        public static Texture GetTexture(this IResourceCache cache, string path)
+        public static Texture GetTexture(this IClientResourceCache cache, string path)
         {
             return GetTexture(cache, new ResPath(path));
         }
 
-        public static Font GetFont(this IResourceCache cache, ResPath path, int size)
+        public static Font GetFont(this IClientResourceCache cache, ResPath path, int size)
         {
             return new VectorFont(cache.GetResource<FontResource>(path), size);
         }
 
-        public static Font GetFont(this IResourceCache cache, string path, int size)
+        public static Font GetFont(this IClientResourceCache cache, string path, int size)
         {
             return cache.GetFont(new ResPath(path), size);
         }
 
-        public static Font GetFont(this IResourceCache cache, ResPath[] path, int size)
+        public static Font GetFont(this IClientResourceCache cache, ResPath[] path, int size)
         {
             var fs = new Font[path.Length];
             for (var i = 0; i < path.Length; i++)
@@ -38,7 +38,7 @@ namespace Content.Client.Resources
             return new StackedFont(fs);
         }
 
-        public static Font GetFont(this IResourceCache cache, string[] path, int size)
+        public static Font GetFont(this IClientResourceCache cache, string[] path, int size)
         {
             var rp = new ResPath[path.Length];
             for (var i = 0; i < path.Length; i++)
index 4476e2a90ae0a79947fefdff5f77c72cdddd33a6..cd12f8fc4596a6adaa9230dabc3b5fb34d026582 100644 (file)
@@ -10,7 +10,7 @@ namespace Content.Client.SprayPainter;
 
 public sealed class SprayPainterSystem : SharedSprayPainterSystem
 {
-    [Dependency] private readonly IResourceCache _resourceCache = default!;
+    [Dependency] private readonly IClientResourceCache _resourceCache = default!;
 
     public List<SprayPainterEntry> Entries { get; private set; } = new();
 
index 5068f97e36fd7f739e64cb90840ea02cf86b0c37..02f21f0bf565ef7731cccb50ffb86f8a826d2532 100644 (file)
@@ -41,7 +41,7 @@ namespace Content.Client.Stylesheets
         protected StyleBoxTexture BaseAngleRect { get; }
         protected StyleBoxTexture AngleBorderRect { get; }
 
-        protected StyleBase(IResourceCache resCache)
+        protected StyleBase(IClientResourceCache resCache)
         {
             var notoSans12 = resCache.GetFont
             (
index 2ef5a63ac7311bc1262ab84f5978ac96ca4907bf..b581c49a9e648f3eef5959149d2c18d58331a529 100644 (file)
@@ -20,7 +20,7 @@ namespace Content.Client.Stylesheets
 {
     public static class ResCacheExtension
     {
-        public static Font NotoStack(this IResourceCache resCache, string variation = "Regular", int size = 10, bool display = false)
+        public static Font NotoStack(this IClientResourceCache resCache, string variation = "Regular", int size = 10, bool display = false)
         {
             var ds = display ? "Display" : "";
             var sv = variation.StartsWith("Bold", StringComparison.Ordinal) ? "Bold" : "Regular";
@@ -144,7 +144,7 @@ namespace Content.Client.Stylesheets
 
         public override Stylesheet Stylesheet { get; }
 
-        public StyleNano(IResourceCache resCache) : base(resCache)
+        public StyleNano(IClientResourceCache resCache) : base(resCache)
         {
             var notoSans8 = resCache.NotoStack(size: 8);
             var notoSans10 = resCache.NotoStack(size: 10);
index 3bb4e986af54701366e8682e0bdd851f2081b6b7..2c48ce65f50a0e3d97ec0e9564fa27805baf7c2b 100644 (file)
@@ -24,7 +24,7 @@ namespace Content.Client.Stylesheets
 
         public override Stylesheet Stylesheet { get; }
 
-        public StyleSpace(IResourceCache resCache) : base(resCache)
+        public StyleSpace(IClientResourceCache resCache) : base(resCache)
         {
             var notoSans10 = resCache.GetFont
             (
index 4c767bd554ecf0e6d138248a22f138fbaa89c2c3..f817816fc2f5a2a1b5270c565620ce479b4826fd 100644 (file)
@@ -7,7 +7,7 @@ namespace Content.Client.Stylesheets
     public sealed class StylesheetManager : IStylesheetManager
     {
         [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
-        [Dependency] private readonly IResourceCache _resourceCache = default!;
+        [Dependency] private readonly IClientResourceCache _resourceCache = default!;
 
         public Stylesheet SheetNano { get; private set; } = default!;
         public Stylesheet SheetSpace { get; private set; } = default!;
index 59ac435acf10d694edb6801655c29249f9c49517..0f60c4975280159b3f04c4e20452197a3b24d906 100644 (file)
@@ -18,7 +18,7 @@ namespace Content.Client.SurveillanceCamera.UI;
 public sealed partial class SurveillanceCameraMonitorWindow : DefaultWindow
 {
     [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
-    [Dependency] private readonly IResourceCache _resourceCache = default!;
+    [Dependency] private readonly IClientResourceCache _resourceCache = default!;
 
     public event Action<string>? CameraSelected;
     public event Action<string>? SubnetOpened;
index 87abec80bb9e94a876e6058663fadcee543645e1..ba4f922ddba011e02193d77fd41dae094541bd4f 100644 (file)
@@ -2,6 +2,8 @@ using System.Numerics;
 using Content.Shared.Traits.Assorted;
 using Robust.Shared.Random;
 using Robust.Client.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Client.Traits;
@@ -40,7 +42,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem
 
     private void OnPlayerDetach(EntityUid uid, ParacusiaComponent component, LocalPlayerDetachedEvent args)
     {
-        component.Stream?.Stop();
+        component.Stream = _audio.Stop(component.Stream);
     }
 
     private void PlayParacusiaSounds(EntityUid uid)
@@ -66,7 +68,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem
         var newCoords = Transform(uid).Coordinates.Offset(randomOffset);
 
         // Play the sound
-        paracusia.Stream = _audio.PlayStatic(paracusia.Sounds, uid, newCoords);
+        paracusia.Stream = _audio.PlayStatic(paracusia.Sounds, uid, newCoords).Value.Entity;
     }
 
 }
index 1c9156585874dcff87838b23ac63ffc49013d5be..44c92456a1f7d62b9aeff5f3b21bab13b95503d5 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Shared.Trigger;
 using Robust.Client.Animations;
 using Robust.Client.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameObjects;
 
 namespace Content.Client.Trigger;
index 6cf7622ea4e8a65038d8069573a28a03a5c34b11..f52bd6573e0e460c256b49ace584cffb1bf572d5 100644 (file)
@@ -19,7 +19,7 @@ namespace Content.Client.UserInterface.Controls.FancyTree;
 [GenerateTypedNameReferences]
 public sealed partial class FancyTree : Control
 {
-    [Dependency] private readonly IResourceCache _resCache = default!;
+    [Dependency] private readonly IClientResourceCache _resCache = default!;
 
     public const string StylePropertyLineWidth = "LineWidth";
     public const string StylePropertyLineColor = "LineColor";
index 7797a096de30f94a03462a76f6c887c1928a4ffc..7ab855c0eed4395b73d37c3cd6d88eafc236a037 100644 (file)
@@ -21,7 +21,7 @@ namespace Content.Client.UserInterface.Systems.Atmos.GasTank
         private readonly Control _contentContainer;
 
 
-        private readonly IResourceCache _resourceCache = default!;
+        private readonly IClientResourceCache _resourceCache = default!;
         private readonly RichTextLabel _lblPressure;
         private readonly FloatSpinBox _spbPressure;
         private readonly RichTextLabel _lblInternals;
@@ -30,7 +30,7 @@ namespace Content.Client.UserInterface.Systems.Atmos.GasTank
         public GasTankWindow(GasTankBoundUserInterface owner)
         {
             TextureButton btnClose;
-            _resourceCache = IoCManager.Resolve<IResourceCache>();
+            _resourceCache = IoCManager.Resolve<IClientResourceCache>();
             _owner = owner;
             var rootContainer = new LayoutContainer {Name = "GasTankRoot"};
             AddChild(rootContainer);
index 87d4b8072fcc4fcde6748f0513c893152fcb77cd..659792f967486e15e89eb54431979fa51469e67c 100644 (file)
@@ -20,6 +20,7 @@ using Robust.Client.UserInterface.Controllers;
 using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.CustomControls;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
@@ -34,6 +35,7 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
     [Dependency] private readonly IPlayerManager _playerManager = default!;
     [Dependency] private readonly IClyde _clyde = default!;
     [Dependency] private readonly IUserInterfaceManager _uiManager = default!;
+    [UISystemDependency] private readonly SharedAudioSystem _audio = default!;
 
     private BwoinkSystem? _bwoinkSystem;
     private MenuButton? GameAHelpButton => UIManager.GetActiveUIWidgetOrNull<GameTopMenuBar>()?.AHelpButton;
@@ -128,7 +130,7 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
         }
         if (localPlayer.UserId != message.TrueSender)
         {
-            SoundSystem.Play("/Audio/Effects/adminhelp.ogg", Filter.Local());
+            _audio.PlayGlobal("/Audio/Effects/adminhelp.ogg", Filter.Local(), false);
             _clyde.RequestWindowAttention();
         }
 
index d19f167587fc2ed2e7daa2b839dabfb88e882b72..a32a36a7a469a54c2124aa82612c253e0c562f32 100644 (file)
@@ -20,7 +20,7 @@ public sealed class ChannelFilterButton : ContainerButton
     public ChannelFilterButton()
     {
         _chatUIController = UserInterfaceManager.GetUIController<ChatUIController>();
-        var filterTexture = IoCManager.Resolve<IResourceCache>()
+        var filterTexture = IoCManager.Resolve<IClientResourceCache>()
             .GetTexture("/Textures/Interface/Nano/filter.svg.96dpi.png");
 
         // needed for same reason as ChannelSelectorButton
index 56c0c2863482302ce6631501c1d43e4515f525f8..79d23a94beeb87cf363fff8b4c32fc16b52454ef 100644 (file)
@@ -1,7 +1,9 @@
 using Content.Client.UserInterface.Systems.Chat.Controls;
 using Content.Shared.Chat;
 using Content.Shared.Input;
+using Robust.Client.Audio;
 using Robust.Client.AutoGenerated;
+using Robust.Client.GameObjects;
 using Robust.Client.UserInterface;
 using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.XAML;
@@ -19,6 +21,7 @@ public partial class ChatBox : UIWidget
 #pragma warning restore RA0003
 {
     private readonly ChatUIController _controller;
+    private readonly IEntityManager _entManager;
 
     public bool Main { get; set; }
 
@@ -27,6 +30,7 @@ public partial class ChatBox : UIWidget
     public ChatBox()
     {
         RobustXamlLoader.Load(this);
+        _entManager = IoCManager.Resolve<IEntityManager>();
 
         ChatInput.Input.OnTextEntered += OnTextEntered;
         ChatInput.Input.OnKeyBindDown += OnKeyBindDown;
@@ -52,8 +56,8 @@ public partial class ChatBox : UIWidget
             return;
         }
 
-        if (msg is { Read: false, AudioPath: not null })
-            SoundSystem.Play(msg.AudioPath, Filter.Local(), new AudioParams().WithVolume(msg.AudioVolume));
+        if (msg is { Read: false, AudioPath: { } })
+            _entManager.System<AudioSystem>().PlayGlobal(msg.AudioPath, Filter.Local(), false, AudioParams.Default.WithVolume(msg.AudioVolume));
 
         msg.Read = true;
 
index 4a64b466c3cc15b386eb2b3433ab2485c3f87a99..2cabe67988953e7d0c3ac7ca0e67c8d0e81c3ea4 100644 (file)
@@ -8,12 +8,12 @@ namespace Content.Client.UserInterface.XamlExtensions;
 [PublicAPI]
 public sealed class TexExtension
 {
-    private IResourceCache _resourceCache;
+    private IClientResourceCache _resourceCache;
     public string Path { get; }
 
     public TexExtension(string path)
     {
-        _resourceCache = IoCManager.Resolve<IResourceCache>();
+        _resourceCache = IoCManager.Resolve<IClientResourceCache>();
         Path = path;
     }
 
index 3220f2bdb21f54b660ac3d3919c2fbae6e58e33e..63c706c86b3c5d295477adab9454086cfc71175f 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using Content.Shared.Voting;
 using Robust.Client;
+using Robust.Client.Audio;
 using Robust.Client.Console;
 using Robust.Client.GameObjects;
 using Robust.Client.UserInterface;
index 4e4df4a156802bf1db982970b939afa67184a069..565672ad383d3768e4bbc8831fd3a5ab4dc7ce87 100644 (file)
@@ -2,6 +2,8 @@ using Content.Shared.Projectiles;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Systems;
 using Robust.Client.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
index 12af31b8631b6f2492dde2598b4be1114bfc8d6f..0a487c1b5b4e881eb2726bc92d0d0d0f8c25c873 100644 (file)
@@ -24,7 +24,7 @@ public sealed class WeatherOverlay : Overlay
     [Dependency] private readonly IGameTiming _timing = default!;
     [Dependency] private readonly IMapManager _mapManager = default!;
     [Dependency] private readonly IPrototypeManager _protoManager = default!;
-    [Dependency] private readonly IResourceCache _cache = default!;
+    [Dependency] private readonly IClientResourceCache _cache = default!;
     private readonly SharedTransformSystem _transform;
     private readonly SpriteSystem _sprite;
     private readonly WeatherSystem _weather;
index e1742f479000484d0aeaff86bc90522ea716a4f7..bf8aa2a0f753f4b8f9705a1d1fe0c904a33a6f59 100644 (file)
@@ -1,8 +1,10 @@
 using System.Numerics;
 using Content.Shared.Weather;
+using Robust.Client.Audio;
 using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.Player;
+using Robust.Shared.Audio;
 using Robust.Shared.GameStates;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
@@ -10,6 +12,7 @@ using Robust.Shared.Physics;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Player;
+using AudioComponent = Robust.Shared.Audio.Components.AudioComponent;
 
 namespace Content.Client.Weather;
 
@@ -55,18 +58,18 @@ public sealed class WeatherSystem : SharedWeatherSystem
         {
             weather.LastOcclusion = 0f;
             weather.LastAlpha = 0f;
-            weather.Stream?.Stop();
-            weather.Stream = null;
+            weather.Stream = _audio.Stop(weather.Stream);
             return;
         }
 
         if (!Timing.IsFirstTimePredicted || weatherProto.Sound == null)
             return;
 
-        weather.Stream ??= _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true);
+        weather.Stream ??= _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true).Value.Entity;
         var volumeMod = MathF.Pow(10, weatherProto.Sound.Params.Volume / 10f);
 
-        var stream = (AudioSystem.PlayingStream) weather.Stream!;
+        var stream = weather.Stream.Value;
+        var comp = Comp<AudioComponent>(stream);
         var alpha = weather.LastAlpha;
         alpha = MathF.Pow(alpha, 2f) * volumeMod;
         // TODO: Lerp this occlusion.
@@ -132,7 +135,7 @@ public sealed class WeatherSystem : SharedWeatherSystem
                 {
                     occlusion = _physics.IntersectRayPenetration(entXform.MapID,
                         new CollisionRay(entPos, sourceRelative.Normalized(), _audio.OcclusionCollisionMask),
-                        sourceRelative.Length(), stream.TrackingEntity);
+                        sourceRelative.Length(), stream);
                 }
             }
         }
@@ -148,8 +151,8 @@ public sealed class WeatherSystem : SharedWeatherSystem
             weather.LastAlpha += (alpha - weather.LastAlpha) * AlphaLerpRate * frameTime;
 
         // Full volume if not on grid
-        stream.Source.SetVolumeDirect(weather.LastAlpha);
-        stream.Source.SetOcclusion(weather.LastOcclusion);
+        comp.Gain = weather.LastAlpha;
+        comp.Occlusion = weather.LastOcclusion;
     }
 
     protected override void EndWeather(EntityUid uid, WeatherComponent component, string proto)
@@ -172,9 +175,8 @@ public sealed class WeatherSystem : SharedWeatherSystem
             return true;
 
         // TODO: Fades (properly)
-        weather.Stream?.Stop();
-        weather.Stream = null;
-        weather.Stream = _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true);
+        weather.Stream = _audio.Stop(weather.Stream);
+        weather.Stream = _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true)?.Entity;
         return true;
     }
 
index 7bccc208616c2ac2b94cfffb170c003f33d12328..e1c93aa428be1748abbd5dd9ee414a6fd070631b 100644 (file)
@@ -22,7 +22,7 @@ namespace Content.Client.Wires.UI
 {
     public sealed class WiresMenu : BaseWindow
     {
-        [Dependency] private readonly IResourceCache _resourceCache = default!;
+        [Dependency] private readonly IClientResourceCache _resourceCache = default!;
 
         public WiresBoundUserInterface Owner { get; }
 
@@ -299,7 +299,7 @@ namespace Content.Client.Wires.UI
 
         private sealed class WireControl : Control
         {
-            private IResourceCache _resourceCache;
+            private IClientResourceCache _resourceCache;
 
             private const string TextureContact = "/Textures/Interface/WireHacking/contact.svg.96dpi.png";
 
@@ -307,7 +307,7 @@ namespace Content.Client.Wires.UI
             public event Action? ContactsClicked;
 
             public WireControl(WireColor color, WireLetter letter, bool isCut, bool flip, bool mirror, int type,
-                IResourceCache resourceCache)
+                IClientResourceCache resourceCache)
             {
                 _resourceCache = resourceCache;
 
@@ -412,10 +412,10 @@ namespace Content.Client.Wires.UI
                     "/Textures/Interface/WireHacking/wire_2_copper.svg.96dpi.png"
                 };
 
-                private readonly IResourceCache _resourceCache;
+                private readonly IClientResourceCache _resourceCache;
 
                 public WireRender(WireColor color, bool isCut, bool flip, bool mirror, int type,
-                    IResourceCache resourceCache)
+                    IClientResourceCache resourceCache)
                 {
                     _resourceCache = resourceCache;
                     _color = color;
@@ -507,7 +507,7 @@ namespace Content.Client.Wires.UI
                 }
             };
 
-            public StatusLight(StatusLightData data, IResourceCache resourceCache)
+            public StatusLight(StatusLightData data, IClientResourceCache resourceCache)
             {
                 var hsv = Color.ToHsv(data.Color);
                 hsv.Z /= 2;
index 34692aa082fad3427a679dfa107eb0ca22976a90..47c0d8497728238a8f6d954666d9711ddbfea535 100644 (file)
@@ -6,6 +6,8 @@ using Content.Server.Destructible.Thresholds.Triggers;
 using Content.Shared.Damage;
 using Content.Shared.Damage.Prototypes;
 using Content.Shared.FixedPoint;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Prototypes;
 using static Content.IntegrationTests.Tests.Destructible.DestructibleTestPrototypes;
index a11191a51ea3494d5ffb2a3ccd4bd502c603d21e..b9b76cdd5755df693cec95d44a3137c12c229f2a 100644 (file)
@@ -15,7 +15,7 @@ namespace Content.IntegrationTests.Tests
             await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
             var client = pair.Client;
             var prototypeManager = client.ResolveDependency<IPrototypeManager>();
-            var resourceCache = client.ResolveDependency<IResourceCache>();
+            var resourceCache = client.ResolveDependency<IClientResourceCache>();
 
             await client.WaitAssertion(() =>
             {
index 25171e1ea2ed19f05a0029689570c5ab10d6a493..f59952afecdc874090533021c395dec338fb7620 100644 (file)
@@ -619,6 +619,9 @@ public abstract partial class InteractionTest
         {
             foreach (var (proto, quantity) in expected.Entities)
             {
+                if (proto == "Audio")
+                    continue;
+
                 if (quantity < 0 && failOnExcess)
                     Assert.Fail($"Unexpected entity/stack: {proto}, quantity: {-quantity}");
 
index ffcd140a6eda3b7d9b7221519ad7a883e88495e7..f863595f9ac39f34cead7983b02928c17c1aa756 100644 (file)
@@ -4,6 +4,7 @@ using System.IO;
 using Content.Shared.Decals;
 using Robust.Client.ResourceManagement;
 using Robust.Client.Utility;
+using Robust.Shared.ContentPack;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
@@ -16,7 +17,7 @@ namespace Content.MapRenderer.Painters;
 
 public sealed class DecalPainter
 {
-    private readonly IResourceCache _cResourceCache;
+    private readonly IResourceManager _resManager;
 
     private readonly IPrototypeManager _sPrototypeManager;
 
@@ -24,7 +25,7 @@ public sealed class DecalPainter
 
     public DecalPainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
     {
-        _cResourceCache = client.ResolveDependency<IResourceCache>();
+        _resManager = client.ResolveDependency<IResourceManager>();
         _sPrototypeManager = server.ResolveDependency<IPrototypeManager>();
     }
 
@@ -63,7 +64,7 @@ public sealed class DecalPainter
         Stream stream;
         if (sprite is SpriteSpecifier.Texture texture)
         {
-            stream = _cResourceCache.ContentFileRead(texture.TexturePath);
+            stream = _resManager.ContentFileRead(texture.TexturePath);
         }
         else if (sprite is SpriteSpecifier.Rsi rsi)
         {
@@ -73,7 +74,7 @@ public sealed class DecalPainter
                 path = $"/Textures/{path}";
             }
 
-            stream = _cResourceCache.ContentFileRead(path);
+            stream = _resManager.ContentFileRead(path);
         }
         else
         {
index 79f2ed76796cb9fff0aa5a60e23aa712e10b7987..de6b98711f2e9d651c4d6cd47143243b92f73017 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.ResourceManagement;
+using Robust.Shared.ContentPack;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Timing;
 using SixLabors.ImageSharp;
@@ -14,7 +15,7 @@ namespace Content.MapRenderer.Painters;
 
 public sealed class EntityPainter
 {
-    private readonly IResourceCache _cResourceCache;
+    private readonly IResourceManager _resManager;
 
     private readonly Dictionary<(string path, string state), Image> _images;
     private readonly Image _errorImage;
@@ -23,12 +24,12 @@ public sealed class EntityPainter
 
     public EntityPainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
     {
-        _cResourceCache = client.ResolveDependency<IResourceCache>();
+        _resManager = client.ResolveDependency<IResourceManager>();
 
         _sEntityManager = server.ResolveDependency<IEntityManager>();
 
         _images = new Dictionary<(string path, string state), Image>();
-        _errorImage = Image.Load<Rgba32>(_cResourceCache.ContentFileRead("/Textures/error.rsi/error.png"));
+        _errorImage = Image.Load<Rgba32>(_resManager.ContentFileRead("/Textures/error.rsi/error.png"));
     }
 
     public void Run(Image canvas, List<EntityData> entities)
@@ -81,7 +82,7 @@ public sealed class EntityPainter
 
                 if (!_images.TryGetValue(key, out image!))
                 {
-                    var stream = _cResourceCache.ContentFileRead($"{rsi.Path}/{state.StateId}.png");
+                    var stream = _resManager.ContentFileRead($"{rsi.Path}/{state.StateId}.png");
                     image = Image.Load<Rgba32>(stream);
 
                     _images[key] = image;
index 461bad9f21fc4df310f13f11f8a2878d6a325cc1..cac0f960c460e0fa80ad4640ed4ce1a357273a87 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using Robust.Client.Graphics;
 using Robust.Client.ResourceManagement;
+using Robust.Shared.ContentPack;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
@@ -19,12 +20,12 @@ namespace Content.MapRenderer.Painters
         public const int TileImageSize = EyeManager.PixelsPerMeter;
 
         private readonly ITileDefinitionManager _sTileDefinitionManager;
-        private readonly IResourceCache _cResourceCache;
+        private readonly IResourceManager _resManager;
 
         public TilePainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
         {
             _sTileDefinitionManager = server.ResolveDependency<ITileDefinitionManager>();
-            _cResourceCache = client.ResolveDependency<IResourceCache>();
+            _resManager = client.ResolveDependency<IResourceManager>();
         }
 
         public void Run(Image gridCanvas, EntityUid gridUid, MapGridComponent grid)
@@ -37,7 +38,7 @@ namespace Content.MapRenderer.Painters
             var yOffset = -bounds.Bottom;
             var tileSize = grid.TileSize * TileImageSize;
 
-            var images = GetTileImages(_sTileDefinitionManager, _cResourceCache, tileSize);
+            var images = GetTileImages(_sTileDefinitionManager, _resManager, tileSize);
             var i = 0;
 
             grid.GetAllTiles().AsParallel().ForAll(tile =>
@@ -61,7 +62,7 @@ namespace Content.MapRenderer.Painters
 
         private Dictionary<string, List<Image>> GetTileImages(
             ITileDefinitionManager tileDefinitionManager,
-            IResourceCache resourceCache,
+            IResourceManager resManager,
             int tileSize)
         {
             var stopwatch = new Stopwatch();
@@ -78,7 +79,7 @@ namespace Content.MapRenderer.Painters
 
                 images[path] = new List<Image>(definition.Variants);
 
-                using var stream = resourceCache.ContentFileRead(path);
+                using var stream = resManager.ContentFileRead(path);
                 Image tileSheet = Image.Load<Rgba32>(stream);
 
                 if (tileSheet.Width != tileSize * definition.Variants || tileSheet.Height != tileSize)
index 5792c1bc018e248f4cd82cf0db915deb55fcdad1..fc75a93acbcbed86545c6627ee86aec18f509297 100644 (file)
@@ -27,7 +27,7 @@ public sealed class ReplayMainScreen : State
     [Dependency] private readonly IComponentFactory _factory = default!;
     [Dependency] private readonly IConfigurationManager _cfg = default!;
     [Dependency] private readonly IReplayLoadManager _loadMan = default!;
-    [Dependency] private readonly IResourceCache _resourceCache = default!;
+    [Dependency] private readonly IClientResourceCache _resourceCache = default!;
     [Dependency] private readonly IGameController _controllerProxy = default!;
     [Dependency] private readonly IClientRobustSerializer _serializer = default!;
     [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
index 8ab7f7412d4db3f1f7c2004da246114abb116f77..824c8f423b659d79edba5f7d61382bc5fc323e5a 100644 (file)
@@ -11,7 +11,7 @@ namespace Content.Replay.Menu;
 [GenerateTypedNameReferences]
 public sealed partial class ReplayMainMenuControl : Control
 {
-    public ReplayMainMenuControl(IResourceCache resCache)
+    public ReplayMainMenuControl(IClientResourceCache resCache)
     {
         RobustXamlLoader.Load(this);
 
index 147ac70a6d589f0d52863c1d6e6ee0f5ba8dd083..41bb84ab6b22223470cda583869879d9710cc6ec 100644 (file)
@@ -8,6 +8,8 @@ using Content.Shared.DoAfter;
 using Content.Shared.Interaction;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using static Content.Shared.Access.Components.AccessOverriderComponent;
index feabaa2aad6e5da1e7421cb21d7944573563b244..cc31071fe8cb69de28c7845111cd6f8a17d82e92 100644 (file)
@@ -26,6 +26,7 @@ using Content.Shared.Throwing;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Network;
@@ -39,7 +40,6 @@ namespace Content.Server.Administration.Systems
         [Dependency] private readonly IChatManager _chat = default!;
         [Dependency] private readonly IConfigurationManager _config = default!;
         [Dependency] private readonly IPlayerManager _playerManager = default!;
-        [Dependency] private readonly AudioSystem _audio = default!;
         [Dependency] private readonly HandsSystem _hands = default!;
         [Dependency] private readonly SharedJobSystem _jobs = default!;
         [Dependency] private readonly InventorySystem _inventory = default!;
@@ -49,6 +49,7 @@ namespace Content.Server.Administration.Systems
         [Dependency] private readonly PlayTimeTrackingManager _playTime = default!;
         [Dependency] private readonly SharedRoleSystem _role = default!;
         [Dependency] private readonly GameTicker _gameTicker = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly StationRecordsSystem _stationRecords = default!;
         [Dependency] private readonly TransformSystem _transform = default!;
 
@@ -340,7 +341,7 @@ namespace Content.Server.Administration.Systems
                     _popup.PopupCoordinates(Loc.GetString("admin-erase-popup", ("user", name)), coordinates, PopupType.LargeCaution);
                     var filter = Filter.Pvs(coordinates, 1, EntityManager, _playerManager);
                     var audioParams = new AudioParams().WithVolume(3);
-                    _audio.Play("/Audio/Effects/pop_high.ogg", filter, coordinates, true, audioParams);
+                    _audio.PlayStatic("/Audio/Effects/pop_high.ogg", filter, coordinates, true, audioParams);
                 }
 
                 foreach (var item in _inventory.GetHandOrInventoryEntities(entity.Value))
index 66e09d34e0f36c6af8df8fee3728ba8b7652873a..b2b63e618e61e9b6aae2799b6ddb0776c5cc44de 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Chat.Systems;
 using Content.Server.Station.Systems;
 using Content.Shared.CCVar;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Prototypes;
 
@@ -10,10 +11,11 @@ namespace Content.Server.AlertLevel;
 
 public sealed class AlertLevelSystem : EntitySystem
 {
+    [Dependency] private readonly IConfigurationManager _cfg = default!;
     [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
     [Dependency] private readonly ChatSystem _chatSystem = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly StationSystem _stationSystem = default!;
-    [Dependency] private readonly IConfigurationManager _cfg = default!;
 
     // Until stations are a prototype, this is how it's going to have to be.
     public const string DefaultAlertLevelSet = "stationAlerts";
@@ -174,7 +176,7 @@ public sealed class AlertLevelSystem : EntitySystem
             if (detail.Sound != null)
             {
                 var filter = _stationSystem.GetInOwningStation(station);
-                SoundSystem.Play(detail.Sound.GetSound(), filter, detail.Sound.Params);
+                _audio.PlayGlobal(detail.Sound.GetSound(), filter, true, detail.Sound.Params);
             }
             else
             {
index 44140193d2a3f01cdb25134cf6296ed1dc56f45d..c7704ecf76cefd0122720c311ce6d4bc2c2f2793 100644 (file)
@@ -15,6 +15,7 @@ using Content.Shared.Popups;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Timing;
 
index 54a379f693bf4780a3c38cf8c0b54b948518f3de..a75c092e2ead5746ac40b3b2215b9c3921527570 100644 (file)
@@ -6,6 +6,8 @@ using Content.Server.Tools;
 using Content.Shared.Database;
 using Content.Shared.Hands.Components;
 using Content.Shared.Interaction;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 
 namespace Content.Server.Ame.EntitySystems;
index 5189adb031ddbdd945cafe841cae98a8ce17307f..35c3bab01dd8ab3aadcb866fbdd97121e2ccfb94 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Actions.Events;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Nutrition.EntitySystems;
 using Content.Shared.Storage;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
index f1b147ac802727d0eac3dd5170052797321615fd..769558a7ad13f204bb7b47bdb9c3ae32044cd1de 100644 (file)
@@ -81,7 +81,7 @@ public sealed partial class AnomalySystem
 
         var generating = EnsureComp<GeneratingAnomalyGeneratorComponent>(uid);
         generating.EndTime = Timing.CurTime + component.GenerationLength;
-        generating.AudioStream = Audio.PlayPvs(component.GeneratingSound, uid, AudioParams.Default.WithLoop(true));
+        generating.AudioStream = Audio.PlayPvs(component.GeneratingSound, uid, AudioParams.Default.WithLoop(true))?.Entity;
         component.CooldownEndTime = Timing.CurTime + component.CooldownLength;
         UpdateGeneratorUi(uid, component);
     }
@@ -174,7 +174,8 @@ public sealed partial class AnomalySystem
         {
             if (Timing.CurTime < active.EndTime)
                 continue;
-            active.AudioStream?.Stop();
+
+            active.AudioStream = _audio.Stop(active.AudioStream);
             OnGeneratingFinished(ent, gen);
         }
     }
index 5f6220f386f4de10da980f59f8cd2726cd099e71..bb7a7304d9bb450b528cf40b0a48ba64fa5e9fbc 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Anomaly;
 using Content.Shared.Anomaly.Components;
 using Content.Shared.DoAfter;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Prototypes;
@@ -31,6 +33,7 @@ public sealed partial class AnomalySystem : SharedAnomalySystem
     [Dependency] private readonly SharedPointLightSystem _pointLight = default!;
     [Dependency] private readonly StationSystem _station = default!;
     [Dependency] private readonly RadioSystem _radio = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly UserInterfaceSystem _ui = default!;
 
     public const float MinParticleVariation = 0.8f;
index d768f905cea67baf00d02fd1fc56212e1c84362d..4233bfd7e1e57e886a7cb9a0ee70b3b15b91e272 100644 (file)
@@ -13,5 +13,5 @@ public sealed partial class GeneratingAnomalyGeneratorComponent : Component
     [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
     public TimeSpan EndTime = TimeSpan.Zero;
 
-    public IPlayingAudioStream? AudioStream;
+    public EntityUid? AudioStream;
 }
index 964a42234d3a0dd0f1ba921b2ecbc64e302e13aa..603396e31ac54dc041c0b01cfba82fd5f27c5255 100644 (file)
@@ -4,6 +4,8 @@ using Content.Server.Anomaly.Components;
 using Content.Shared.Anomaly.Components;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Teleportation.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Anomaly.Effects;
index c87dcf4eaeb95083e565c5f2282dd465cb1a9687..487d20f43f01a91a1f211f31e14354a917f9e575 100644 (file)
@@ -6,6 +6,7 @@ using Content.Shared.Chemistry.EntitySystems;
 using Robust.Shared.Prototypes;
 using Content.Shared.Sprite;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Anomaly.Effects;
 
@@ -75,7 +76,7 @@ public sealed class ReagentProducerAnomalySystem : EntitySystem
             if (anomaly.Severity >= 0.97) reagentProducingAmount *= component.SupercriticalReagentProducingModifier;
 
             newSol.AddReagent(component.ProducingReagent, reagentProducingAmount);
-            _solutionContainer.TryAddSolution(uid, producerSol, newSol); //TO DO - the container is not fully filled. 
+            _solutionContainer.TryAddSolution(uid, producerSol, newSol); //TO DO - the container is not fully filled.
 
             component.AccumulatedFrametime = 0;
 
index 737b723d390abcfe8bf9321e39ebd2c1b748e9fa..b3b8a375088e5b5c35fa5635150f851e153a1e92 100644 (file)
@@ -21,6 +21,7 @@ using Content.Shared.Mobs.Components;
 using Content.Server.Station.Systems;
 using Content.Server.Shuttles.Systems;
 using Content.Shared.Mobs;
+using Robust.Server.Audio;
 using Robust.Server.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
index 5e4d7d5ec6a5b70a3309a71bd5c9873639285327..eae9b94964770c4b9ca6f1048d5e9c90aee1f080 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.UserInterface;
 using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Arcade.SpaceVillain;
index 18dc32282b658021527f42fdbd8023b27ff2b1ea..ae4c15f2db3ac9d81b801c7cb0a066df78785f1c 100644 (file)
@@ -1,6 +1,7 @@
 using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Arcade.SpaceVillain;
index a649e57b45db4b48b06a7007a248e776f3c9f29e..2d6b073e9dfe90ef3c8a371ffbd7366ca3e496aa 100644 (file)
@@ -30,8 +30,8 @@ namespace Content.Server.Atmos.Components
 
         // Cancel toggles sounds if we re-toggle again.
 
-        public IPlayingAudioStream? ConnectStream;
-        public IPlayingAudioStream? DisconnectStream;
+        public EntityUid? ConnectStream;
+        public EntityUid? DisconnectStream;
 
         [DataField("air"), ViewVariables(VVAccess.ReadWrite)]
         public GasMixture Air { get; set; } = new();
index 020684aa3b9757a53da91383033b9548c5c4c1f8..989fed945f50d850810a0ab1cb1b5dd5506041ce 100644 (file)
@@ -101,8 +101,7 @@ namespace Content.Server.Atmos.EntitySystems
                 if(_spaceWindSoundCooldown == 0 && !string.IsNullOrEmpty(SpaceWindSound))
                 {
                     var coordinates = tile.GridIndices.ToEntityCoordinates(tile.GridIndex, _mapManager);
-                    SoundSystem.Play(SpaceWindSound, Filter.Pvs(coordinates),
-                        coordinates, AudioHelpers.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100)));
+                    _audio.PlayPvs(SpaceWindSound, coordinates, AudioParams.Default.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100)));
                 }
             }
 
index 1b44f6e81938cd0ae5323325b25baa584ed187a9..5b3d869229cdc787d1baa46d74fc35e7f16c09b5 100644 (file)
@@ -85,8 +85,7 @@ namespace Content.Server.Atmos.EntitySystems
                 // A few details on the audio parameters for fire.
                 // The greater the fire state, the lesser the pitch variation.
                 // The greater the fire state, the greater the volume.
-                SoundSystem.Play(HotspotSound, Filter.Pvs(coordinates),
-                    coordinates, AudioHelpers.WithVariation(0.15f/tile.Hotspot.State).WithVolume(-5f + 5f * tile.Hotspot.State));
+                _audio.PlayPvs(HotspotSound, coordinates, AudioParams.Default.WithVariation(0.15f/tile.Hotspot.State).WithVolume(-5f + 5f * tile.Hotspot.State));
             }
 
             if (_hotspotSoundCooldown > HotspotSoundCooldownCycles)
index d8364b652b83a3068843013aa39d0678dd1227f3..19855a71e56439fea29207fb64a4ff2aa91aa19c 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Atmos.EntitySystems;
 using Content.Shared.Maps;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Systems;
@@ -28,6 +30,7 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
     [Dependency] private readonly SharedContainerSystem _containers = default!;
     [Dependency] private readonly SharedPhysicsSystem _physics = default!;
     [Dependency] private readonly GasTileOverlaySystem _gasTileOverlaySystem = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly TransformSystem _transformSystem = default!;
     [Dependency] private readonly TileSystem _tile = default!;
 
index 17715435b2fea46f3e12c11fa96eb91b1914dbf7..f2085bc673aaa319aceeed5764c0ad23cef4b9fe 100644 (file)
@@ -13,6 +13,7 @@ using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Player;
@@ -239,10 +240,8 @@ namespace Content.Server.Atmos.EntitySystems
             if (!component.IsConnected)
                 return;
 
-            component.ConnectStream?.Stop();
-
-            if (component.ConnectSound != null)
-                component.ConnectStream = _audioSys.PlayPvs(component.ConnectSound, owner);
+            component.ConnectStream = _audioSys.Stop(component.ConnectStream);
+            component.ConnectStream = _audioSys.PlayPvs(component.ConnectSound, component.Owner)?.Entity;
 
             UpdateUserInterface(ent);
         }
@@ -259,10 +258,8 @@ namespace Content.Server.Atmos.EntitySystems
             _actions.SetToggled(component.ToggleActionEntity, false);
 
             _internals.DisconnectTank(internals);
-            component.DisconnectStream?.Stop();
-
-            if (component.DisconnectSound != null)
-                component.DisconnectStream = _audioSys.PlayPvs(component.DisconnectSound, owner);
+            component.DisconnectStream = _audioSys.Stop(component.DisconnectStream);
+            component.DisconnectStream = _audioSys.PlayPvs(component.DisconnectSound, component.Owner)?.Entity;
 
             UpdateUserInterface(ent);
         }
@@ -322,7 +319,7 @@ namespace Content.Server.Atmos.EntitySystems
                     if(environment != null)
                         _atmosphereSystem.Merge(environment, component.Air);
 
-                    _audioSys.Play(component.RuptureSound, Filter.Pvs(owner), Transform(owner).Coordinates, true, AudioParams.Default.WithVariation(0.125f));
+                    _audioSys.PlayPvs(component.RuptureSound, Transform(component.Owner).Coordinates, AudioParams.Default.WithVariation(0.125f));
 
                     QueueDel(owner);
                     return;
index b674f864426574db2735bb1ea36a2f0fd58708c4..27e64a9956d8a156b31eff049f6872d574218cea 100644 (file)
@@ -7,6 +7,7 @@ using Content.Server.DeviceNetwork.Systems;
 using Content.Server.Power.Components;
 using Content.Shared.Atmos.Monitor;
 using Content.Shared.Tag;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Utility;
index 914e732991127f51cd2f8859477b87299cbca04e..934ce8a7a47d418187a460038e55905dee39e98d 100644 (file)
@@ -8,6 +8,7 @@ using Content.Shared.Examine;
 using Content.Shared.Interaction;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Atmos.Piping.Binary.EntitySystems
@@ -17,6 +18,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
     {
         [Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
         [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly NodeContainerSystem _nodeContainer = default!;
 
         public override void Initialize()
@@ -35,10 +37,11 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
                 return;
 
             if (Loc.TryGetString("gas-valve-system-examined", out var str,
-                        ("statusColor", valve.Open ? "green" : "orange"),
-                        ("open", valve.Open)
-            ))
+                    ("statusColor", valve.Open ? "green" : "orange"),
+                    ("open", valve.Open)))
+            {
                 args.PushMarkup(str);
+            }
         }
 
         private void OnStartup(EntityUid uid, GasValveComponent component, ComponentStartup args)
@@ -50,7 +53,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
         private void OnActivate(EntityUid uid, GasValveComponent component, ActivateInWorldEvent args)
         {
             Toggle(uid, component);
-            SoundSystem.Play(component.ValveSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.25f));
+            _audio.PlayPvs(component.ValveSound, uid, AudioParams.Default.WithVariation(0.25f));
         }
 
         public void Set(EntityUid uid, GasValveComponent component, bool value)
index 14a1e5e456baff2abaf6f610add0ea2e211d8f9e..1ec1bdb1c17733e1ab9404b2d306928db3cdf4b2 100644 (file)
@@ -16,6 +16,8 @@ using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Content.Shared.Lock;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 
index b1e7dcb1878d6a5c9adca344f2b7fa0b3fbea0c2..1c5625b0b832b79732300b5fe6184f860e19a1d0 100644 (file)
@@ -1,8 +1,41 @@
+using Content.Server.GameTicking.Events;
 using Content.Shared.Audio;
+using Robust.Server.Audio;
+using Robust.Shared.Audio;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.Audio;
 
 public sealed class ContentAudioSystem : SharedContentAudioSystem
 {
+    [Dependency] private readonly AudioSystem _serverAudio = default!;
+    [Dependency] private readonly IPrototypeManager _protoManager = default!;
 
+    public override void Initialize()
+    {
+        base.Initialize();
+        SubscribeLocalEvent<RoundStartingEvent>(OnRoundStart);
+        _protoManager.PrototypesReloaded += OnProtoReload;
+    }
+
+    private void OnProtoReload(PrototypesReloadedEventArgs obj)
+    {
+        if (!obj.ByType.ContainsKey(typeof(AudioPresetPrototype)))
+            return;
+
+        _serverAudio.ReloadPresets();
+    }
+
+    public override void Shutdown()
+    {
+        base.Shutdown();
+        _protoManager.PrototypesReloaded -= OnProtoReload;
+    }
+
+    private void OnRoundStart(RoundStartingEvent ev)
+    {
+        // On cleanup all entities get purged so need to ensure audio presets are still loaded
+        // yeah it's whacky af.
+        _serverAudio.ReloadPresets();
+    }
 }
index a9f994ed5609d1065006e89721f833a8a937a010..33f2f252d90dd31180c77772d763de1d722d8b93 100644 (file)
@@ -3,6 +3,8 @@ using Content.Server.Beam.Components;
 using Content.Shared.Beam;
 using Content.Shared.Beam.Components;
 using Content.Shared.Physics;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Collision.Shapes;
index 17fe4d5effb4d51e7b84c02702aedf24577cb1f3..4a6874bcccdd9980bfdfa48d446cacca73908e4f 100644 (file)
@@ -13,6 +13,8 @@ using Content.Shared.Slippery;
 using Content.Shared.StatusEffect;
 using Content.Shared.Stunnable;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index b3b41e2f32eca0b99a78e0615dd9dccdb91de685..5c153bb46452485ee51452c68ee84382ac5c8ef2 100644 (file)
@@ -15,6 +15,7 @@ using Content.Shared.Popups;
 using Content.Shared.Timing;
 using Content.Shared.Verbs;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 
@@ -29,6 +30,7 @@ namespace Content.Server.Bible
         [Dependency] private readonly MobStateSystem _mobStateSystem = default!;
         [Dependency] private readonly PopupSystem _popupSystem = default!;
         [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly UseDelaySystem _delay = default!;
 
         public override void Initialize()
@@ -80,8 +82,8 @@ namespace Content.Server.Bible
                     summonableComp.Summon = null;
                 }
                 summonableComp.AlreadySummoned = false;
-                _popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", uid)), uid, PopupType.Medium);
-                SoundSystem.Play("/Audio/Effects/radpulse9.ogg", Filter.Pvs(uid), uid, AudioParams.Default.WithVolume(-4f));
+                _popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", summonableComp.Owner)), summonableComp.Owner, PopupType.Medium);
+                _audio.PlayPvs("/Audio/Effects/radpulse9.ogg", summonableComp.Owner, AudioParams.Default.WithVolume(-4f));
                 // Clean up the accumulator and respawn tracking component
                 summonableComp.Accumulator = 0;
                 _remQueue.Enqueue(uid);
@@ -107,7 +109,7 @@ namespace Content.Server.Bible
             {
                 _popupSystem.PopupEntity(Loc.GetString("bible-sizzle"), args.User, args.User);
 
-                SoundSystem.Play(component.SizzleSoundPath.GetSound(), Filter.Pvs(args.User), args.User);
+                _audio.PlayPvs(component.SizzleSoundPath, args.User);
                 _damageableSystem.TryChangeDamage(args.User, component.DamageOnUntrainedUse, true, origin: uid);
                 _delay.BeginDelay(uid, delay);
 
@@ -125,7 +127,7 @@ namespace Content.Server.Bible
                     var selfFailMessage = Loc.GetString(component.LocPrefix + "-heal-fail-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
                     _popupSystem.PopupEntity(selfFailMessage, args.User, args.User, PopupType.MediumCaution);
 
-                    SoundSystem.Play("/Audio/Effects/hit_kick.ogg", Filter.Pvs(args.Target.Value), args.User);
+                    _audio.PlayPvs("/Audio/Effects/hit_kick.ogg", args.User);
                     _damageableSystem.TryChangeDamage(args.Target.Value, component.DamageOnFail, true, origin: uid);
                     _delay.BeginDelay(uid, delay);
                     return;
@@ -149,7 +151,7 @@ namespace Content.Server.Bible
 
                 var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
                 _popupSystem.PopupEntity(selfMessage, args.User, args.User, PopupType.Large);
-                SoundSystem.Play(component.HealSoundPath.GetSound(), Filter.Pvs(args.Target.Value), args.User);
+                _audio.PlayPvs(component.HealSoundPath, args.User);
                 _delay.BeginDelay(uid, delay);
             }
         }
index 39403288e95fdf6f16b5f9bff153a1a5b23b8312..b48438e8a43bbc5e180e7c2eb0b46670465f27ea 100644 (file)
@@ -20,6 +20,7 @@ using Robust.Server.GameObjects;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Content.Shared.Speech.EntitySystems;
+using Robust.Server.Audio;
 
 namespace Content.Server.Body.Systems;
 
index 242b02d78c1059239db5ab611ea6db4d643dc5dc..763e53de00b49a57f5040b93f8a95253b0b5db62 100644 (file)
@@ -15,6 +15,7 @@ using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
 using System.Numerics;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Body.Systems;
 
@@ -129,7 +130,7 @@ public sealed class BodySystem : SharedBodySystem
         var filter = Filter.Pvs(bodyId, entityManager: EntityManager);
         var audio = AudioParams.Default.WithVariation(0.025f);
 
-        _audio.Play(body.GibSound, filter, coordinates, true, audio);
+        _audio.PlayStatic(body.GibSound, filter, coordinates, true, audio);
 
         foreach (var entity in gibs)
         {
index 9991edd230e6dad754837a55d78c922bb03d91f6..c9469efb0610624d038c589cd8e56b68787c732f 100644 (file)
@@ -19,6 +19,7 @@ using Content.Shared.Random;
 using Content.Shared.Tag;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index df9743a21a62edfaddf655d913068c3a505ff6ad..83445d2ae4e21ca05879c220cbe736f93818d437 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Stealth;
 using Content.Shared.Stealth.Components;
 using Content.Shared.Storage.Components;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
index 32b63f7105b328189d35dc8a4f5ab7b292dd904d..51cfc9791cb2a6d257d7478f14b4f059f1ae6a62 100644 (file)
@@ -13,6 +13,8 @@ using Content.Shared.Containers.ItemSlots;
 using Content.Shared.Mobs.Components;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
index b115e658bb2e77bdf978ae84956d50dd7dd7accf..f01be1fc715fac17ba908f9aeb627db36d0ca4d8 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.CartridgeLoader;
 using Content.Shared.CartridgeLoader.Cartridges;
 using Content.Shared.Popups;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 
index 3315f61c2fb597b79e200fcc1cc6b67e0a708788..8c4cfc76c016b0a3f2b194fde61976be8e37ba1a 100644 (file)
@@ -22,6 +22,7 @@ using Content.Shared.Radio;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Console;
 using Robust.Shared.Network;
@@ -307,7 +308,7 @@ public sealed partial class ChatSystem : SharedChatSystem
         _chatManager.ChatMessageToAll(ChatChannel.Radio, message, wrappedMessage, default, false, true, colorOverride);
         if (playSound)
         {
-            SoundSystem.Play(announcementSound?.GetSound() ?? DefaultAnnouncementSound, Filter.Broadcast(), AudioParams.Default.WithVolume(-2f));
+            _audio.PlayGlobal(announcementSound?.GetSound() ?? DefaultAnnouncementSound, Filter.Broadcast(), true, AudioParams.Default.WithVolume(-2f));
         }
         _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Global station announcement from {sender}: {message}");
     }
@@ -345,7 +346,7 @@ public sealed partial class ChatSystem : SharedChatSystem
 
         if (playDefaultSound)
         {
-            SoundSystem.Play(announcementSound?.GetSound() ?? DefaultAnnouncementSound, filter, AudioParams.Default.WithVolume(-2f));
+            _audio.PlayGlobal(announcementSound?.GetSound() ?? DefaultAnnouncementSound, filter, true, AudioParams.Default.WithVolume(-2f));
         }
 
         _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Station Announcement on {station} from {sender}: {message}");
index a831165e688eecea6c26bd77b9d9b7b147c4e8a9..07ac01fab69bff0cf6a65e9fc40c4af140a35e87 100644 (file)
@@ -14,6 +14,7 @@ using Content.Shared.Database;
 using Content.Shared.FixedPoint;
 using Content.Shared.Storage;
 using JetBrains.Annotations;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Containers;
index fc4ea0a0b2a13ed726827e2978031599fc831e0e..759d403acee0ed3b54efbfedddfe4711400b5147 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Chemistry;
 using Content.Shared.Chemistry.EntitySystems;
 using Content.Shared.DoAfter;
 using Content.Shared.Mobs.Systems;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Chemistry.EntitySystems;
 
index daa2ac80b7de14cca7fbfb7e1109d665d622c098..3768ee1051b9e767e3df2fd1936c73ac583ae9eb 100644 (file)
@@ -10,6 +10,7 @@ using Content.Shared.Database;
 using Content.Shared.Emag.Components;
 using Content.Shared.Emag.Systems;
 using JetBrains.Annotations;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Containers;
index 291a654422ebfe0e1d1f667856e505643c3b57aa..fc807069f78ebbf3792e672b5f08cfd3b802bf63 100644 (file)
@@ -8,6 +8,7 @@ using Content.Shared.FixedPoint;
 using Content.Shared.Maps;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
@@ -72,7 +73,8 @@ namespace Content.Server.Chemistry.ReactionEffects
             var smoke = args.EntityManager.System<SmokeSystem>();
             smoke.StartSmoke(ent, splitSolution, _duration, spreadAmount);
 
-            args.EntityManager.System<SharedAudioSystem>().PlayPvs(_sound, args.SolutionEntity, AudioHelpers.WithVariation(0.125f));
+            var audio = args.EntityManager.System<SharedAudioSystem>();
+            audio.PlayPvs(_sound, args.SolutionEntity, AudioHelpers.WithVariation(0.125f));
         }
     }
 }
index 6d34e0e6f73e68d5b063cae1507f0877271edf3d..8bfd6250efce3798c01760e625ac7eb9d5d0db13 100644 (file)
@@ -29,6 +29,8 @@ using Content.Shared.Roles.Jobs;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Containers;
 using Robust.Shared.Physics.Components;
index 9ce50137bf6882587039ca136c56326c8b2efde0..c170886a803a0425e7bd2e801f41f25fe8688381 100644 (file)
@@ -14,6 +14,8 @@ using Content.Server.Emoting.Systems;
 using Content.Server.Speech.EntitySystems;
 using Content.Shared.Cluwne;
 using Content.Shared.Interaction.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Cluwne;
 
index 9fa3c43ae47b8081e3afb1d44421809494b4af9d..50b705ddfeb1c63866bcbc39590009e4d51e6f11 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Shared.Construction;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Construction.Completions
index 6cf32a5e4607b57e8eb87fdf03eaaf161686cc7a..a2579c92e803b618c767c69a2ebf601758cba04e 100644 (file)
@@ -25,5 +25,5 @@ public sealed partial class PartExchangerComponent : Component
     [DataField("exchangeSound")]
     public SoundSpecifier ExchangeSound = new SoundPathSpecifier("/Audio/Items/rped.ogg");
 
-    public IPlayingAudioStream? AudioStream;
+    public EntityUid? AudioStream;
 }
index 4b543a0247a738c223e3975d4aa11c2b2e7c278f..75629146a4cdab23ba3111596f8421fbc46f2df2 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Storage;
 using Robust.Shared.Containers;
 using Robust.Shared.Utility;
 using Content.Shared.Wires;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Collections;
 
 namespace Content.Server.Construction;
@@ -34,7 +36,7 @@ public sealed class PartExchangerSystem : EntitySystem
     {
         if (args.Cancelled)
         {
-            component.AudioStream?.Stop();
+            component.AudioStream = _audio.Stop(component.AudioStream);
             return;
         }
 
@@ -168,7 +170,7 @@ public sealed class PartExchangerSystem : EntitySystem
             return;
         }
 
-        component.AudioStream = _audio.PlayPvs(component.ExchangeSound, uid);
+        component.AudioStream = _audio.PlayPvs(component.ExchangeSound, uid).Value.Entity;
 
         _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.ExchangeDuration, new ExchangerDoAfterEvent(), uid, target: args.Target, used: uid)
         {
index 16385d4d7ef8368a327c2e0cc1b95a63955d64cf..32bb96e9e2879f18d2c56cef6229d5fcd9dcb884 100644 (file)
@@ -11,6 +11,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Interaction.Events;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
index bcd1e0423adab802dc1a33d3864b6e7fc5a5f59c..95819dd1fc45de2b0b4c1b3f84be234c351a5a02 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Stunnable;
 using Content.Shared.Damage;
 using Content.Shared.Effects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
index ca5c6f5a09759e97cef99b52c607d30f288641d8..e9b074268f103d01c36e3f2d461b97118eb42694 100644 (file)
@@ -12,6 +12,8 @@ using Content.Shared.Popups;
 using Content.Shared.Verbs;
 using Content.Shared.Wires;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Defusable.Systems;
 
index 74e88292df35e8980e38942d48f5bb94aff4844f..7e43e72007821e317bdba4ce20ca45d3002c85b7 100644 (file)
@@ -15,6 +15,7 @@ using Content.Shared.Database;
 using Content.Shared.Destructible;
 using Content.Shared.FixedPoint;
 using JetBrains.Annotations;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Containers;
 using Robust.Shared.Prototypes;
index 74a4cdfb1b6060bb2e3db585b630ce38de49b44a..26ba01c359f9079bc9a1c24329aa831bfc9bfe05 100644 (file)
@@ -1,5 +1,6 @@
 using Content.Shared.Audio;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Destructible.Thresholds.Behaviors
index 8f4bade83a80cebf5821eb46ef48159b71cddee7..8ca6fd75c2ee1a88542c94034ae7c5a2b4b41894 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Server.DeviceLinking.Components;
 using Content.Server.DeviceLinking.Components.Overload;
 using Content.Server.DeviceLinking.Events;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 
index 5641b0b4aee8240b318b92a4c0f8707bd0306490..60d13b78fc214d3d62c82f64c48664d3213a87f9 100644 (file)
@@ -5,7 +5,9 @@ using Content.Shared.Examine;
 using Content.Shared.Interaction;
 using Content.Shared.Tools;
 using Content.Shared.Popups;
-using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
+using Content.Shared.Tools.Systems;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using SignalReceivedEvent = Content.Server.DeviceLinking.Events.SignalReceivedEvent;
 
 namespace Content.Server.DeviceLinking.Systems;
index 7bcc438b92af02808282a5547f35c34f705381d5..f6469d68b932d845fafd025709a8b7b2d2e938c9 100644 (file)
@@ -2,6 +2,7 @@ using Content.Server.DeviceLinking.Components;
 using Content.Server.DeviceNetwork;
 using Content.Shared.Interaction;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.DeviceLinking.Systems;
 
index 3a7fd6bec996ce830a50c76d2c87e09c01dd7a6f..63bf5854d9cf3afecb80199f609e4cf7f4937d1e 100644 (file)
@@ -4,6 +4,8 @@ using Content.Shared.Access.Systems;
 using Content.Shared.MachineLinking;
 using Content.Shared.TextScreen;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Server.DeviceLinking.Systems;
index a977a44287a1c19de3f23872882759186c7be9db..4deb08ec3dba1d51ef69c3312f28204db4a9f66d 100644 (file)
@@ -15,6 +15,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Popups;
 using Content.Shared.Verbs;
 using JetBrains.Annotations;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Player;
index beb2a284897a55484faaca0708f8eef0447f5415..2d13679bd099f31d00d77fe7876324d131b4053c 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Shared.Dice;
 using Content.Shared.Popups;
 using JetBrains.Annotations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Dice;
index 477a167fa27c54c8313a0f443d055f5c569f4316..fab16bc315d478360db017330b2a55b9c241d05b 100644 (file)
@@ -13,6 +13,7 @@ using Content.Shared.Hands.Components;
 using Content.Shared.Movement.Events;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
index 52137f2ee6effd7a79077d4f0cc4879e9c4ebab1..f7d5cd783d45a616d4727675aa5ad1812716b309 100644 (file)
@@ -11,6 +11,8 @@ using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Serialization.Manager;
 using System.Numerics;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Dragon;
 
index ed17ba8bdc2e1d29f062e78c52643f14c5af23e7..93d6bc8db0b3a97c376f4837129b2e7c0d5a7e07 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Mind;
 using Content.Shared.Mind.Components;
 using Content.Shared.Mobs;
 using Content.Shared.Movement.Systems;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
@@ -203,7 +205,7 @@ public sealed partial class DragonSystem : EntitySystem
     private void Roar(EntityUid uid, DragonComponent comp)
     {
         if (comp.SoundRoar != null)
-            _audio.Play(comp.SoundRoar, Filter.Pvs(uid, 4f, EntityManager), uid, true);
+            _audio.PlayPvs(comp.SoundRoar, uid);
     }
 
     /// <summary>
index 8ddc8540c04a0b0fd0a3de16a76ddcb809f44f11..4dc4f198a5aa9b45a5c1cca32b970aa6cab2ec56 100644 (file)
@@ -26,6 +26,7 @@ using Content.Shared.Stunnable;
 using Content.Shared.Tag;
 using Content.Shared.Weapons.Melee.Events;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Player;
index 08374d739245af6e3eb8eecb4576d57a019737e9..ef8e1ffd987f304e1af954354f8f84f5162472e8 100644 (file)
@@ -50,11 +50,11 @@ public sealed partial class ExplosionSystem : EntitySystem
         comp.Intensity = iterationIntensity;
         comp.SpaceMatrix = spaceMatrix;
         comp.SpaceTileSize = spaceData?.TileSize ?? DefaultTileSize;
-        Dirty(comp);
+        Dirty(explosionEntity, comp);
 
         // Light, sound & visuals may extend well beyond normal PVS range. In principle, this should probably still be
         // restricted to something like the same map, but whatever.
-        _pvsSys.AddGlobalOverride(explosionEntity);
+        _pvsSys.AddGlobalOverride(GetNetEntity(explosionEntity));
 
         var appearance = AddComp<AppearanceComponent>(explosionEntity);
         _appearance.SetData(explosionEntity, ExplosionAppearanceData.Progress, 1, appearance);
index aa1ad71b16c188796cff6595265251fedeca2803..81324d00794301ab93eefd3282722f1861f2d3c2 100644 (file)
@@ -20,6 +20,7 @@ using Content.Shared.Throwing;
 using Robust.Server.GameStates;
 using Robust.Server.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Components;
@@ -48,6 +49,7 @@ public sealed partial class ExplosionSystem : EntitySystem
     [Dependency] private readonly IChatManager _chat = default!;
     [Dependency] private readonly ThrowingSystem _throwingSystem = default!;
     [Dependency] private readonly PvsOverrideSystem _pvsSys = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
 
     private EntityQuery<TransformComponent> _transformQuery;
@@ -334,7 +336,7 @@ public sealed partial class ExplosionSystem : EntitySystem
         // play sound.
         var audioRange = iterationIntensity.Count * 5;
         var filter = Filter.Pvs(epicenter).AddInRange(epicenter, audioRange);
-        SoundSystem.Play(type.Sound.GetSound(), filter, mapEntityCoords, _audioParams);
+        _audio.PlayStatic(type.Sound.GetSound(), filter, mapEntityCoords, true, _audioParams);
 
         return new Explosion(this,
             type,
index b57e9bd29872050d74b97432fa1b34da5b9c451e..854fa7f661e099fef8aec581bdc4b52c59951903 100644 (file)
@@ -24,6 +24,7 @@ using Robust.Shared.Physics.Systems;
 using Content.Shared.Mobs;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Weapons.Ranged.Events;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Explosion.EntitySystems
 {
index 7b96b8b921787cae2ea55294df6a9819f2b44438..30895deb4c3c2df2cb2e648213897122fcae2acd 100644 (file)
@@ -9,6 +9,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Verbs;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Extinguisher;
@@ -18,6 +19,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
     [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
     [Dependency] private readonly PopupSystem _popupSystem = default!;
     [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
 
     public override void Initialize()
     {
@@ -86,7 +88,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
             var drained = _solutionContainerSystem.Drain(target, targetSolution, transfer);
             _solutionContainerSystem.TryAddSolution(uid, container, drained);
 
-            SoundSystem.Play(component.RefillSound.GetSound(), Filter.Pvs(uid), uid);
+            _audio.PlayPvs(component.RefillSound, uid);
             _popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-after-interact-refilled-message", ("owner", uid)),
                 uid, args.Target.Value);
         }
@@ -135,8 +137,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
             return;
 
         extinguisher.Safety = !extinguisher.Safety;
-        SoundSystem.Play(extinguisher.SafetySound.GetSound(), Filter.Pvs(uid),
-            uid, AudioHelpers.WithVariation(0.125f).WithVolume(-4f));
+        _audio.PlayPvs(extinguisher.SafetySound, uid, AudioParams.Default.WithVariation(0.125f).WithVolume(-4f));
         UpdateAppearance(uid, extinguisher);
     }
 }
index ec95d71dcf40454940c95f11c4356f0e45aa138b..647f73bad35c24e54dc59628e96beadf4da7341d 100644 (file)
@@ -19,6 +19,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Paper;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 
index bc2c4ddabafd8b29da31f261b9d10a417e441aad..29d603bfc6b0fc3ad7bf2fa8b732e10b8e6a4bd5 100644 (file)
@@ -15,6 +15,7 @@ using Content.Shared.Physics;
 using Content.Shared.Tag;
 using Content.Shared.Traits.Assorted;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Player;
@@ -172,7 +173,7 @@ namespace Content.Server.Flash
             }
             if (sound != null)
             {
-                SoundSystem.Play(sound.GetSound(), Filter.Pvs(transform), source);
+                _audio.PlayPvs(sound, source);
             }
         }
 
index facc39f146180778551daa9f17b906a8c4c1cc29..e5ddff6c07ccccab1638e8c7ad15ccd0d5b8b907 100644 (file)
@@ -8,6 +8,7 @@ using Content.Shared.Fluids.Components;
 using Content.Shared.Interaction;
 using Content.Shared.Timing;
 using Content.Shared.Weapons.Melee;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
index ea3df2f8c4685f041f5bda40fb503f683050eadc..505ce71261fb00fb1e5ad025b9ee1740ce70c470 100644 (file)
@@ -13,6 +13,9 @@ using Content.Shared.Fluids.Components;
 using Content.Shared.Interaction;
 using Content.Shared.Tag;
 using Content.Shared.Verbs;
+using Content.Shared.Fluids.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Collections;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
index 886cb9eff14f91c9857e4260e92f4088ce32e407..4c28e3d7009e5235081c4f6c042b3f5e285f51da 100644 (file)
@@ -30,6 +30,11 @@ using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
+using Content.Shared.Movement.Components;
+using Content.Shared.Movement.Systems;
+using Content.Shared.Maps;
+using Content.Shared.Effects;
+using Robust.Server.Audio;
 
 namespace Content.Server.Fluids.EntitySystems;
 
@@ -446,8 +451,7 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
             return true;
         }
 
-        SoundSystem.Play(puddleComponent.SpillSound.GetSound(),
-            Filter.Pvs(puddleUid), puddleUid);
+        _audio.PlayPvs(puddleComponent.SpillSound, puddleUid);
         return true;
     }
 
index f0afd43dd2fb4d10e5751b62a5b2ddddb6a85c85..1b87b3ef246d692c5063294b4878939ba7b4563b 100644 (file)
@@ -12,6 +12,8 @@ using Content.Shared.FixedPoint;
 using Content.Shared.Interaction;
 using Content.Shared.Vapor;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
index acf7cbd80dcc4a38e731566bef0a22c70a228a56..a073574e1d14173e967fb1f61cc0f2b5eecb4ba2 100644 (file)
@@ -8,6 +8,7 @@ using Content.Shared.Forensics;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio.Systems;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Player;
index dfd2e98499c25fc27c1387d18dede76f78a7d68e..ad82733341c21f1adb85837863b7002bdbfd9d2b 100644 (file)
@@ -34,7 +34,7 @@ namespace Content.Server.GameTicking
                 if (args.NewStatus != SessionStatus.Disconnected)
                 {
                     mind.Session = session;
-                    _pvsOverride.AddSessionOverride(mindId.Value, session);
+                    _pvsOverride.AddSessionOverride(GetNetEntity(mindId.Value), session);
                 }
 
                 DebugTools.Assert(mind.Session == session);
@@ -122,7 +122,7 @@ namespace Content.Server.GameTicking
                     _chatManager.SendAdminAnnouncement(Loc.GetString("player-leave-message", ("name", args.Session.Name)));
                     if (mind != null)
                     {
-                        _pvsOverride.ClearOverride(mindId!.Value);
+                        _pvsOverride.ClearOverride(GetNetEntity(mindId!.Value));
                         mind.Session = null;
                     }
 
index 85f833bd1c3264111f6f49c60b3e188eeb934806..6b714c7d216e87e9a0ad57b4a225906ed4deecbf 100644 (file)
@@ -360,7 +360,7 @@ namespace Content.Server.GameTicking
                     playerIcName = icName;
 
                 if (TryGetEntity(mind.OriginalOwnedEntity, out var entity))
-                    _pvsOverride.AddGlobalOverride(entity.Value, recursive: true);
+                    _pvsOverride.AddGlobalOverride(GetNetEntity(entity.Value), recursive: true);
 
                 var roles = _roles.MindGetAllRoles(mindId);
 
@@ -609,7 +609,7 @@ namespace Content.Server.GameTicking
                 _chatSystem.DispatchGlobalAnnouncement(Loc.GetString(proto.Message), playSound: true);
 
             if (proto.Sound != null)
-                SoundSystem.Play(proto.Sound.GetSound(), Filter.Broadcast());
+                _audio.PlayGlobal(proto.Sound, Filter.Broadcast(), true);
         }
 
         private async void SendRoundStartedDiscordMessage()
index 14819fb0acaa6b672c9414517d4c88e1df494fdc..8da271e1a8d8093871fc1047b97f6aeffde825dd 100644 (file)
@@ -19,6 +19,8 @@ using Content.Shared.Roles;
 using Robust.Server;
 using Robust.Server.GameObjects;
 using Robust.Server.GameStates;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Console;
 using Robust.Shared.Map;
@@ -61,6 +63,7 @@ namespace Content.Server.GameTicking
         [Dependency] private readonly PlayTimeTrackingSystem _playTimeTrackings = default!;
         [Dependency] private readonly PvsOverrideSystem _pvsOverride = default!;
         [Dependency] private readonly ServerUpdateManager _serverUpdates = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly StationJobsSystem _stationJobs = default!;
         [Dependency] private readonly StationSpawningSystem _stationSpawning = default!;
         [Dependency] private readonly SharedTransformSystem _transform = default!;
index 779c47885f2f21c29f3adcb4679537a2cedfc704..bb8582c34bbcce0f27d5ca6a6f817c17e292d7f9 100644 (file)
@@ -44,6 +44,7 @@ using Robust.Server.GameObjects;
 using Robust.Server.Maps;
 using Robust.Server.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
index 0785d81d09b7bc1ea720eb412cf36cdb6aa1b24e..c5b58544750e71d2f27c54f0c754612a7778352e 100644 (file)
@@ -15,6 +15,9 @@ using Content.Shared.Preferences;
 using Content.Shared.Roles;
 using Robust.Server.GameObjects;
 using Robust.Server.Maps;
+using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Map;
index ef949d09fc98d5f1faf871970a796bdb50ad3aaf..145b4192b58b86896a3da58e6d65432cf34007f3 100644 (file)
@@ -17,6 +17,9 @@ using Content.Shared.PDA;
 using Content.Shared.Preferences;
 using Content.Shared.Roles;
 using Content.Shared.Roles.Jobs;
+using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
index a4febc385c1dae8e73c17f1446fbd5ce290e0668..f4319815a7adc3755547bf59b54239104dd68a00 100644 (file)
@@ -22,6 +22,8 @@ using Content.Shared.Roles;
 using Content.Shared.Zombies;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
index ae00cd378c0756fc84928085eac4086fc8108382..f498d70975fdf0498ec5f5052e0f3c63c2a7fa40 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Teleportation.Systems;
 using Content.Shared.Verbs;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Timing;
 
index 4f7d19b0a8b0c620e7b75243169cbe5b8e86eecd..7fbbf7f4f649a6d1d727d32b42c722707f12f3c3 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Tag;
 using Content.Shared.Weapons.Melee.Events;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 
index eaf95a1f1dcab2e9632b80fd9913f43330dd2a99..58eed00c492bfef408523fc66cf4fd0ef9950f7f 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Database;
 using Content.Shared.Hands;
 using Robust.Shared.Timing;
 using Content.Shared.Interaction.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Glue;
 
index b6121a7fbda42c95c4b5a85856c1a1da0a2fe13f..25009ed7dd5ee5952f60a39aba9dfe53c7a23f89 100644 (file)
@@ -13,6 +13,8 @@ using Content.Shared.Interaction.Events;
 using Content.Shared.Mobs;
 using Content.Shared.Popups;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Utility;
@@ -194,14 +196,14 @@ namespace Content.Server.Guardian
             if (TryComp<GuardianComponent>(guardian, out var guardianComp))
             {
                 guardianComp.Host = args.Args.Target.Value;
-                _audio.Play("/Audio/Effects/guardian_inject.ogg", Filter.Pvs(args.Args.Target.Value), args.Args.Target.Value, true);
+                _audio.PlayPvs("/Audio/Effects/guardian_inject.ogg", args.Args.Target.Value);
                 _popupSystem.PopupEntity(Loc.GetString("guardian-created"), args.Args.Target.Value, args.Args.Target.Value);
                 // Exhaust the activator
                 component.Used = true;
             }
             else
             {
-                Logger.ErrorS("guardian", $"Tried to spawn a guardian that doesn't have {nameof(GuardianComponent)}");
+                Log.Error($"Tried to spawn a guardian that doesn't have {nameof(GuardianComponent)}");
                 EntityManager.QueueDeleteEntity(guardian);
             }
 
@@ -219,12 +221,12 @@ namespace Content.Server.Guardian
             if (args.NewMobState == MobState.Critical)
             {
                 _popupSystem.PopupEntity(Loc.GetString("guardian-host-critical-warn"), component.HostedGuardian.Value, component.HostedGuardian.Value);
-                _audio.Play("/Audio/Effects/guardian_warn.ogg", Filter.Pvs(component.HostedGuardian.Value), component.HostedGuardian.Value, true);
+                _audio.PlayPvs("/Audio/Effects/guardian_warn.ogg", component.HostedGuardian.Value);
             }
             else if (args.NewMobState == MobState.Dead)
             {
                 //TODO: Replace WithVariation with datafield
-                _audio.Play("/Audio/Voice/Human/malescream_guardian.ogg", Filter.Pvs(uid), uid, true, AudioHelpers.WithVariation(0.20f));
+                _audio.PlayPvs("/Audio/Voice/Human/malescream_guardian.ogg", uid, AudioParams.Default.WithVariation(0.20f));
                 EntityManager.RemoveComponent<GuardianHostComponent>(uid);
             }
         }
index 4581d378f69c08b41ae151e02b4c6df7bf93e3ac..40b365105d14e47fccd83d449d618c5e9eb00746 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Database;
 using Content.Shared.Examine;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Item;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Physics.Components;
index 256a8578642ad4f7f554549714a7254e32a5e6f1..d80d7ecbfcfbb8e21581410351403ecc5c376a0a 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Server.Explosion.EntitySystems;
 using Content.Shared.Timing;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Server.IgnitionSource;
index d688941abff37a48c920acf9b81a058ec9aea14d..0fa8f7d292f2cd6b52f562d7a28e8ce3b6953d64 100644 (file)
@@ -3,6 +3,8 @@ using Content.Server.Popups;
 using Content.Shared.Body.Components;
 using Content.Shared.Examine;
 using Content.Shared.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Events;
index 86158fb7a89f5a67a0803423295172197d719c48..474284cf8066712731e8699e331a02177d644c23 100644 (file)
@@ -6,6 +6,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Mobs.Systems;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
@@ -18,6 +19,7 @@ public sealed class InteractionPopupSystem : EntitySystem
     [Dependency] private readonly IRobustRandom _random = default!;
     [Dependency] private readonly MobStateSystem _mobStateSystem = default!;
     [Dependency] private readonly PopupSystem _popupSystem = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
 
     public override void Initialize()
     {
@@ -41,15 +43,17 @@ public sealed class InteractionPopupSystem : EntitySystem
         if (curTime < component.LastInteractTime + component.InteractDelay)
             return;
 
-        if (TryComp<MobStateComponent>(uid, out var state) // if it has a MobStateComponent,
-            && !_mobStateSystem.IsAlive(uid, state))                           // AND if that state is not Alive (e.g. dead/incapacitated/critical)
+        if (TryComp<MobStateComponent>(uid, out var state)
+            && !_mobStateSystem.IsAlive(uid, state))
+        {
             return;
+        }
 
         // TODO: Should be an attempt event
         // TODO: Need to handle pausing with an accumulator.
 
         string msg = ""; // Stores the text to be shown in the popup message
-        string? sfx = null; // Stores the filepath of the sound to be played
+        SoundSpecifier? sfx = null; // Stores the filepath of the sound to be played
 
         if (_random.Prob(component.SuccessChance))
         {
@@ -57,7 +61,7 @@ public sealed class InteractionPopupSystem : EntitySystem
                 msg = Loc.GetString(component.InteractSuccessString, ("target", Identity.Entity(uid, EntityManager))); // Success message (localized).
 
             if (component.InteractSuccessSound != null)
-                sfx = component.InteractSuccessSound.GetSound();
+                sfx = component.InteractSuccessSound;
 
             if (component.InteractSuccessSpawn != null)
                 Spawn(component.InteractSuccessSpawn, Transform(uid).MapPosition);
@@ -68,7 +72,7 @@ public sealed class InteractionPopupSystem : EntitySystem
                 msg = Loc.GetString(component.InteractFailureString, ("target", Identity.Entity(uid, EntityManager))); // Failure message (localized).
 
             if (component.InteractFailureSound != null)
-                sfx = component.InteractFailureSound.GetSound();
+                sfx = component.InteractFailureSound;
 
             if (component.InteractFailureSpawn != null)
                 Spawn(component.InteractFailureSpawn, Transform(uid).MapPosition);
@@ -76,7 +80,7 @@ public sealed class InteractionPopupSystem : EntitySystem
 
         if (component.MessagePerceivedByOthers != null)
         {
-            string msgOthers = Loc.GetString(component.MessagePerceivedByOthers,
+            var msgOthers = Loc.GetString(component.MessagePerceivedByOthers,
                 ("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(uid, EntityManager)));
             _popupSystem.PopupEntity(msg, uid, args.User);
             _popupSystem.PopupEntity(msgOthers, uid, Filter.PvsExcept(args.User, entityManager: EntityManager), true);
@@ -87,9 +91,9 @@ public sealed class InteractionPopupSystem : EntitySystem
         if (sfx is not null) //not all cases will have sound.
         {
             if (component.SoundPerceivedByOthers)
-                SoundSystem.Play(sfx, Filter.Pvs(args.Target), args.Target); //play for everyone in range
+                _audio.PlayPvs(sfx, args.Target); //play for everyone in range
             else
-                SoundSystem.Play(sfx, Filter.Entities(args.User, args.Target), args.Target); //play only for the initiating entity and its target.
+                _audio.PlayEntity(sfx, Filter.Entities(args.User, args.Target), args.Target, true); //play only for the initiating entity and its target.
         }
 
         component.LastInteractTime = curTime;
index 5610582007d68a9b71505d472abc562916c86246..fb72148b88b1e261d85abe907c8012a9cbfd7be2 100644 (file)
@@ -4,6 +4,8 @@ using Content.Shared.Interaction.Events;
 using Content.Shared.Item;
 using Content.Shared.Toggleable;
 using Content.Shared.Tools.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Weapons.Melee.ItemToggle;
@@ -53,7 +55,7 @@ public sealed class ItemToggleSystem : EntitySystem
         if (TryComp<DisarmMalusComponent>(uid, out var malus))
             malus.Malus -= comp.ActivatedDisarmMalus;
 
-        _audio.Play(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params);
+        _audio.PlayEntity(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params);
 
         comp.Activated = false;
     }
@@ -66,7 +68,7 @@ public sealed class ItemToggleSystem : EntitySystem
         if (TryComp<DisarmMalusComponent>(uid, out var malus))
             malus.Malus += comp.ActivatedDisarmMalus;
 
-        _audio.Play(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params);
+        _audio.PlayEntity(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params);
 
         comp.Activated = true;
     }
index 538a069d16cb8950719788600656f4143182f3de..a92da9d2cbecc8453ebc5cdc673fb2ad3222d952 100644 (file)
@@ -29,7 +29,8 @@ namespace Content.Server.Kitchen.Components
         [DataField("ItemBreakSound")]
         public SoundSpecifier ItemBreakSound = new SoundPathSpecifier("/Audio/Effects/clang.ogg");
 
-        public IPlayingAudioStream? PlayingStream { get; set; }
+        public EntityUid? PlayingStream;
+
         [DataField("loopingSound")]
         public SoundSpecifier LoopingSound = new SoundPathSpecifier("/Audio/Machines/microwave_loop.ogg");
         #endregion
index 4b53049086de8fd6bf2d82634349d6633b72521e..2a028a85805b7db70323b2479610b45a4c6628eb 100644 (file)
@@ -48,7 +48,7 @@ namespace Content.Server.Kitchen.Components
         [DataField("juiceSound"), ViewVariables(VVAccess.ReadWrite)]
         public SoundSpecifier JuiceSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/juicer.ogg");
 
-        public IPlayingAudioStream? AudioStream;
+        public EntityUid? AudioStream;
     }
 
     [Access(typeof(ReagentGrinderSystem)), RegisterComponent]
index 6e563ff45fd5c29d55deffcfabfbf517b3e0609d..0419e13d230cac0251bc1361d74d52306709307f 100644 (file)
@@ -16,6 +16,8 @@ using Content.Shared.Nutrition.Components;
 using Content.Shared.Popups;
 using Content.Shared.Storage;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 using static Content.Shared.Kitchen.Components.KitchenSpikeComponent;
@@ -154,7 +156,7 @@ namespace Content.Server.Kitchen.EntitySystems
                 QueueDel(gib);
             }
 
-            _audio.Play(component.SpikeSound, Filter.Pvs(uid), uid, true);
+            _audio.PlayEntity(component.SpikeSound, Filter.Pvs(uid), uid, true);
         }
 
         private bool TryGetPiece(EntityUid uid, EntityUid user, EntityUid used,
index 1c8dbfb4df95dbdd2d3a1638440fa88132e62e00..e46cc76a0ed2dcc0c51f47189287bf3a036b95c8 100644 (file)
@@ -24,6 +24,7 @@ using Content.Shared.Tag;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 
@@ -73,7 +74,7 @@ namespace Content.Server.Kitchen.EntitySystems
             SetAppearance(uid, MicrowaveVisualState.Cooking, microwaveComponent);
 
             microwaveComponent.PlayingStream =
-                _audio.PlayPvs(microwaveComponent.LoopingSound, uid, AudioParams.Default.WithLoop(true).WithMaxDistance(5));
+                _audio.PlayPvs(microwaveComponent.LoopingSound, uid, AudioParams.Default.WithLoop(true).WithMaxDistance(5)).Value.Entity;
         }
 
         private void OnCookStop(EntityUid uid, ActiveMicrowaveComponent component, ComponentShutdown args)
@@ -82,7 +83,7 @@ namespace Content.Server.Kitchen.EntitySystems
                 return;
             SetAppearance(uid, MicrowaveVisualState.Idle, microwaveComponent);
 
-            microwaveComponent.PlayingStream?.Stop();
+            microwaveComponent.PlayingStream = _audio.Stop(microwaveComponent.PlayingStream);
         }
 
         /// <summary>
index 6ce53dc53021c8bedde529e1df6120ecc881d8d6..3a6d5e4134c225c0fd10578151a48be6208e5fdc 100644 (file)
@@ -16,6 +16,7 @@ using Content.Shared.Stacks;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Timing;
 
@@ -64,7 +65,7 @@ namespace Content.Server.Kitchen.EntitySystems
                 if (active.EndTime > _timing.CurTime)
                     continue;
 
-                reagentGrinder.AudioStream?.Stop();
+                reagentGrinder.AudioStream = _audioSystem.Stop(reagentGrinder.AudioStream);
                 RemCompDeferred<ActiveReagentGrinderComponent>(uid);
 
                 var inputContainer = _containerSystem.EnsureContainer<Container>(uid, SharedReagentGrinder.InputContainerId);
@@ -284,7 +285,7 @@ namespace Content.Server.Kitchen.EntitySystems
             active.Program = program;
 
             reagentGrinder.AudioStream = _audioSystem.PlayPvs(sound, uid,
-                AudioParams.Default.WithPitchScale(1 / reagentGrinder.WorkTimeMultiplier)); //slightly higher pitched
+                AudioParams.Default.WithPitchScale(1 / reagentGrinder.WorkTimeMultiplier)).Value.Entity; //slightly higher pitched
             _userInterfaceSystem.TrySendUiMessage(uid, ReagentGrinderUiKey.Key,
                 new ReagentGrinderWorkStartedMessage(program));
         }
index 309ee583162a2478900d008e163d51f0be61c296..c6614fcd4f98c0ae098d985a12c571239b8d57e8 100644 (file)
@@ -16,6 +16,8 @@ using Content.Shared.Research.Components;
 using Content.Shared.Research.Prototypes;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
 
index f4db4216cfe1f6000b3de4a7e3c6f8781ecc1707..40d212c6ad90769d39783ccefd3a89b3bac9ccca 100644 (file)
@@ -9,6 +9,9 @@ using Content.Shared.Temperature;
 using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Light.EntitySystems
index f3e7eaca0eab6ba1563f7086e586e09aa18dea5e..70ce3c748809e55d9713ae93a5bbabc67587e0d1 100644 (file)
@@ -9,6 +9,10 @@ using Content.Shared.Light.Components;
 using Content.Shared.Rounding;
 using Content.Shared.Toggleable;
 using Content.Shared.Verbs;
+using JetBrains.Annotations;
+using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.GameStates;
 using Robust.Shared.Utility;
index 43b0b4662c84250c56f94475dd239bd4aed02a61..5714bde3e5f0c4289b7e609c3c2768a77e80eb92 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Light.Components;
 using Content.Shared.Throwing;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Light.EntitySystems
@@ -11,6 +12,7 @@ namespace Content.Server.Light.EntitySystems
     public sealed class LightBulbSystem : EntitySystem
     {
         [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
 
         public override void Initialize()
         {
@@ -68,7 +70,7 @@ namespace Content.Server.Light.EntitySystems
             if (!Resolve(uid, ref bulb))
                 return;
 
-            SoundSystem.Play(bulb.BreakSound.GetSound(), Filter.Pvs(uid), uid);
+            _audio.PlayPvs(bulb.BreakSound, uid);
         }
 
         private void UpdateAppearance(EntityUid uid, LightBulbComponent? bulb = null,
index d37080a1e10e0db1b418061a0e5dcfb5da4baf55..8347f14ea46e77547f95d0ba2f997e9023cbe9a8 100644 (file)
@@ -6,6 +6,8 @@ using Content.Shared.Light.Components;
 using Content.Shared.Popups;
 using Content.Shared.Storage;
 using JetBrains.Annotations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 
 namespace Content.Server.Light.EntitySystems;
index 88f416ce9d46e577f34c057ab1ff92a79576347f..2195c69b184b1a704e96549bec1bf4f7150eaefd 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Smoking;
 using Content.Shared.Temperature;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Light.EntitySystems
@@ -15,6 +16,7 @@ namespace Content.Server.Light.EntitySystems
     {
         [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
         [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly SharedItemSystem _item = default!;
         [Dependency] private readonly SharedPointLightSystem _lights = default!;
         [Dependency] private readonly TransformSystem _transformSystem = default!;
@@ -79,8 +81,7 @@ namespace Content.Server.Light.EntitySystems
             var component = matchstick.Comp;
 
             // Play Sound
-            SoundSystem.Play(component.IgniteSound.GetSound(), Filter.Pvs(matchstick),
-                matchstick, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
+            _audio.PlayPvs(component.IgniteSound, matchstick, AudioParams.Default.WithVariation(0.125f).WithVolume(-0.125f));
 
             // Change state
             SetState(matchstick, component, SmokableState.Lit);
index cd4322aa26720cf06ebd60f3b5c63bba8bde5835..d157866c7665b90f109a27714bf5316e4d0a45f6 100644 (file)
@@ -23,6 +23,12 @@ using Robust.Shared.Audio;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
+using Content.Shared.DoAfter;
+using Content.Server.Emp;
+using Content.Server.DeviceLinking.Events;
+using Content.Server.DeviceLinking.Systems;
+using Content.Shared.Inventory;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Light.EntitySystems
 {
@@ -130,7 +136,7 @@ namespace Content.Server.Light.EntitySystems
                     if (damage != null)
                         _adminLogger.Add(LogType.Damaged, $"{ToPrettyString(args.User):user} burned their hand on {ToPrettyString(args.Target):target} and received {damage.Total:damage} damage");
 
-                    _audio.Play(light.BurnHandSound, Filter.Pvs(uid), uid, true);
+                    _audio.PlayEntity(light.BurnHandSound, Filter.Pvs(uid), uid, true);
 
                     args.Handled = true;
                     return;
@@ -281,7 +287,7 @@ namespace Content.Server.Light.EntitySystems
                         if (time > light.LastThunk + ThunkDelay)
                         {
                             light.LastThunk = time;
-                            _audio.Play(light.TurnOnSound, Filter.Pvs(uid), uid, true, AudioParams.Default.WithVolume(-10f));
+                            _audio.PlayEntity(light.TurnOnSound, Filter.Pvs(uid), uid, true, AudioParams.Default.WithVolume(-10f));
                         }
                     }
                     else
index c24966aba82387025fbada939420d4eb52907ee4..a1ed71ee4cdb48aece8a605de4e00df9bde07e6e 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Light.Components;
 using Content.Shared.Mind.Components;
 using Content.Shared.Toggleable;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
index 10a30dc25cbdcac5e03868641c5caa647e4e3671..86921d222ce50aab42926ad9bf5e4c41f4ef3d73 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Item;
 using Content.Shared.Lube;
 using Content.Shared.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Lube;
index 4fbd9e3ec78de57802d49cf032e13f1fbc81737a..42bae2ba6fce8bfa827dbbf7fb85478b011a0acb 100644 (file)
@@ -19,6 +19,7 @@ using Content.Shared.Physics;
 using Content.Shared.Storage;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Random;
 using Robust.Shared.Serialization.Manager;
index 5c539720a3b46df7a8b37c93a95607cdbb57dae1..07c1e11cef3d6291e1a2c013bcb23b307e7c938a 100644 (file)
@@ -17,6 +17,19 @@ using Content.Shared.MassMedia.Components;
 using Content.Shared.MassMedia.Systems;
 using Content.Shared.PDA;
 using Robust.Server.GameObjects;
+using System.Linq;
+using Content.Server.Administration.Logs;
+using Content.Server.CartridgeLoader.Cartridges;
+using Content.Shared.CartridgeLoader;
+using Content.Shared.CartridgeLoader.Cartridges;
+using Content.Server.CartridgeLoader;
+using Content.Server.GameTicking;
+using Robust.Shared.Timing;
+using Content.Server.Popups;
+using Content.Server.StationRecords.Systems;
+using Content.Shared.Database;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
index b3626774c83eabb7d1a8453b43437249f1f04c79..99b2116e2562421e41efa3868e5b880590caab9d 100644 (file)
@@ -8,6 +8,8 @@ using Content.Server.Construction.Components;
 using Content.Server.Stack;
 using Content.Shared.Database;
 using JetBrains.Annotations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
 
index 1424f880f360c01ccf4e7a369ef522e23802c9dd..df94bc94eefa8967ab69317b0d6fccafb9d2c953 100644 (file)
@@ -43,7 +43,7 @@ public sealed partial class MechGrabberComponent : Component
     [DataField("grabSound")]
     public SoundSpecifier GrabSound = new SoundPathSpecifier("/Audio/Mecha/sound_mecha_hydraulic.ogg");
 
-    public IPlayingAudioStream? AudioStream;
+    public EntityUid? AudioStream;
 
     [ViewVariables(VVAccess.ReadWrite)]
     public Container ItemContainer = default!;
index 499f833ac83eded7059b384934b5ec8bccfdbfd0..8b7a4c62040f35fc65b04ee09fb576b1712517f6 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Mech.Equipment.Components;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Wall;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
@@ -149,7 +151,7 @@ public sealed class MechGrabberSystem : EntitySystem
             return;
 
         args.Handled = true;
-        component.AudioStream = _audio.PlayPvs(component.GrabSound, uid);
+        component.AudioStream = _audio.PlayPvs(component.GrabSound, uid).Value.Entity;
         _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.GrabDelay, new GrabberDoAfterEvent(), uid, target: target, used: uid)
         {
             BreakOnTargetMove = true,
@@ -161,7 +163,7 @@ public sealed class MechGrabberSystem : EntitySystem
     {
         if (args.Cancelled)
         {
-            component.AudioStream?.Stop();
+            component.AudioStream = _audio.Stop(component.AudioStream);
             return;
         }
 
index f16d13c23cbac80ec30ac77181b5097491c4de34..20ac9420aab60271fde1ad3f214d30c6a546190a 100644 (file)
@@ -24,6 +24,8 @@ using Content.Shared.Nutrition.Components;
 using Content.Shared.Popups;
 using Content.Shared.Throwing;
 using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Random;
index d041f8ee9d7548f5b1339f60a7c0b43b3e85bd71..320b71576e3d8e25497001dbfab7d2c6de99315c 100644 (file)
@@ -18,6 +18,7 @@ using Content.Shared.Mobs.Components;
 using Content.Shared.Mobs.Systems;
 using Content.Shared.Timing;
 using Content.Shared.Toggleable;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
index 2e04e1b03cbfaad0727df235ff8785ebcef4f991..57f66f2378ab49029c9820615df542d39051174f 100644 (file)
@@ -16,6 +16,8 @@ using Content.Shared.Mobs.Components;
 using Content.Shared.Mobs.Systems;
 using Content.Shared.Stacks;
 using Content.Server.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Medical;
index cde361ec74c1324a99aeb14e08bf9a57866514e5..fe3944b21ee35b2a95220b404ffbb8e850129b14 100644 (file)
@@ -8,6 +8,8 @@ using Content.Shared.Mobs.Components;
 using Robust.Server.GameObjects;
 using Content.Server.Temperature.Components;
 using Content.Server.Body.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Medical
index d754bfd05ef80fe4f156e6f6a0ba9e61edab5e37..974c1981b569678db43ffa54b14139916dd7be0c 100644 (file)
@@ -10,6 +10,7 @@ using Content.Shared.IdentityManagement;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Nutrition.EntitySystems;
 using Content.Shared.StatusEffect;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Prototypes;
index f23e9b640735dca05e963dcb23ed16be3874e65c..36b5d7ec334b577221659f712fca447aed021e73 100644 (file)
@@ -324,7 +324,8 @@ public sealed class MindSystem : SharedMindSystem
             return;
 
         Dirty(mindId, mind);
-        _pvsOverride.ClearOverride(mindId);
+        var netMind = GetNetEntity(mindId);
+        _pvsOverride.ClearOverride(netMind);
         if (userId != null && !_players.TryGetPlayerData(userId.Value, out _))
         {
             Log.Error($"Attempted to set mind user to invalid value {userId}");
@@ -366,7 +367,7 @@ public sealed class MindSystem : SharedMindSystem
         if (_players.TryGetSessionById(userId.Value, out var ret))
         {
             mind.Session = ret;
-            _pvsOverride.AddSessionOverride(mindId, ret);
+            _pvsOverride.AddSessionOverride(netMind, ret);
             _actor.Attach(mind.CurrentEntity, ret);
         }
 
index 8d05d0abd14657d5eee850c3b6d7a03abdb3543f..7f3c7aa1e90e2de9f0fd8e1ea2c08ccf7aa62552 100644 (file)
@@ -14,6 +14,8 @@ using Content.Shared.Storage;
 using Content.Shared.Storage.Components;
 using Content.Shared.Verbs;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Morgue;
index 91fb0ab9f1f127f609d3f6f9b5b19145a30a572a..b05c4414bcc060cce6575186f661bd8ddafd1e93 100644 (file)
@@ -3,6 +3,9 @@ using Content.Shared.Body.Components;
 using Content.Shared.Examine;
 using Content.Shared.Morgue;
 using Content.Shared.Morgue.Components;
+using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Morgue;
index 311fd234684dbd34c1b392785cea62db042ad1a8..052262cac51c3a1e40dfda9416aa538f58935d39 100644 (file)
@@ -5,6 +5,9 @@ using Content.Shared.Damage;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
 using Content.Shared.Silicons.Bots;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
+using Robust.Shared.Player;
 
 namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Specific;
 
index fe01b2fcbe85e694344dbbb90f9e3c8533755dea..7b012300da29e25859ea048bdc60965fcbbc717b 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Server.Interaction;
 using Content.Server.Weapons.Ranged.Systems;
 using Content.Shared.Weapons.Melee;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Random;
index 37bf0eade1887390e708bb2590ef409102ce49af..bae999faffe5793e85852acb67a182b76ee61de3 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Ninja.Components;
 using Content.Shared.Ninja.Systems;
 using Content.Shared.Popups;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Ninja.Systems;
 
index 6de2d7dee00314105181d0dcb63821585a2ef9ca..79e504da0a96f87c75b9d7bf31f5a471d2ba6e21 100644 (file)
@@ -24,7 +24,9 @@ using Robust.Shared.Audio;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 using System.Diagnostics.CodeAnalysis;
+using System.Linq;
 using Content.Server.Objectives.Components;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Ninja.Systems;
 
index 70182e0e36f24f9c41ae6446fa0a6329f33173b5..a22794e17c5fda2bafacb1d826903fdfe89e40ba 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Ninja.Systems;
 using Content.Shared.Popups;
 using Content.Shared.Whitelist;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Ninja.Systems;
index 2b9c9fe01e4094752d1d2e6d512adcd088c60523..16377d5f758f68af5398a1a5dc6a313ac8a5ffd2 100644 (file)
@@ -174,7 +174,7 @@ namespace Content.Server.Nuke
         /// </summary>
         public bool PlayedAlertSound = false;
 
-        public IPlayingAudioStream? AlertAudioStream = default;
+        public EntityUid? AlertAudioStream = default;
 
         /// <summary>
         ///     The radius from the nuke for which there must be floor tiles for it to be anchorable.
index ca0b0e01137c3d55af7baf3019e79118b6ec6b4d..77689c4e2b1082a7a0fa273d98044f258fae0614 100644 (file)
@@ -14,6 +14,7 @@ using Content.Shared.Nuke;
 using Content.Shared.Popups;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
@@ -216,7 +217,7 @@ public sealed class NukeSystem : EntitySystem
 
     private void OnClearButtonPressed(EntityUid uid, NukeComponent component, NukeKeypadClearMessage args)
     {
-        _audio.Play(component.KeypadPressSound, Filter.Pvs(uid), uid, true);
+        _audio.PlayEntity(component.KeypadPressSound, Filter.Pvs(uid), uid, true);
 
         if (component.Status != NukeStatus.AWAIT_CODE)
             return;
@@ -334,12 +335,12 @@ public sealed class NukeSystem : EntitySystem
                 {
                     component.Status = NukeStatus.AWAIT_ARM;
                     component.RemainingTime = component.Timer;
-                    _audio.Play(component.AccessGrantedSound, Filter.Pvs(uid), uid, true);
+                    _audio.PlayEntity(component.AccessGrantedSound, Filter.Pvs(uid), uid, true);
                 }
                 else
                 {
                     component.EnteredCode = "";
-                    _audio.Play(component.AccessDeniedSound, Filter.Pvs(uid), uid, true);
+                    _audio.PlayEntity(component.AccessDeniedSound, Filter.Pvs(uid), uid, true);
                 }
 
                 break;
@@ -409,7 +410,7 @@ public sealed class NukeSystem : EntitySystem
         // Don't double-dip on the octave shifting
         component.LastPlayedKeypadSemitones = number == 0 ? component.LastPlayedKeypadSemitones : semitoneShift;
 
-        _audio.Play(component.KeypadPressSound, Filter.Pvs(uid), uid, true, AudioHelpers.ShiftSemitone(semitoneShift).WithVolume(-5f));
+        _audio.PlayEntity(component.KeypadPressSound, Filter.Pvs(uid), uid, true, AudioHelpers.ShiftSemitone(semitoneShift).WithVolume(-5f));
     }
 
     public string GenerateRandomNumberString(int length)
@@ -500,7 +501,7 @@ public sealed class NukeSystem : EntitySystem
 
         // disable sound and reset it
         component.PlayedAlertSound = false;
-        component.AlertAudioStream?.Stop();
+        component.AlertAudioStream = _audio.Stop(component.AlertAudioStream);
 
         // turn off the spinny light
         _pointLight.SetEnabled(uid, false);
index 61bb85f9ec12947c2f8c1fa1304cff303abd30fd..7bd9b85c7913941cac567217bb2b4aeb7266fb88 100644 (file)
@@ -83,7 +83,7 @@ public sealed partial class FatExtractorComponent : Component
     [DataField("processSound")]
     public SoundSpecifier? ProcessSound;
 
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 
     /// <summary>
     /// A minium hunger threshold for extracting nutrition.
index e8e456c0eafbef88e559979300fcb436424561fd..1271c57a23cd07702a1a33bd68a37eb217f1159e 100644 (file)
@@ -9,6 +9,9 @@ using Content.Shared.Nutrition.AnimalHusbandry;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Nutrition.EntitySystems;
 using Content.Shared.Storage;
+using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
@@ -32,6 +35,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
     [Dependency] private readonly SharedTransformSystem _transform = default!;
 
     private readonly HashSet<EntityUid> _failedAttempts = new();
+    private readonly HashSet<EntityUid> _birthQueue = new();
 
     /// <inheritdoc/>
     public override void Initialize()
@@ -222,7 +226,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
     {
         base.Update(frameTime);
 
-        HashSet<EntityUid> birthQueue = new();
+        _birthQueue.Clear();
         _failedAttempts.Clear();
 
         var query = EntityQueryEnumerator<ReproductiveComponent>();
@@ -230,7 +234,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
         {
             if (reproductive.GestationEndTime != null && _timing.CurTime >= reproductive.GestationEndTime)
             {
-                birthQueue.Add(uid);
+                _birthQueue.Add(uid);
             }
 
             if (_timing.CurTime < reproductive.NextBreedAttempt)
@@ -244,7 +248,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
             TryReproduceNearby(uid, reproductive);
         }
 
-        foreach (var queued in birthQueue)
+        foreach (var queued in _birthQueue)
         {
             Birth(queued);
         }
index 586f965096c7b516c9297dc9dea970db158e2784..eebe7f98d868714b57238f450f7b8d45ad977da4 100644 (file)
@@ -13,6 +13,7 @@ using Content.Shared.Throwing;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Nutrition.EntitySystems
@@ -37,7 +38,7 @@ namespace Content.Server.Nutrition.EntitySystems
 
         protected override void SplattedCreamPie(EntityUid uid, CreamPieComponent creamPie)
         {
-            _audio.Play(_audio.GetSound(creamPie.Sound), Filter.Pvs(uid), uid, false, new AudioParams().WithVariation(0.125f));
+            _audio.PlayPvs(_audio.GetSound(creamPie.Sound), uid, AudioParams.Default.WithVariation(0.125f));
 
             if (EntityManager.TryGetComponent(uid, out FoodComponent? foodComp))
             {
index e493a18ae70aaf154e56c0b4fded73fd5b7799f0..1829dc32c8f204ae411ae5c3b5b62408171fbe6a 100644 (file)
@@ -27,6 +27,7 @@ using Content.Shared.Nutrition.Components;
 using Content.Shared.Throwing;
 using Content.Shared.Verbs;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index 6ab432d490224cc13945db1b085cc0ab6a99136d..63ca590f5d60f0fd4b2b750b76cc9ae904ef9e81 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Emag.Systems;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Nutrition.EntitySystems;
 using Content.Shared.Storage.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Nutrition.EntitySystems;
@@ -90,7 +92,7 @@ public sealed class FatExtractorSystem : EntitySystem
 
         component.Processing = true;
         _appearance.SetData(uid, FatExtractorVisuals.Processing, true);
-        component.Stream = _audio.PlayPvs(component.ProcessSound, uid);
+        component.Stream = _audio.PlayPvs(component.ProcessSound, uid)?.Entity;
         component.NextUpdate = _timing.CurTime + component.UpdateTime;
     }
 
@@ -104,7 +106,7 @@ public sealed class FatExtractorSystem : EntitySystem
 
         component.Processing = false;
         _appearance.SetData(uid, FatExtractorVisuals.Processing, false);
-        component.Stream?.Stop();
+        component.Stream = _audio.Stop(component.Stream);
     }
 
     public bool TryGetValidOccupant(EntityUid uid, [NotNullWhen(true)] out EntityUid? occupant, FatExtractorComponent? component = null, EntityStorageComponent? storage = null)
index ff4ec41dd99ceeec2fdbc88ebdb108b22f24b975..7bb550725f9d11ea4e90174c3936be84267f7341 100644 (file)
@@ -28,6 +28,9 @@ using Content.Shared.Verbs;
 using Robust.Shared.Audio;
 using Robust.Shared.Player;
 using Robust.Shared.Utility;
+using Content.Shared.Tag;
+using Content.Shared.Storage;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Nutrition.EntitySystems;
 
@@ -278,7 +281,7 @@ public sealed class FoodSystem : EntitySystem
             _adminLogger.Add(LogType.Ingestion, LogImpact.Low, $"{ToPrettyString(args.User):target} ate {ToPrettyString(uid):food}");
         }
 
-        _audio.Play(component.UseSound, Filter.Pvs(args.Target.Value), args.Target.Value, true, AudioParams.Default.WithVolume(-1f));
+        _audio.PlayPvs(component.UseSound, args.Target.Value, AudioParams.Default.WithVolume(-1f));
 
         // Try to break all used utensils
         foreach (var utensil in utensils)
index dd6474bc74e7a116c71d7a4514fea490b34f6df2..fbe617eff49c9bd1d33ca6fd0b4fb5039332dff5 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Interaction.Events;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Popups;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameObjects;
 
 namespace Content.Server.Nutrition.EntitySystems;
index 88916e4cf2c31ab1cc3da182447728d72a3accdf..9d255e013cd59e34d36a221ef012e5c04f762f04 100644 (file)
@@ -7,16 +7,18 @@ using Content.Shared.FixedPoint;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 
 namespace Content.Server.Nutrition.EntitySystems
 {
-    internal sealed class SliceableFoodSystem : EntitySystem
+    public sealed class SliceableFoodSystem : EntitySystem
     {
         [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
-        [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
+        [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
 
         public override void Initialize()
         {
@@ -75,8 +77,7 @@ namespace Content.Server.Nutrition.EntitySystems
                 xform.LocalRotation = 0;
             }
 
-            SoundSystem.Play(component.Sound.GetSound(), Filter.Pvs(uid),
-                transform.Coordinates, AudioParams.Default.WithVolume(-2));
+            _audio.PlayPvs(component.Sound, transform.Coordinates, AudioParams.Default.WithVolume(-2));
 
             // Decrease size of item based on count - Could implement in the future
             // Bug with this currently is the size in a container is not updated
index 0f1576658bd314681eb467dce5c9de0bab310c4d..f5f34080cbb0aa0edea96da4cf4403ca07baedad 100644 (file)
@@ -2,6 +2,7 @@ using Content.Server.Nutrition.Components;
 using Content.Server.Popups;
 using Content.Shared.Interaction;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 
@@ -15,6 +16,7 @@ namespace Content.Server.Nutrition.EntitySystems
         [Dependency] private readonly IRobustRandom _robustRandom = default!;
         [Dependency] private readonly FoodSystem _foodSystem = default!;
         [Dependency] private readonly PopupSystem _popupSystem = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
 
         public override void Initialize()
@@ -66,8 +68,8 @@ namespace Content.Server.Nutrition.EntitySystems
 
             if (_robustRandom.Prob(component.BreakChance))
             {
-                SoundSystem.Play(component.BreakSound.GetSound(), Filter.Pvs(userUid), userUid, AudioParams.Default.WithVolume(-2f));
-                EntityManager.DeleteEntity(component.Owner);
+                _audio.PlayPvs(component.BreakSound, userUid, AudioParams.Default.WithVolume(-2f));
+                EntityManager.DeleteEntity(uid);
             }
         }
     }
index 7494d5e12ceffbf6e3fb4e41fa5076ee347e93eb..f8aadac461de965b200b9153cbc95e7d3663a70d 100644 (file)
@@ -13,6 +13,8 @@ using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
+using System.Linq;
+using Robust.Server.Audio;
 
 namespace Content.Server.PDA.Ringer
 {
@@ -203,7 +205,7 @@ namespace Content.Server.PDA.Ringer
                 ringer.TimeElapsed -= NoteDelay;
                 var ringerXform = Transform(uid);
 
-                _audio.Play(
+                _audio.PlayEntity(
                     GetSound(ringer.Ringtone[ringer.NoteCount]),
                     Filter.Empty().AddInRange(ringerXform.MapPosition, ringer.Range),
                     uid,
index 553bcaa0a217541d430f9c93de291c9171697bc8..571d7aefc92fdb685139c0a86aeddb1ecfe5237e 100644 (file)
@@ -9,6 +9,9 @@ using Content.Shared.Paper;
 using Content.Shared.Tag;
 using Robust.Server.GameObjects;
 using Robust.Shared.Player;
+using Robust.Shared.Utility;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using static Content.Shared.Paper.SharedPaperComponent;
 
 namespace Content.Server.Paper
index d52223e2b4ec8247699848ca8a15093a1c537942..d4175a1af554e0289010ff06fefa64b2c6f0e0ff 100644 (file)
@@ -2,6 +2,7 @@
 using Content.Shared.Interaction.Events;
 using Content.Shared.Pinpointer;
 using Content.Shared.PowerCell;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Timing;
 
index 91e544b7960e94c2341b897dcafc198056e4058d..09571c60a1309699458a1439864feeff996f30bb 100644 (file)
@@ -5,14 +5,16 @@ using Content.Server.Storage.EntitySystems;
 using Content.Shared.Audio;
 using Content.Shared.Interaction;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Plants.Systems
 {
     public sealed class PottedPlantHideSystem : EntitySystem
     {
-        [Dependency] private readonly SecretStashSystem _stashSystem = default!;
         [Dependency] private readonly PopupSystem _popupSystem = default!;
+        [Dependency] private readonly SecretStashSystem _stashSystem = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
 
         public override void Initialize()
         {
@@ -58,7 +60,7 @@ namespace Content.Server.Plants.Systems
             if (!Resolve(uid, ref component))
                 return;
 
-            SoundSystem.Play(component.RustleSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.25f));
+            _audio.PlayPvs(component.RustleSound, uid, AudioParams.Default.WithVariation(0.25f));
         }
     }
 }
index a71294db9d23aaf339fc3d1213d2a3adc0904afe..b5f94d097ed6a335afbb76689c73970c37490da7 100644 (file)
@@ -25,7 +25,7 @@ public sealed class PointSystem : SharedPointSystem
 
     private void OnStartup(EntityUid uid, PointManagerComponent component, ComponentStartup args)
     {
-        _pvsOverride.AddGlobalOverride(uid);
+        _pvsOverride.AddGlobalOverride(GetNetEntity(uid));
     }
 
     /// <summary>
index fbf4961f4fd760c8226666dd13d95d200812c90c..5531f65409c3817d9837a7905ad30e8a9bf06239 100644 (file)
@@ -15,6 +15,7 @@ using Content.Shared.Mobs.Systems;
 using Content.Shared.Polymorph;
 using Content.Shared.Popups;
 using JetBrains.Annotations;
+using Robust.Server.Audio;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
 using Robust.Shared.Map;
index 8d9a62cd73d822532d6ff6120dd5c6d4d944c15b..95b5d74a94575382fe8f58cfd55107573f5b2b6b 100644 (file)
@@ -10,6 +10,7 @@ using Content.Shared.Emag.Systems;
 using Content.Shared.Popups;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Power.EntitySystems;
index f1f8bf06168db4929ebf95d6e1b74e8dc19972da..5ed39d51787ebd5d6e906507140f37793be6e48f 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Examine;
 using Content.Shared.Hands.Components;
 using Content.Shared.Power;
 using Content.Shared.Verbs;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.Utility;
index 1180665ad12e212313e4c749330aeaa4ce14f6f8..031e19b65dc8a2da24a36ff9ac89591b77cbe947 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Popups;
 using Content.Shared.DoAfter;
 using Content.Shared.Power.Generator;
 using Content.Shared.Verbs;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
@@ -97,7 +98,7 @@ public sealed class PortableGeneratorSystem : SharedPortableGeneratorSystem
         var clogged = _generator.GetIsClogged(uid);
 
         var sound = empty ? component.StartSoundEmpty : component.StartSound;
-        _audio.Play(sound, Filter.Pvs(uid), uid, true);
+        _audio.PlayEntity(sound, Filter.Pvs(uid), uid, true);
 
         if (!clogged && !empty && _random.Prob(component.StartChance))
         {
index ae7960cf8f01093022d728092d34948797055d39..7c377ef66ed4fc44abdbbc2b6b00c6c2b1a49045 100644 (file)
@@ -6,8 +6,7 @@ using Content.Server.Power.Nodes;
 using Content.Shared.Power.Generator;
 using Content.Shared.Timing;
 using Content.Shared.Verbs;
-using Robust.Server.GameObjects;
-using Robust.Shared.Player;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Power.Generator;
@@ -20,9 +19,9 @@ namespace Content.Server.Power.Generator;
 /// <seealso cref="GeneratorSystem"/>
 public sealed class PowerSwitchableSystem : SharedPowerSwitchableSystem
 {
-    [Dependency] private readonly AudioSystem _audio = default!;
     [Dependency] private readonly NodeGroupSystem _nodeGroup = default!;
     [Dependency] private readonly PopupSystem _popup = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly UseDelaySystem _useDelay = default!;
 
     public override void Initialize()
index e5a118b07e4efa2ffc60d8bd5ba98d88839a5e60..deb669350006725e6543e11a9500e7f2ba9a7d87 100644 (file)
@@ -6,6 +6,7 @@ using Content.Server.Chat.Systems;
 using Content.Server.Station.Systems;
 using Robust.Shared.Timing;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.PowerSink
 {
index 3a2fe1254927f02bb367b4cf578d10acd0b28aa8..f889336a0681e04fdb538775c5b74374af1082a4 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Inventory.Events;
 using Content.Shared.Radiation.Components;
 using Content.Shared.Radiation.Systems;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
 
@@ -149,7 +150,7 @@ public sealed class GeigerSystem : SharedGeigerSystem
         if (!Resolve(uid, ref component, false))
             return;
 
-        component.Stream?.Stop();
+        component.Stream = _audio.Stop(component.Stream);
 
         if (!component.Sounds.TryGetValue(component.DangerLevel, out var sounds))
             return;
@@ -163,7 +164,7 @@ public sealed class GeigerSystem : SharedGeigerSystem
         var sound = _audio.GetSound(sounds);
         var param = sounds.Params.WithLoop(true).WithVolume(-4f);
 
-        component.Stream = _audio.PlayGlobal(sound, session, param);
+        component.Stream = _audio.PlayGlobal(sound, session, param)?.Entity;
     }
 
     public static GeigerDangerLevel RadsToLevel(float rads)
index 0d60f0af4fee59fdef9e0555d29b8d4381b8cf99..8a65e0a8bc770caa07cdb9fada1c1126b7e268ab 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Research.TechnologyDisk.Components;
 using Content.Server.UserInterface;
 using Content.Shared.Research;
 using Content.Shared.Research.Components;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Timing;
 
index 6043f3fbf92ff2f3d135972ae096217b4f4386aa..5068a1a232f5372ca8d8b5f9ceb790e80ca4b638 100644 (file)
@@ -11,6 +11,7 @@ using Content.Server.Station.Systems;
 using Content.Shared.Database;
 using Content.Shared.GameTicking;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
@@ -33,6 +34,7 @@ namespace Content.Server.RoundEnd
         [Dependency] private readonly ChatSystem _chatSystem = default!;
         [Dependency] private readonly GameTicker _gameTicker = default!;
         [Dependency] private readonly EmergencyShuttleSystem _shuttle = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly StationSystem _stationSystem = default!;
 
         public TimeSpan DefaultCooldownDuration { get; set; } = TimeSpan.FromSeconds(30);
@@ -154,7 +156,7 @@ namespace Content.Server.RoundEnd
                 null,
                 Color.Gold);
 
-            SoundSystem.Play("/Audio/Announcements/shuttlecalled.ogg", Filter.Broadcast());
+            _audio.PlayGlobal("/Audio/Announcements/shuttlecalled.ogg", Filter.Broadcast(), true);
 
             LastCountdownStart = _gameTiming.CurTime;
             ExpectedCountdownEnd = _gameTiming.CurTime + countdownTime;
@@ -185,7 +187,7 @@ namespace Content.Server.RoundEnd
             _chatSystem.DispatchGlobalAnnouncement(Loc.GetString("round-end-system-shuttle-recalled-announcement"),
                 Loc.GetString("Station"), false, colorOverride: Color.Gold);
 
-            SoundSystem.Play("/Audio/Announcements/shuttlerecalled.ogg", Filter.Broadcast());
+            _audio.PlayGlobal("/Audio/Announcements/shuttlerecalled.ogg", Filter.Broadcast(), true);
 
             LastCountdownStart = null;
             ExpectedCountdownEnd = null;
index 2bc00397bc9bf80edd6c95fac35feaa658d208f4..6d3d831a2dab2cd6cdd34c78c5e02b377bc0be7a 100644 (file)
@@ -39,7 +39,7 @@ public sealed partial class SalvageExpeditionComponent : SharedSalvageExpedition
     /// <summary>
     /// Countdown audio stream.
     /// </summary>
-    public IPlayingAudioStream? Stream = null;
+    public EntityUid? Stream = null;
 
     /// <summary>
     /// Sound that plays when the mission end is imminent.
index f2be8cd5008ce3538fcd7f02b65c8fac2c8bb47e..f0d4661a070966a091fd5dd878e58a7a26c6771f 100644 (file)
@@ -73,7 +73,7 @@ public sealed partial class SalvageSystem
 
     private void OnExpeditionShutdown(EntityUid uid, SalvageExpeditionComponent component, ComponentShutdown args)
     {
-        component.Stream?.Stop();
+        component.Stream = _audio.Stop(component.Stream);
 
         foreach (var (job, cancelToken) in _salvageJobs.ToArray())
         {
index 0863362131cc510ccb845f07a921f25e5e2ae129..3b89135c58e55c7a32885d3a849e3d7bad902f2c 100644 (file)
@@ -153,7 +153,7 @@ public sealed partial class SalvageSystem
             else if (comp.Stage < ExpeditionStage.MusicCountdown && remaining < TimeSpan.FromMinutes(2))
             {
                 // TODO: Some way to play audio attached to a map for players.
-                comp.Stream = _audio.PlayGlobal(comp.Sound, Filter.BroadcastMap(Comp<MapComponent>(uid).MapId), true);
+                comp.Stream = _audio.PlayGlobal(comp.Sound, Filter.BroadcastMap(Comp<MapComponent>(uid).MapId), true).Value.Entity;
                 comp.Stage = ExpeditionStage.MusicCountdown;
                 Dirty(uid, comp);
                 Announce(uid, Loc.GetString("salvage-expedition-announcement-countdown-minutes", ("duration", TimeSpan.FromMinutes(2).Minutes)));
index 0da6207289846136b45399eddcd36a8ca11dafea..eb98e1f2e1fc34bbf3ac6b66e3b920f48a0bbda4 100644 (file)
@@ -27,6 +27,8 @@ using Content.Shared.Random;
 using Content.Shared.Random.Helpers;
 using Content.Shared.Tools.Components;
 using Robust.Server.Maps;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Timing;
 
index 43b702cd39bd15f99a44d1961aa7bc191dadddc4..105b9eae6d727b738c8e47fe3ed5b12c3e27084c 100644 (file)
@@ -51,5 +51,5 @@ public sealed partial class FTLComponent : Component
         Params = AudioParams.Default.WithVolume(-3f).WithLoop(true)
     };
 
-    public IPlayingAudioStream? TravelStream;
+    public EntityUid? TravelStream;
 }
index 3ef3d97a21aa6e350b43c8399936add84b1459cf..0f2b8b847c7b85eb4835de3fde5b92e110554556 100644 (file)
@@ -20,6 +20,9 @@ using Content.Shared.Tag;
 using Content.Shared.Tiles;
 using Robust.Server.GameObjects;
 using Robust.Server.Maps;
+using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
index e19d88b1c29589e8abe45c96e2f027b4a6556199..3fe5c2b1edfcdcfc5c2aed43639aa0c8c63ff434 100644 (file)
@@ -227,8 +227,7 @@ public sealed partial class ShuttleSystem
 
         component = AddComp<FTLComponent>(uid);
         component.State = FTLState.Starting;
-        // TODO: Need BroadcastGrid to not be bad.
-        SoundSystem.Play(_startupSound.GetSound(), Filter.Empty().AddInRange(Transform(uid).MapPosition, GetSoundRange(uid)), _startupSound.Params);
+        _audio.PlayPvs(_startupSound, uid);
         // Make sure the map is setup before we leave to avoid pop-in (e.g. parallax).
         SetupHyperspace();
         return true;
@@ -284,11 +283,8 @@ public sealed partial class ShuttleSystem
                     var ev = new FTLStartedEvent(uid, target, fromMapUid, fromMatrix, fromRotation);
                     RaiseLocalEvent(uid, ref ev, true);
 
-                    if (comp.TravelSound != null)
-                    {
-                        comp.TravelStream = SoundSystem.Play(comp.TravelSound.GetSound(),
-                            Filter.Pvs(uid, 4f, entityManager: EntityManager), comp.TravelSound.Params);
-                    }
+                    comp.TravelStream = _audio.PlayPvs(comp.TravelSound, uid)?.Entity;
+
                     break;
                 // Arriving, play effects
                 case FTLState.Travelling:
@@ -374,13 +370,8 @@ public sealed partial class ShuttleSystem
                         _thruster.DisableLinearThrusters(shuttle);
                     }
 
-                    if (comp.TravelStream != null)
-                    {
-                        comp.TravelStream?.Stop();
-                        comp.TravelStream = null;
-                    }
-
-                    _audio.PlayGlobal(_arrivalSound, Filter.Empty().AddInRange(Transform(uid).MapPosition, GetSoundRange(uid)), true);
+                    comp.TravelStream = _audio.Stop(comp.TravelStream);
+                    _audio.PlayPvs(_arrivalSound, uid);
 
                     if (TryComp<FTLDestinationComponent>(uid, out var dest))
                     {
index 73dc4b208c2fb1d613ca19283ebe86df96b58647..f346398cdaaab3c3efacef785a71908194fcb526 100644 (file)
@@ -54,6 +54,6 @@ public sealed partial class ShuttleSystem
         var volume = MathF.Min(10f, 1f * MathF.Pow(jungleDiff, 0.5f) - 5f);
         var audioParams = AudioParams.Default.WithVariation(SharedContentAudioSystem.DefaultVariation).WithVolume(volume);
 
-        _audio.Play(_shuttleImpactSound, Filter.Pvs(coordinates, rangeMultiplier: 4f, entityMan: EntityManager), coordinates, true, audioParams);
+        _audio.PlayPvs(_shuttleImpactSound, coordinates, audioParams);
     }
 }
index 41e4cbc2be92431bebd0f3d9c26e1ae0aaea17a8..cbd36f12b77277c42fe8c2d567a154026ba1780c 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Shuttles.Systems;
 using Content.Shared.Throwing;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
index ddc63156bf0525dcf1eb38b8fc0b0089bd8da3e7..6b4347740ae9ab73124babd8ed85c764390c80ab 100644 (file)
@@ -5,6 +5,8 @@ using Content.Shared.Singularity.Components;
 using Content.Shared.Singularity.EntitySystems;
 using Content.Shared.Singularity.Events;
 using Robust.Server.GameStates;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
@@ -204,9 +206,9 @@ public sealed class SingularitySystem : SharedSingularitySystem
 
         MetaDataComponent? metaData = null;
         if (Resolve(uid, ref metaData) && metaData.EntityLifeStage <= EntityLifeStage.Initializing)
-            _audio.Play(comp.FormationSound, Filter.Pvs(uid), uid, true);
+            _audio.PlayPvs(comp.FormationSound, uid);
 
-        comp.AmbientSoundStream = _audio.Play(comp.AmbientSound, Filter.Pvs(uid), uid, true);
+        comp.AmbientSoundStream = _audio.PlayPvs(comp.AmbientSound, uid)?.Entity;
         UpdateSingularityLevel(uid, comp);
     }
 
@@ -219,7 +221,7 @@ public sealed class SingularitySystem : SharedSingularitySystem
     /// <param name="args">The event arguments.</param>
     public void OnDistortionStartup(EntityUid uid, SingularityDistortionComponent comp, ComponentStartup args)
     {
-        _pvs.AddGlobalOverride(uid);
+        _pvs.AddGlobalOverride(GetNetEntity(uid));
     }
 
     /// <summary>
@@ -232,11 +234,18 @@ public sealed class SingularitySystem : SharedSingularitySystem
     /// <param name="args">The event arguments.</param>
     public void OnSingularityShutdown(EntityUid uid, SingularityComponent comp, ComponentShutdown args)
     {
-        comp.AmbientSoundStream?.Stop();
+        comp.AmbientSoundStream = _audio.Stop(comp.AmbientSoundStream);
 
         MetaDataComponent? metaData = null;
         if (Resolve(uid, ref metaData) && metaData.EntityLifeStage >= EntityLifeStage.Terminating)
-            _audio.Play(comp.DissipationSound, Filter.Pvs(uid), uid, true);
+        {
+            var xform = Transform(uid);
+            var coordinates = xform.Coordinates;
+
+            // I feel like IsValid should be checking this or something idk.
+            if (!TerminatingOrDeleted(coordinates.EntityId))
+                _audio.PlayPvs(comp.DissipationSound, coordinates);
+        }
     }
 
     /// <summary>
index 5dccb8bf9cc417840e9d85e67a281fb39b854043..aedcbbd09960b4dc53a2d4bfd564443e649a5fbd 100644 (file)
@@ -4,6 +4,8 @@ using Content.Server.Speech.Components;
 using Content.Shared.Chat.Prototypes;
 using Content.Shared.Humanoid;
 using Content.Shared.Speech;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 
index c81d17caf2dcc7ddff95980f6c98ac1e2a5eb0f1..4f66a0828bd412af5c5f02164b784bb33e489e76 100644 (file)
@@ -2,6 +2,7 @@ using Robust.Shared.Audio;
 using Content.Server.Chat;
 using Content.Server.Chat.Systems;
 using Content.Shared.Speech;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
@@ -14,6 +15,7 @@ namespace Content.Server.Speech
         [Dependency] private readonly IGameTiming _gameTiming = default!;
         [Dependency] private readonly IPrototypeManager _protoManager = default!;
         [Dependency] private readonly IRobustRandom _random = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
 
         public override void Initialize()
         {
@@ -66,7 +68,7 @@ namespace Content.Server.Speech
             var pitchedAudioParams = component.AudioParams.WithPitchScale(scale);
 
             component.LastTimeSoundPlayed = currentTime;
-            SoundSystem.Play(contextSound, Filter.Pvs(uid, entityManager: EntityManager), uid, pitchedAudioParams);
+            _audio.PlayPvs(contextSound, uid, pitchedAudioParams);
         }
     }
 }
index 763b7697d3443e09c8437edb9b3b51c76653bc98..fd8ff9ea280412c3e492a4603e44a3480476f07a 100644 (file)
@@ -11,6 +11,8 @@ using Content.Shared.SprayPainter;
 using Content.Shared.Interaction;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.SprayPainter;
index 41a7b153f58c0c21eb122c539cd8fb781eaf759f..537a7e7c2216094be2fe48aec915d02141be0492 100644 (file)
@@ -8,6 +8,8 @@ using Content.Server.Station.Components;
 using Content.Server.Station.Systems;
 using Content.Server.StationEvents.Components;
 using Content.Shared.Database;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Collections;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
index f51c215c6e43a344c8854aa04d8c04a5dce0b337..a8144311bbf2953fc96565a1df87759eb680b5a9 100644 (file)
@@ -5,6 +5,9 @@ using Content.Shared.Storage.Components;
 using Robust.Shared.Audio;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
+using System.Linq;
+using Content.Shared.Storage.Components;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Storage.EntitySystems;
 
@@ -12,6 +15,7 @@ public sealed class CursedEntityStorageSystem : EntitySystem
 {
     [Dependency] private readonly IRobustRandom _random = default!;
     [Dependency] private readonly EntityStorageSystem _entityStorage = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
 
     public override void Initialize()
     {
@@ -47,6 +51,7 @@ public sealed class CursedEntityStorageSystem : EntitySystem
             storage.Contents.Remove(entity);
             _entityStorage.AddToContents(entity, lockerEnt);
         }
-        SoundSystem.Play(component.CursedSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.125f, _random));
+
+        _audio.PlayPvs(component.CursedSound, uid, AudioHelpers.WithVariation(0.125f, _random));
     }
 }
index 25c31e48ca65bb9ab40449c606a412d2a5f565b0..c49bfdec9317459e24edbd46fcea487e223307c4 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Database;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction.Events;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
@@ -18,6 +19,7 @@ namespace Content.Server.Storage.EntitySystems
         [Dependency] private readonly IAdminLogManager _adminLogger = default!;
         [Dependency] private readonly SharedHandsSystem _hands = default!;
         [Dependency] private readonly PricingSystem _pricing = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
 
         public override void Initialize()
         {
@@ -79,7 +81,9 @@ namespace Content.Server.Storage.EntitySystems
             }
 
             if (component.Sound != null)
-                SoundSystem.Play(component.Sound.GetSound(), Filter.Pvs(uid), uid);
+            {
+                _audio.PlayPvs(component.Sound, uid);
+            }
 
             component.Uses--;
 
index 8b4ae1c76f9f4fd42b8570ebfa467179da72f92a..35b94b2d6da5064a815678099116c1a2e5c85fad 100644 (file)
@@ -93,7 +93,7 @@ public sealed partial class StorageSystem : SharedStorageSystem
             UpdateStorageVisualization(uid, storageComp);
 
             if (storageComp.StorageCloseSound is not null)
-                Audio.Play(storageComp.StorageCloseSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, storageComp.StorageCloseSound.Params);
+                Audio.PlayEntity(storageComp.StorageCloseSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, storageComp.StorageCloseSound.Params);
         }
     }
 
index 0435a6bea60886a6c64c996bdba7fb2ccd178af5..32c9a050435bedbadf8805a2e8b4bc82685b401d 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.FixedPoint;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Store;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Store.Systems;
index f4a7448fa24fb00baab66d80d3d288996332a813..da2391a86baadef7585e4ea1a829e69763aee8e3 100644 (file)
@@ -13,6 +13,7 @@ using Content.Shared.Stunnable;
 using Content.Shared.Toggleable;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Stunnable.Systems
@@ -24,7 +25,7 @@ namespace Content.Server.Stunnable.Systems
         [Dependency] private readonly RiggableSystem _riggableSystem = default!;
         [Dependency] private readonly SharedPopupSystem _popup = default!;
         [Dependency] private readonly BatterySystem _battery = default!;
-        [Dependency] private readonly AudioSystem _audio = default!;
+        [Dependency] private readonly SharedAudioSystem _audio = default!;
 
         public override void Initialize()
         {
@@ -97,7 +98,6 @@ namespace Content.Server.Stunnable.Systems
 
         private void TurnOn(EntityUid uid, StunbatonComponent comp, EntityUid user)
         {
-
             if (comp.Activated)
                 return;
 
index d40303ab31f4e4d67d1aba37e718edfd8cdb810a..ce3d8568ab3b77aa5f0df11c7d0d7c110ba4f186 100644 (file)
@@ -1,5 +1,7 @@
 using Content.Server.Chat.Systems;
 using Content.Shared.Speech;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
index 4bfe03ba4221c71c9aa73cb1589e5282b56a8e1a..29cde5d741d66da80189abde970666b2e2eb0181 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Database;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Teleportation.Components;
 using Content.Shared.Teleportation.Systems;
+using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 
 namespace Content.Server.Teleportation;
index b10feae4533e04249c039cc5a04d8cf36c8a93d8..8bf8457e075b3e39b199fc03a0eb2800e6dee8a4 100644 (file)
@@ -17,6 +17,7 @@ using Content.Shared.Tools;
 using Content.Shared.Tools.Components;
 using Content.Shared.Verbs;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
index 88a96dc1e8daaf9af95b741287313ed64769d274..de6a7fefc1265763ebdb3cfc6a56196f509f7cf6 100644 (file)
@@ -5,6 +5,8 @@ using Content.Shared.Chemistry.EntitySystems;
 using Content.Shared.Maps;
 using Content.Shared.Tools;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
 
index d7864ba16c8e66fdd1d83fe4371b865b82a5daf0..45c6a3d9d5572a4ce008702d8c0eb6c43bff2a11 100644 (file)
@@ -4,6 +4,8 @@ using Content.Shared.IdentityManagement;
 using Content.Shared.Popups;
 using Content.Shared.Tag;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Weapons.Melee.Balloon;
 
index fcd42f5a2884a4ea90a5c92b396e8bfdc8067211..ca2a367d9b4054b85e41f4733d08bf0116befb04 100644 (file)
@@ -12,6 +12,8 @@ using Content.Shared.Weapons.Melee;
 using Content.Shared.Weapons.Melee.Events;
 using Content.Shared.Wieldable;
 using Content.Shared.Wieldable.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
 
@@ -116,7 +118,7 @@ public sealed class EnergySwordSystem : EntitySystem
         if (comp.IsSharp)
             RemComp<SharpComponent>(uid);
 
-        _audio.Play(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params);
+        _audio.PlayEntity(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params);
 
         comp.Activated = false;
     }
@@ -143,7 +145,7 @@ public sealed class EnergySwordSystem : EntitySystem
             malus.Malus += comp.LitDisarmMalus;
         }
 
-        _audio.Play(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params);
+        _audio.PlayEntity(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params);
 
         comp.Activated = true;
     }
index 6236040a839ae3b47ddb7cf77485592d27fcc778..8cb22ca8bdb2958d4734daf0b7b9e992e4ad8fc5 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Shared.Weapons.Melee.Events;
 using Robust.Shared.Random;
 using Content.Shared.Cluwne;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Weapons.Melee.WeaponRandom;
 
index b6452efa8a6f03714d72eb6663a051e96ad7176d..cb019e3d64a69faffdbe721290fd61dfa53b6fc1 100644 (file)
@@ -16,6 +16,9 @@ using Content.Shared.Tools;
 using Content.Shared.Tools.Components;
 using Content.Shared.Wires;
 using Robust.Server.GameObjects;
+using Robust.Server.Player;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index 9200928d662459b66e09483b73c01cde93ca1564..63095c7827013bef8425dd2ebd0d3c1c3e1410c6 100644 (file)
@@ -18,6 +18,7 @@ using Content.Shared.Xenoarchaeology.XenoArtifacts;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
index 0791924caaf351d156a1f2d6c4a7e66cd771a0ac..b8b2fba9d3330fcc1414eff77415e7563265ba1d 100644 (file)
@@ -9,6 +9,8 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
 using Content.Shared.CCVar;
 using Content.Shared.Xenoarchaeology.XenoArtifacts;
 using JetBrains.Annotations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
index ba2786f32d33d28187e9699189d378593fb91ab4..662abfee62889b7e15fa407374821ab97dd5c7aa 100644 (file)
@@ -3,6 +3,7 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
 using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
 using Content.Shared.Humanoid;
 using Content.Shared.Mobs.Systems;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
 
index 3014edd1b9ae44c81ed2118361993fd9718f33ab..f35adf1294d62db67be83effb2321b311246c4fb 100644 (file)
@@ -32,6 +32,7 @@ using Content.Shared.Weapons.Melee;
 using Content.Shared.Zombies;
 using Robust.Shared.Audio;
 using Content.Shared.Prying.Components;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Zombies
 {
index 00a17ace250988b5284707624f29cfaee4434734..8750089764972dda46532751aec976fd19ea9694 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Database;
 using Content.Shared.Hands;
 using Content.Shared.Interaction;
 using Content.Shared.Inventory.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.GameStates;
 using Robust.Shared.Map;
index 4b2b3ada70aea7e4b13f6dab3e68545891285bfb..e2218091cefef9812f1a0e8099e4ce02b54da2e3 100644 (file)
@@ -5,6 +5,8 @@ using Content.Shared.Database;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
index 30fdc946edd56252a945f8f13e9fb6d60fc28fc0..6318ba2557316deeea8f68f961d35acb4fc96a0c 100644 (file)
@@ -19,7 +19,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem
 
         ambience.Enabled = value;
         QueueUpdate(uid, ambience);
-        Dirty(ambience);
+        Dirty(uid, ambience);
     }
 
     public virtual void SetRange(EntityUid uid, float value, AmbientSoundComponent? ambience = null)
@@ -29,7 +29,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem
 
         ambience.Range = value;
         QueueUpdate(uid, ambience);
-        Dirty(ambience);
+        Dirty(uid, ambience);
     }
 
     protected virtual void QueueUpdate(EntityUid uid, AmbientSoundComponent ambience)
@@ -43,7 +43,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem
             return;
 
         ambience.Volume = value;
-        Dirty(ambience);
+        Dirty(uid, ambience);
     }
 
     public virtual void SetSound(EntityUid uid, SoundSpecifier sound, AmbientSoundComponent? ambience = null)
@@ -53,7 +53,7 @@ public abstract class SharedAmbientSoundSystem : EntitySystem
 
         ambience.Sound = sound;
         QueueUpdate(uid, ambience);
-        Dirty(ambience);
+        Dirty(uid, ambience);
     }
 
     private void HandleCompState(EntityUid uid, AmbientSoundComponent component, ref ComponentHandleState args)
index 7151ef2c174ecf380daaeee329e5e918710b75e3..3563f2f8462bebadfefedd36cd26fdce409c4c67 100644 (file)
@@ -1,10 +1,12 @@
 using Content.Shared.Physics;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Audio;
 
 public abstract class SharedContentAudioSystem : EntitySystem
 {
-    [Dependency] private readonly SharedAudioSystem _audio = default!;
+    [Dependency] protected readonly SharedAudioSystem Audio = default!;
 
     /// <summary>
     /// Standard variation to use for sounds.
@@ -14,6 +16,6 @@ public abstract class SharedContentAudioSystem : EntitySystem
     public override void Initialize()
     {
         base.Initialize();
-        _audio.OcclusionCollisionMask = (int) CollisionGroup.Impassable;
+        Audio.OcclusionCollisionMask = (int) CollisionGroup.Impassable;
     }
 }
index bfefaf2b92d6f6124f6c4d7ee1b06e48a34cec66..2d721390e67c0f16d36bba0c3fcdd1aa42bf144b 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Shared.Damage;
 using Content.Shared.Damage.Prototypes;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 
 namespace Content.Shared.Blocking;
@@ -51,7 +52,7 @@ public sealed partial class BlockingSystem
 
             if (blocking.IsBlocking)
             {
-                _audio.PlayPvs(blocking.BlockSound, uid, AudioParams.Default.WithVariation(0.2f));
+                _audio.PlayPvs(blocking.BlockSound, uid);
             }
         }
     }
index 9a379a29e976787c90e5b08b40b58444644a3bfb..f869c20679d2efdd37191635c674481a388e3ad1 100644 (file)
@@ -57,8 +57,11 @@ public sealed partial class BlockingComponent : Component
     /// <summary>
     /// The sound to be played when you get hit while actively blocking
     /// </summary>
-    [DataField("blockSound")]
-    public SoundSpecifier BlockSound = new SoundPathSpecifier("/Audio/Weapons/block_metal1.ogg");
+    [DataField("blockSound")] public SoundSpecifier BlockSound =
+        new SoundPathSpecifier("/Audio/Weapons/block_metal1.ogg")
+        {
+            Params = AudioParams.Default.WithVariation(0.25f)
+        };
 
     /// <summary>
     /// Fraction of original damage shield will take instead of user
index 6add0661339df0c29e8340a04ea46ea33fe10c47..90b8a28011c468b2c462bbd01f5b95beebcb7661 100644 (file)
@@ -493,8 +493,10 @@ public abstract partial class SharedBuckleSystem
 
         _joints.RefreshRelay(buckleUid);
         Appearance.SetData(strapUid, StrapVisuals.State, strapComp.BuckledEntities.Count != 0);
-        var audioSourceUid = userUid != buckleUid ? userUid : strapUid;
-        _audio.PlayPredicted(strapComp.UnbuckleSound, strapUid, audioSourceUid);
+
+        // TODO: Buckle listening to moveevents is sussy anyway.
+        if (!TerminatingOrDeleted(strapUid))
+            _audio.PlayPredicted(strapComp.UnbuckleSound, strapUid, userUid);
 
         var ev = new BuckleChangeEvent(strapUid, buckleUid, false);
         RaiseLocalEvent(buckleUid, ref ev);
index 1441745b5dac4dc0711d353d6da6281723cfc148..8f6833566374dad3a993d9fbf8fc2c63dbfbd0cf 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Mobs.Systems;
 using Content.Shared.Popups;
 using Content.Shared.Pulling;
 using Content.Shared.Standing;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
index eb74a4994f5836f6ad69dddff5fa7fa79300ba19..89dfdf15c95ded8fbdddcaa87bfae500414fa545 100644 (file)
@@ -69,6 +69,8 @@ namespace Content.Shared.CCVar
         public static readonly CVarDef<float> AmbienceVolume =
             CVarDef.Create("ambience.volume", 0.0f, CVar.ARCHIVE | CVar.CLIENTONLY);
 
+        public const float MasterMultiplier = 2f;
+
         // Midi is on engine so deal
         public const float MidiMultiplier = 3f;
 
index f2f03c13349c31ae993a48643c31a3343ff1902d..92af6a4f8a3f8ed09fb0dbeb8c3f18142925802c 100644 (file)
@@ -3,6 +3,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Lock;
 using Content.Shared.Verbs;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
@@ -117,7 +118,7 @@ public abstract class SharedItemCabinetSystem : EntitySystem
             return;
 
         cabinet.Opened = !cabinet.Opened;
-        Dirty(cabinet);
+        Dirty(uid, cabinet);
         _itemSlots.SetLock(uid, cabinet.CabinetSlot, !cabinet.Opened);
 
         if (_timing.IsFirstTimePredicted)
index 7353bd0e9c74c6a6aa36ef9f53dcd4339f349759..4045a270780555f31761dae6b78e2da780859187 100644 (file)
@@ -2,6 +2,8 @@
 using Content.Shared.Buckle.Components;
 using Content.Shared.Movement.Events;
 using Content.Shared.StepTrigger.Systems;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Timing;
index ed53b78466eba00cace489e891dbe849d1acd3ac..1a55408916a165c4ac376fbe2b1cd704f45e7685 100644 (file)
@@ -4,6 +4,8 @@ using Content.Shared.Chemistry.Components;
 using Content.Shared.Chemistry.Reagent;
 using Content.Shared.Database;
 using Content.Shared.FixedPoint;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Prototypes;
 
 namespace Content.Shared.Chemistry.Reaction
index 6ded524b19d90d84cb7f9238529ff638b0508b8a..b18d54cf788f338f4b6d1a8ed70c5e8c2fd6e96f 100644 (file)
@@ -8,6 +8,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Interaction.Components;
 using Content.Shared.Popups;
 using Content.Shared.Stunnable;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Serialization;
index 46255e4337664b67247959ba1f7438aaecfe4252..652834e0f89fde436b53abc970dc9ab6fe999c14 100644 (file)
@@ -18,6 +18,7 @@ using Content.Shared.Physics;
 using Content.Shared.Popups;
 using Content.Shared.Stunnable;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Collision.Shapes;
 using Robust.Shared.Physics.Components;
index 9194a8208e315d3dd94527214636905bef3a6616..ad27101cc145141d2af8ef3a5c76ccbea86b07ee 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Popups;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.GameStates;
 using Robust.Shared.Network;
index 4951bb7f1cb410b92aae53dbb7e79b5cfa3eb12e..3ad85d9579cc7486bdfd5f18d997933846c14920 100644 (file)
@@ -29,6 +29,8 @@ using Content.Shared.Rejuvenate;
 using Content.Shared.Stunnable;
 using Content.Shared.Verbs;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
index 40c4f7eb8f276d0a426329d4b4c009301921c95c..33f1b0375bc7d807e9fdcc5f1d840db0a92e127c 100644 (file)
@@ -16,6 +16,7 @@ using Content.Shared.Throwing;
 using Content.Shared.Weapons.Melee.Events;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
 using Robust.Shared.Random;
index 192fd200789689ac43095e7c2e7fb8a2f96e7c6f..3d406843f5feda17903fc3c0f509cd78775b46e3 100644 (file)
@@ -4,6 +4,8 @@ using Content.Shared.DoAfter;
 using Content.Shared.Mobs;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Serialization;
 
index a9a52010fd6c9b6792e92dcc45675b0338a2bd23..7c5ef45275150f3e07c4b5abb96c720a45001a39 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Shared.Doors.Components;
 using Content.Shared.Popups;
 using Content.Shared.Prying.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Doors.Systems;
 
index 084c3b4ea2cb7009e172aeb7f7e0bcd837fc5522..85bb399b4805f8872ff7f363f1e6d53279f75d7b 100644 (file)
@@ -14,6 +14,8 @@ using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Timing;
+using Content.Shared.Prying.Components;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Doors.Systems;
 
index 90c9f0e1e0fddfa06c89412caf979a6b972cf8a2..d249bb861b1f49c96d797593b1bb48303e6ca7c7 100644 (file)
@@ -11,6 +11,7 @@ using Content.Shared.Movement.Systems;
 using Content.Shared.Popups;
 using Content.Shared.Strip.Components;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
@@ -23,6 +24,7 @@ public abstract partial class InventorySystem
     [Dependency] private readonly SharedPopupSystem _popup = default!;
     [Dependency] private readonly MovementSpeedModifierSystem _movementSpeed = default!;
     [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
     [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
     [Dependency] private readonly IGameTiming _gameTiming = default!;
@@ -206,10 +208,10 @@ public abstract partial class InventorySystem
                     filter.RemoveWhereAttachedEntity(entity => entity == actor);
             }
 
-            SoundSystem.Play(clothing.EquipSound.GetSound(), filter, target, clothing.EquipSound.Params.WithVolume(-2f));
+            _audio.PlayPredicted(clothing.EquipSound, target, actor);
         }
 
-        inventory.Dirty();
+        Dirty(target, inventory);
 
         _movementSpeed.RefreshMovementSpeedModifiers(target);
 
@@ -393,10 +395,11 @@ public abstract partial class InventorySystem
                     filter.RemoveWhereAttachedEntity(entity => entity == actor);
             }
 
-            SoundSystem.Play(clothing.UnequipSound.GetSound(), filter, target, clothing.UnequipSound.Params.WithVolume(-2f));
+            _audio.PlayPredicted(clothing.UnequipSound, target, actor);
         }
 
         Dirty(target, inventory);
+
         _movementSpeed.RefreshMovementSpeedModifiers(target);
 
         return true;
index d530b07b18636bb12c8216849a9bbf770aa0ed91..2fa15800a312ee4a510aed8e8f4f7514bc81d68c 100644 (file)
@@ -3,6 +3,8 @@ using Content.Shared.Clothing.EntitySystems;
 using Content.Shared.Item;
 using Content.Shared.Light.Components;
 using Content.Shared.Toggleable;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 
 namespace Content.Shared.Light;
index 31187a96cb9a5e6871de6230b08fe6f10cc4eebd..174818c4e81de808a55727965bf614380b577fd2 100644 (file)
@@ -30,13 +30,19 @@ public sealed partial class LockComponent : Component
     /// The sound played when unlocked.
     /// </summary>
     [DataField("unlockingSound"), ViewVariables(VVAccess.ReadWrite)]
-    public SoundSpecifier UnlockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg");
+    public SoundSpecifier UnlockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_off.ogg")
+    {
+        Params = AudioParams.Default.WithVolume(-5f),
+    };
 
     /// <summary>
     /// The sound played when locked.
     /// </summary>
     [DataField("lockingSound"), ViewVariables(VVAccess.ReadWrite)]
-    public SoundSpecifier LockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_on.ogg");
+    public SoundSpecifier LockSound = new SoundPathSpecifier("/Audio/Machines/door_lock_on.ogg")
+    {
+        Params = AudioParams.Default.WithVolume(-5f)
+    };
 
     /// <summary>
     /// Whether or not an emag disables it.
index 97baa28bf90d7c8c755f8255d60da425fb48c105..7babc6a9c0cb590545051c00b3fe73818445edbb 100644 (file)
@@ -11,6 +11,7 @@ using Content.Shared.Storage.Components;
 using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Utility;
 
 namespace Content.Shared.Lock;
@@ -102,11 +103,11 @@ public sealed class LockSystem : EntitySystem
 
         _sharedPopupSystem.PopupClient(Loc.GetString("lock-comp-do-lock-success",
                 ("entityName", Identity.Name(uid, EntityManager))), uid, user);
-        _audio.PlayPredicted(lockComp.LockSound, uid, user, AudioParams.Default.WithVolume(-5));
+        _audio.PlayPredicted(lockComp.LockSound, uid, user);
 
         lockComp.Locked = true;
         _appearanceSystem.SetData(uid, StorageVisuals.Locked, true);
-        Dirty(lockComp);
+        Dirty(uid, lockComp);
 
         var ev = new LockToggledEvent(true);
         RaiseLocalEvent(uid, ref ev, true);
@@ -130,11 +131,11 @@ public sealed class LockSystem : EntitySystem
                 ("entityName", Identity.Name(uid, EntityManager))), uid, user.Value);
         }
 
-        _audio.PlayPredicted(lockComp.UnlockSound, uid, user, AudioParams.Default.WithVolume(-5));
+        _audio.PlayPredicted(lockComp.UnlockSound, uid, user);
 
         lockComp.Locked = false;
         _appearanceSystem.SetData(uid, StorageVisuals.Locked, false);
-        Dirty(lockComp);
+        Dirty(uid, lockComp);
 
         var ev = new LockToggledEvent(false);
         RaiseLocalEvent(uid, ref ev, true);
@@ -213,7 +214,7 @@ public sealed class LockSystem : EntitySystem
     {
         if (!component.Locked || !component.BreakOnEmag)
             return;
-        _audio.PlayPredicted(component.UnlockSound, uid, null, AudioParams.Default.WithVolume(-5));
+        _audio.PlayPredicted(component.UnlockSound, uid, null);
         _appearanceSystem.SetData(uid, StorageVisuals.Locked, false);
         RemComp<LockComponent>(uid); //Literally destroys the lock as a tell it was emagged
         args.Handled = true;
index 761469f99aafb10f85e292a65035d7cd10e4cf5c..eda5cc4058eb2074ac501d17900e72033f5c58b5 100644 (file)
@@ -126,7 +126,7 @@ public sealed partial class MaterialReclaimerComponent : Component
     [DataField]
     public TimeSpan SoundCooldown = TimeSpan.FromSeconds(0.8f);
 
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 
     /// <summary>
     /// A counter of how many items have been processed
index c3c712b617b31add390a12e66b78503703b3362c..31df11fa8b4e0ecedb23e2b0bf9cb4c4e5ba549c 100644 (file)
@@ -8,6 +8,8 @@ using Content.Shared.Emag.Systems;
 using Content.Shared.Examine;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Stacks;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Timing;
@@ -48,7 +50,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
 
     private void OnShutdown(EntityUid uid, MaterialReclaimerComponent component, ComponentShutdown args)
     {
-        component.Stream?.Stop();
+        _audio.Stop(component.Stream);
     }
 
     private void OnUnpaused(EntityUid uid, MaterialReclaimerComponent component, ref EntityUnpausedEvent args)
@@ -116,8 +118,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
 
         if (Timing.CurTime > component.NextSound)
         {
-            component.Stream = _audio.PlayPredicted(component.Sound, uid, user);
-
+            component.Stream = _audio.PlayPredicted(component.Sound, uid, user)?.Entity;
             component.NextSound = Timing.CurTime + component.SoundCooldown;
         }
 
@@ -167,9 +168,11 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
 
         component.ItemsProcessed++;
         if (component.CutOffSound)
-            component.Stream?.Stop();
+        {
+            _audio.Stop(component.Stream);
+        }
 
-        Dirty(component);
+        Dirty(uid, component);
     }
 
     /// <summary>
@@ -181,7 +184,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
             return;
         component.Enabled = enabled;
         AmbientSound.SetAmbience(uid, enabled && component.Powered);
-        Dirty(component);
+        Dirty(uid, component);
     }
 
     /// <summary>
index b4254fe0798d2c1b6dc56b1358cc229df790d860..1440a6ef1f2c3d4c4c5bb193846a1802688139c5 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Mech.Equipment.Systems;
 using Content.Shared.Timing;
 using Robust.Shared.Audio;
 using System.Linq;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Mech.Equipment.Systems;
 
index af065d0dec80719836982ac63e2cfb646b2bcde8..6e8d47fd3e6282f3cf3f61da093b5a2b19bf8b11 100644 (file)
@@ -12,6 +12,7 @@ using Content.Shared.Movement.Events;
 using Content.Shared.Pulling.Components;
 using Content.Shared.Tag;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
index d376d05724b14f4a35f1314ccf973a8cf0d7ee0c..f9e5d4a1f63d2691445b05e085701fa29571918d 100644 (file)
@@ -6,6 +6,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Ninja.Components;
 using Content.Shared.Physics;
 using Content.Shared.Popups;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
 namespace Content.Shared.Ninja.Systems;
index 473e29cc943df87449cdfc67b20cd922fbbce78a..224152a402befd5f9552a117c20479d17edcfda9 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Clothing.EntitySystems;
 using Content.Shared.Inventory.Events;
 using Content.Shared.Ninja.Components;
 using Content.Shared.Timing;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Ninja.Systems;
 
index 63b4cb13aa634e7ff79cb36a93ce7fd89c35180a..3b9eded288deaf79b65b36dbc71d645226be4816 100644 (file)
@@ -4,6 +4,9 @@ using Content.Shared.DoAfter;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Content.Shared.Throwing;
+using Content.Shared.Weapons.Ranged.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
 using Robust.Shared.Physics;
index 5fd94c343855c4b77750a39bc7edfcc3ae739985..bc37ab035af2c851ededb7e4353e56799ed18681 100644 (file)
@@ -8,6 +8,8 @@ using Content.Shared.Doors.Components;
 using System.Diagnostics.CodeAnalysis;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using PryUnpoweredComponent = Content.Shared.Prying.Components.PryUnpoweredComponent;
 
 namespace Content.Shared.Prying.Systems;
index ccc47a2fdeb8905f66913191b3efec836c0989e0..d7126716ed1268f01545d9f92a26ca28ee06e7dc 100644 (file)
@@ -13,6 +13,7 @@ using Content.Shared.RCD.Components;
 using Content.Shared.Tag;
 using Content.Shared.Tiles;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Network;
index 585c1a51dcb0f5e4e301467ef69528f6b39ae77c..71edb70b37c38635317e276cfed147aec3050d8d 100644 (file)
@@ -82,7 +82,7 @@ public sealed partial class GeigerComponent : Component
     ///     Current stream of geiger counter audio.
     ///     Played only for current user.
     /// </summary>
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 }
 
 [Serializable, NetSerializable]
index eb97fe41133b5bb3bbd3e2e8c7b348b73efd8652..31856eefac77d37d00d832a0c9fa6cbf2d366466 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Radio.Components;
 using Content.Shared.Tools;
 using Content.Shared.Tools.Components;
 using Content.Shared.Wires;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Network;
 using Robust.Shared.Prototypes;
index 93293d09be2e37d6efaa4c6ffdb215f37278669e..5ae01ebb987ce3bc3862be7d286ec04164e533c2 100644 (file)
@@ -3,6 +3,8 @@ using Content.Shared.DoAfter;
 using Content.Shared.Random;
 using Content.Shared.Random.Helpers;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
index cbc54c91e37a7fc431b5060e5668a1aa3ab2f8a3..d678b14b92f8268ae02be5f1eca8724bc4be22fc 100644 (file)
@@ -6,6 +6,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Popups;
 using Content.Shared.Stacks;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
index 47fb9407860dd0b3bc6efff31e255748091f591e..a75d6113c95659dc8f7b2cd3ff893e0baca2a95f 100644 (file)
@@ -33,6 +33,8 @@ public sealed partial class EmaggableMedibotComponent : Component
     /// <summary>
     /// Sound to play when the bot has been emagged
     /// </summary>
-    [DataField("sparkSound")]
-    public SoundSpecifier SparkSound = new SoundCollectionSpecifier("sparks");
+    [DataField("sparkSound")] public SoundSpecifier SparkSound = new SoundCollectionSpecifier("sparks")
+    {
+        Params = AudioParams.Default.WithVolume(8f),
+    };
 }
index fe88cbae5cc29532228c6ccf94f7417ea2ff911a..464e95b77fe5128f4531509b841debdc6ac40b1d 100644 (file)
@@ -1,5 +1,6 @@
 using Content.Shared.Emag.Systems;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Silicons.Bots;
 
@@ -22,7 +23,7 @@ public sealed class MedibotSystem : EntitySystem
         if (!TryComp<MedibotComponent>(uid, out var medibot))
             return;
 
-        _audio.PlayPredicted(comp.SparkSound, uid, args.UserUid, AudioParams.Default.WithVolume(8));
+        _audio.PlayPredicted(comp.SparkSound, uid, args.UserUid);
 
         medibot.StandardMed = comp.StandardMed;
         medibot.StandardMedAmount = comp.StandardMedAmount;
index fe5cd0377f4104aee7b41ec878d249f6e8cd2e3e..3bab8d80b0956c47449ea7b8dfea12c5c12242fd 100644 (file)
@@ -61,7 +61,7 @@ public sealed partial class SingularityComponent : Component
     /// The audio stream that plays the sound specified by <see cref="AmbientSound"/> on loop.
     /// </summary>
     [ViewVariables(VVAccess.ReadWrite)]
-    public IPlayingAudioStream? AmbientSoundStream = null;
+    public EntityUid? AmbientSoundStream = null;
 
     /// <summary>
     ///     The sound that the singularity produces when it forms.
index 00f023f9a3a67c9aae80d36fb283201f4828a3ad..60d53eb16f483ccd9857236834beaf04cbe0376f 100644 (file)
@@ -5,6 +5,8 @@ using Content.Shared.StatusEffect;
 using Content.Shared.StepTrigger.Systems;
 using Content.Shared.Stunnable;
 using JetBrains.Annotations;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
index ea42b4bff93f8d7efc235bada70b1945f5741a08..e9ae86ed2af0d50a2e55f2f22e7c7eb615e5c6da 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Sound.Components;
 using Content.Shared.Throwing;
 using JetBrains.Annotations;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Components;
@@ -142,8 +143,11 @@ public abstract class SharedEmitSoundSystem : EntitySystem
         var fraction = MathF.Min(1f, (physics.LinearVelocity.Length() - component.MinimumVelocity) / MaxVolumeVelocity);
         var volume = MinVolume + (MaxVolume - MinVolume) * fraction;
         component.NextSound = _timing.CurTime + EmitSoundOnCollideComponent.CollideCooldown;
+        var sound = component.Sound;
 
-        if (_netMan.IsServer)
-            _audioSystem.PlayPvs(component.Sound, uid, AudioParams.Default.WithVolume(volume));
+        if (_netMan.IsServer && sound != null)
+        {
+            _audioSystem.PlayPvs(_audioSystem.GetSound(sound), uid, AudioParams.Default.WithVolume(volume));
+        }
     }
 }
index bb74a088b3e895d1e240e75611603a27445e950c..517831b8a1b3a5d425cb597028b321d6218d8d01 100644 (file)
@@ -2,6 +2,7 @@ using Content.Shared.Hands.Components;
 using Content.Shared.Physics;
 using Content.Shared.Rotation;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Systems;
 
@@ -81,7 +82,7 @@ namespace Content.Shared.Standing
 
             if (playSound)
             {
-                _audio.PlayPredicted(standingState.DownSound, uid, uid, AudioParams.Default.WithVariation(0.25f));
+                _audio.PlayPredicted(standingState.DownSound, uid, uid);
             }
 
             return true;
index ad86a52665d93d0d5c084ad3fa2237aacfaf67aa..1672e27214b244ef114bd998efefa289cd096aeb 100644 (file)
@@ -5,6 +5,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Placeable;
 using Content.Shared.Storage.Components;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
index 2d85f79e0388d9cc8548ad6356dbbaf2c18bac72..0122e5b53a0a191ee510c934a6965948cc2f5daa 100644 (file)
@@ -15,6 +15,8 @@ using Content.Shared.Storage.Components;
 using Content.Shared.Tools.Systems;
 using Content.Shared.Verbs;
 using Content.Shared.Wall;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.GameStates;
 using Robust.Shared.Map;
index 5faec99fd5b7a9d339163f88d12456f9bda62afc..1c74b0f973026e4f8db46a942aa0b9c0f6069337 100644 (file)
@@ -17,6 +17,8 @@ using Content.Shared.Stacks;
 using Content.Shared.Storage.Components;
 using Content.Shared.Timing;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Random;
index 4875f2f68f8d9a04b578437ac1ed529a81513b85..c447f8c8bc79e33b4c483d91e1906f098e18f5df 100644 (file)
@@ -18,6 +18,7 @@ using Content.Shared.Standing;
 using Content.Shared.StatusEffect;
 using Content.Shared.Throwing;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.GameStates;
 using Robust.Shared.Player;
 
index e614a2c040ff01cf4ebfa95b5603bb92b07acc56..1afaab3539d1264cf38ee7554aad11925805b717 100644 (file)
@@ -6,6 +6,8 @@ using Content.Shared.Pulling;
 using Content.Shared.Pulling.Components;
 using Content.Shared.Teleportation.Components;
 using Content.Shared.Verbs;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Dynamics;
index 6d497c003d7a353571651066bde7efe05aa8b965..92208a76d4083763d8d06f8b3f4dc930116ff5cf 100644 (file)
@@ -15,7 +15,10 @@ namespace Content.Shared.Tiles
         [DataField("outputs", customTypeSerializer: typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
         public List<string>? OutputTiles;
 
-        [DataField("placeTileSound")]
-        public SoundSpecifier PlaceTileSound = new SoundPathSpecifier("/Audio/Items/genhit.ogg");
+        [DataField("placeTileSound")] public SoundSpecifier PlaceTileSound =
+            new SoundPathSpecifier("/Audio/Items/genhit.ogg")
+            {
+                Params = AudioParams.Default.WithVariation(0.125f),
+            };
     }
 }
index dcf914ccf86af3e71fed231e2d2da3a4e3fef17e..21e21fa9e9bc4cd530c39225293be5ca6fb4b591 100644 (file)
@@ -10,6 +10,7 @@ using Content.Shared.Physics;
 using Content.Shared.Popups;
 using Content.Shared.Stacks;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Network;
@@ -178,7 +179,7 @@ public sealed class FloorTileSystem : EntitySystem
         var variant = (byte) (_timing.CurTick.Value % ((ContentTileDefinition) _tileDefinitionManager[tileId]).Variants);
         mapGrid.SetTile(location.Offset(new Vector2(offset, offset)), new Tile(tileId, 0, variant));
 
-        _audio.PlayPredicted(placeSound, location, user, AudioHelpers.WithVariation(0.125f, _random));
+        _audio.PlayPredicted(placeSound, location, user);
     }
 
     public bool CanPlaceTile(EntityUid gridUid, MapGridComponent component, [NotNullWhen(false)] out string? reason)
index c1a2bdc2ddae35cac6bcaf90c1a7bd5f2d2f5f2a..91984d29e340f41358bc99b4dc6f937f252cccf4 100644 (file)
@@ -3,6 +3,8 @@ using Content.Shared.DoAfter;
 using Content.Shared.Interaction;
 using Content.Shared.Maps;
 using Content.Shared.Tools.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
 using Robust.Shared.Prototypes;
@@ -52,7 +54,7 @@ public abstract partial class SharedToolSystem : EntitySystem
         if (tool.UseSound == null)
             return;
 
-        _audioSystem.PlayPredicted(tool.UseSound, uid, user, tool.UseSound.Params.WithVariation(0.175f).AddVolume(-5f));
+        _audioSystem.PlayPredicted(tool.UseSound, uid, user);
     }
 
     /// <summary>
index 51a7471f1e1c7c298550fcf9d56c39750fe995e2..1db698359bdcff3eebc301b16d9534a8fc6792e3 100644 (file)
@@ -43,5 +43,5 @@ public sealed partial class ParacusiaComponent : Component
     [DataField("timeBetweenIncidents", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
     public TimeSpan NextIncidentTime;
 
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 }
index 509581cc32aed1e5cf4199cfb19b9274214662f9..a4a4d89a253f4d07d1562ddc7fe305d509593b91 100644 (file)
@@ -45,7 +45,7 @@ public sealed partial class VehicleComponent : Component
     };
 
     [ViewVariables]
-    public IPlayingAudioStream? HonkPlayingStream;
+    public EntityUid? HonkPlayingStream;
 
     /// Use ambient sound component for the idle sound.
 
index c211ec57f0232bed5931d7fa0b42454b6bfba8f5..475675f22e3fa4c53acd4447dd4491ca0d0e9182 100644 (file)
@@ -12,6 +12,8 @@ using Content.Shared.Movement.Systems;
 using Content.Shared.Popups;
 using Content.Shared.Tag;
 using Content.Shared.Vehicle.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Systems;
@@ -174,8 +176,7 @@ public abstract partial class SharedVehicleSystem : EntitySystem
 
         // TODO: Need audio refactor maybe, just some way to null it when the stream is over.
         // For now better to just not loop to keep the code much cleaner.
-        vehicle.HonkPlayingStream?.Stop();
-        vehicle.HonkPlayingStream = _audioSystem.PlayPredicted(vehicle.HornSound, uid, uid);
+        vehicle.HonkPlayingStream = _audioSystem.PlayPredicted(vehicle.HornSound, uid, uid)?.Entity;
         args.Handled = true;
     }
 
index 522138eb8b51b22e0b992e6147558eeea2bd0ff7..50803e8ee267f612c3ae750f350beb5be2ce0168 100644 (file)
@@ -4,6 +4,8 @@ using System.Linq;
 using Content.Shared.DoAfter;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 
 namespace Content.Shared.VendingMachines;
index 119b10218d8a75c9b564a082749eb53867bb54ba..3a6afce363837f5c12529fd4d50f64d4da86f3fd 100644 (file)
@@ -1,6 +1,8 @@
 using Content.Shared.Damage;
 using Content.Shared.Projectiles;
 using Content.Shared.Weapons.Melee.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Timing;
index 62af6067d05444c0f5681beaa6bb908e193dc13f..5eac283ef19e5a97229b0f2bfa568b326ab9a11b 100644 (file)
@@ -20,6 +20,7 @@ using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Events;
 using Content.Shared.Weapons.Ranged.Systems;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Systems;
index 61c84f7d3d08a1a5d60358e5adbf0a2cb5cabb08..9ee705061a42465da74f6301fbc21344f9a45508 100644 (file)
@@ -52,5 +52,5 @@ public abstract partial class BaseForceGunComponent : Component
         Params = AudioParams.Default.WithLoop(true).WithVolume(-8f),
     };
 
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 }
index 7713c98955e7010ef35032159161999ffec38d73..3aa82c411ced53ff746bada94f248b57b94eb3a0 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Projectiles;
 using Content.Shared.Timing;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Systems;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Components;
@@ -61,13 +63,13 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
 
             // At least show the visuals.
             component.Projectile = shotUid.Value;
-            Dirty(component);
+            Dirty(uid, component);
             var visuals = EnsureComp<JointVisualsComponent>(shotUid.Value);
             visuals.Sprite =
                 new SpriteSpecifier.Rsi(new ResPath("Objects/Weapons/Guns/Launchers/grappling_gun.rsi"), "rope");
             visuals.OffsetA = new Vector2(0f, 0.5f);
             visuals.Target = uid;
-            Dirty(visuals);
+            Dirty(shotUid.Value, visuals);
         }
 
         TryComp<AppearanceComponent>(uid, out var appearance);
@@ -133,7 +135,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
             }
 
             component.Projectile = null;
-            Dirty(component);
+            Dirty(uid, component);
         }
     }
 
@@ -145,19 +147,18 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
         if (value)
         {
             if (Timing.IsFirstTimePredicted)
-                component.Stream = _audio.PlayPredicted(component.ReelSound, uid, user);
+                component.Stream = _audio.PlayPredicted(component.ReelSound, uid, user)?.Entity;
         }
         else
         {
             if (Timing.IsFirstTimePredicted)
             {
-                component.Stream?.Stop();
-                component.Stream = null;
+                component.Stream = _audio.Stop(component.Stream);
             }
         }
 
         component.Reeling = value;
-        Dirty(component);
+        Dirty(uid, component);
     }
 
     public override void Update(float frameTime)
@@ -173,8 +174,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
                 if (Timing.IsFirstTimePredicted)
                 {
                     // Just in case.
-                    grappling.Stream?.Stop();
-                    grappling.Stream = null;
+                    grappling.Stream = _audio.Stop(grappling.Stream);
                 }
 
                 continue;
@@ -200,7 +200,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
                 _physics.WakeBody(jointComp.Relay.Value);
             }
 
-            Dirty(jointComp);
+            Dirty(uid, jointComp);
 
             if (distance.MaxLength.Equals(distance.MinLength))
             {
@@ -221,7 +221,7 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
         joint.MinLength = 0.35f;
         // Setting velocity directly for mob movement fucks this so need to make them aware of it.
         // joint.Breakpoint = 4000f;
-        Dirty(jointComp);
+        Dirty(uid, jointComp);
     }
 
     [Serializable, NetSerializable]
index 984ae832fb8029e4a239582422ed46287ce386f2..177cb310d18a5bfd896ac8f68fac9105973b38ac 100644 (file)
@@ -7,6 +7,8 @@ using Content.Shared.Mobs.Systems;
 using Content.Shared.Movement.Events;
 using Content.Shared.Throwing;
 using Content.Shared.Toggleable;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
@@ -232,10 +234,10 @@ public abstract partial class SharedTetherGunSystem : EntitySystem
 
         // Sad...
         if (_netManager.IsServer && component.Stream == null)
-            component.Stream = _audio.PlayPredicted(component.Sound, gunUid, null);
+            component.Stream = _audio.PlayPredicted(component.Sound, gunUid, null)?.Entity;
 
-        Dirty(tethered);
-        Dirty(component);
+        Dirty(target, tethered);
+        Dirty(gunUid, component);
     }
 
     protected virtual void StopTether(EntityUid gunUid, BaseForceGunComponent component, bool land = true, bool transfer = false)
@@ -269,7 +271,7 @@ public abstract partial class SharedTetherGunSystem : EntitySystem
 
         if (!transfer)
         {
-            component.Stream?.Stop();
+            _audio.Stop(component.Stream);
             component.Stream = null;
         }
 
index 51f3e835b7ba0ac67516cb1b31b20dd7ef5b88d0..3ca52b28786c8364570dc49c138fb6c778e81e29 100644 (file)
@@ -24,5 +24,5 @@ public sealed partial class GrapplingGunComponent : Component
     [ViewVariables(VVAccess.ReadWrite), DataField("cycleSound"), AutoNetworkedField]
     public SoundSpecifier? CycleSound = new SoundPathSpecifier("/Audio/Weapons/Guns/MagIn/kinetic_reload.ogg");
 
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 }
index ded4ce34a231ab681bc86d087ae0dedb5dbf93f6..536f3da8112e50a822d66b4019a6b4cf7b25b33d 100644 (file)
@@ -1,5 +1,7 @@
 using Content.Shared.Examine;
 using Content.Shared.Weapons.Ranged.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
index 6f764bb9f4e49b4ea237ad3efb42cde696e95199..06667857b35b52e9756d512e9169dbdf7727208a 100644 (file)
@@ -20,6 +20,7 @@ using Content.Shared.Weapons.Melee.Events;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Events;
 using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
index ffa8180e1a728ad0d82e2f6293fe1fe0f6c190d3..4986f9a3414b8fad6e918738290b8758d60fa609 100644 (file)
@@ -10,6 +10,8 @@ using Content.Shared.Popups;
 using Content.Shared.Projectiles;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Events;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
index c7040515c8e05dc4f837e742901981f3d6aaeecc..d34893f8aa4fb894502f3a56c2ebbf1c0ad8f24f 100644 (file)
@@ -1,4 +1,6 @@
 using Content.Shared.Maps;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Physics.Components;
@@ -15,13 +17,11 @@ public abstract class SharedWeatherSystem : EntitySystem
     [Dependency] protected readonly IPrototypeManager ProtoMan = default!;
     [Dependency] private   readonly ITileDefinitionManager _tileDefManager = default!;
     [Dependency] private   readonly MetaDataSystem _metadata = default!;
-
-    protected ISawmill Sawmill = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
 
     public override void Initialize()
     {
         base.Initialize();
-        Sawmill = Logger.GetSawmill("weather");
         SubscribeLocalEvent<WeatherComponent, EntityUnpausedEvent>(OnWeatherUnpaused);
     }
 
@@ -123,7 +123,7 @@ public abstract class SharedWeatherSystem : EntitySystem
                 // Admin messed up or the likes.
                 if (!ProtoMan.TryIndex<WeatherPrototype>(proto, out var weatherProto))
                 {
-                    Sawmill.Error($"Unable to find weather prototype for {comp.Weather}, ending!");
+                    Log.Error($"Unable to find weather prototype for {comp.Weather}, ending!");
                     EndWeather(uid, comp, proto);
                     continue;
                 }
@@ -156,7 +156,8 @@ public abstract class SharedWeatherSystem : EntitySystem
     /// </summary>
     public void SetWeather(MapId mapId, WeatherPrototype? proto, TimeSpan? endTime)
     {
-        var weatherComp = EnsureComp<WeatherComponent>(MapManager.GetMapEntityId(mapId));
+        var mapUid = MapManager.GetMapEntityId(mapId);
+        var weatherComp = EnsureComp<WeatherComponent>(mapUid);
 
         foreach (var (eProto, weather) in weatherComp.Weather)
         {
@@ -168,7 +169,7 @@ public abstract class SharedWeatherSystem : EntitySystem
                 if (weather.State == WeatherState.Ending)
                     weather.State = WeatherState.Running;
 
-                Dirty(weatherComp);
+                Dirty(mapUid, weatherComp);
                 continue;
             }
 
@@ -178,7 +179,7 @@ public abstract class SharedWeatherSystem : EntitySystem
             if (weather.EndTime == null || weather.EndTime > end)
             {
                 weather.EndTime = end;
-                Dirty(weatherComp);
+                Dirty(mapUid, weatherComp);
             }
         }
 
@@ -211,10 +212,10 @@ public abstract class SharedWeatherSystem : EntitySystem
         if (!component.Weather.TryGetValue(proto, out var data))
             return;
 
-        data.Stream?.Stop();
+        _audio.Stop(data.Stream);
         data.Stream = null;
         component.Weather.Remove(proto);
-        Dirty(component);
+        Dirty(uid, component);
     }
 
     protected virtual bool SetState(WeatherState state, WeatherComponent component, WeatherData weather, WeatherPrototype weatherProto)
index 6166ea0c64e095d86e75883a38e53156c626a305..bdc7bfdbf9128084abe1cb3f91beee2ef1c201c4 100644 (file)
@@ -24,7 +24,7 @@ public sealed partial class WeatherData
 {
     // Client audio stream.
     [NonSerialized]
-    public IPlayingAudioStream? Stream;
+    public EntityUid? Stream;
 
     /// <summary>
     /// When the weather started if relevant.
index ba87d54aa2ac97cba7bc2bb0e960c804970e0612..399d9b516807aff2237cfef7f47dcf3ab7e0805c 100644 (file)
@@ -12,6 +12,8 @@ using Content.Shared.Weapons.Melee.Components;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Systems;
 using Content.Shared.Wieldable.Components;
+using Robust.Shared.Audio;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Content.Shared.Timing;
 
index 1b601c9f95e76f572b6c657750d85a6ea306f8a7..7922a27f80811ab72cb11d3ed47b46488c953814 100644 (file)
       path: /Audio/Machines/Nuke/nuke_alarm.ogg
       params:
         volume: -5
-        maxdistance: 10
+        maxDistance: 10
   - type: EmitSoundOnActivate
     sound:
       path: /Audio/Machines/Nuke/nuke_alarm.ogg
       params:
         volume: -5
-        maxdistance: 10
+        maxDistance: 10
 
 - type: entity
   parent: BasePlushie
index 132d6b7aff91be95be4626aa1fb746fa89384229..a8c3703d787f8f44813d9ea09f3ac3faaa67c67f 100644 (file)
       path: /Audio/Items/Stamp/thick_stamp_sub.ogg
       params:
         volume: -2
-        maxdistance: 5
+        maxDistance: 5
   - type: Sprite
     sprite: Objects/Misc/bureaucracy.rsi
     state: stamp-mime
       path: /Audio/Items/Stamp/automatic_stamp.ogg
       params:
         volume: -2
-        maxdistance: 5
+        maxDistance: 5
 
 - type: entity
   name: captain's rubber stamp
index e78d8dd1504f0deeb71dc5f7f1ef0ddf592195d1..69a81f9f46acb0f0f65e0771affbab4e678be28b 100644 (file)
@@ -50,7 +50,7 @@
     beepSound:
       path: "/Audio/Items/locator_beep.ogg"
       params:
-        maxdistance: 1
+        maxDistance: 1
         volume: -8
 
 - type: entity
   - type: ItemSlots
     slots:
       cell_slot:
-        name: power-cell-slot-component-slot-name-default
\ No newline at end of file
+        name: power-cell-slot-component-slot-name-default
index d574b286c4582eb7ca0e38df0ac1988774a5dc7a..33186f0a1dda8038647aac29c0b6f491f801fa3e 100644 (file)
@@ -9,7 +9,7 @@
       path: /Audio/Machines/microwave_loop.ogg
       params:
         loop: true
-        maxdistance: 5
+        maxDistance: 5
   - type: Sprite
     sprite: Structures/Machines/fat_sucker.rsi
     snapCardinals: true
index b7886b7ca59bc44b153d5902582f9e8148d4108e..699c3491f1c6d104e46014d4ea846a02cc849eb1 100644 (file)
@@ -81,7 +81,7 @@
       path: /Audio/Ambience/Objects/crushing.ogg
       params:
         volume: 5
-        maxdistance: 5
+        maxDistance: 5
         loop: true
   - type: MaterialStorage
     insertOnInteract: false
index 3cbb0665b88c7ee9964bcf4cd2ca6faaa136690d..e37f9c24c941b63a2e2841453a01f0cd078beaa7 100644 (file)
       collection: Whistles
   params:
     variation: 0.125
-    pitchscale: 0.75
+    pitch: 0.75
 
 - type: emoteSounds
   id: FemaleDwarf
       collection: Whistles
   params:
     variation: 0.125
-    pitchscale: 0.75
+    pitch: 0.75
 
 - type: emoteSounds
   id: UnisexMoth