using Content.Shared.Audio; using Robust.Shared.Audio; using Robust.Shared.Player; using Robust.Shared.Map; namespace Content.Server.Audio; /// /// Extends upstream's Content.Server/Audio/ServerGlobalSoundSystem.cs. /// public sealed partial class ServerGlobalSoundSystem { /// /// DeltaV - Plays a sound globally for all players, no matter where they are. /// /// /// public void PlayGlobal(ResolvedSoundSpecifier specifier, AudioParams? audioParams = null) { var msg = new GameGlobalSoundEvent(specifier, audioParams); RaiseNetworkEvent(msg); } public void StopGlobalEventMusic(StationEventMusicType type) { var msg = new StopStationEventMusic(type); RaiseNetworkEvent(msg); } public void DispatchGlobalEventMusic(SoundSpecifier sound, StationEventMusicType type) { DispatchGlobalEventMusic(_audio.ResolveSound(sound), type); } public void DispatchGlobalEventMusic(ResolvedSoundSpecifier specifier, StationEventMusicType type) { var audio = AudioParams.Default.WithVolume(-8); var msg = new StationEventMusicEvent(specifier, type, audio); RaiseNetworkEvent(msg); } /// /// DeltaV - Plays a sound globally for all players on a specified Map. /// /// /// public void PlayGlobalOnMap(MapId map, ResolvedSoundSpecifier specifier, AudioParams? audioParams = null) { var msg = new GameGlobalSoundEvent(specifier, audioParams); var filter = Filter.Empty().AddInMap(map); RaiseNetworkEvent(msg, filter); } public void StopMapEventMusic(MapId map, StationEventMusicType type) { var msg = new StopStationEventMusic(type); var filter = Filter.Empty().AddInMap(map); RaiseNetworkEvent(msg, filter); } public void DispatchMapEventMusic(MapId map, SoundSpecifier sound, StationEventMusicType type) { DispatchMapEventMusic(map, _audio.ResolveSound(sound), type); } public void DispatchMapEventMusic(MapId map, ResolvedSoundSpecifier specifier, StationEventMusicType type) { var audio = AudioParams.Default.WithVolume(-8); var msg = new StationEventMusicEvent(specifier, type, audio); var filter = Filter.Empty().AddInMap(map); RaiseNetworkEvent(msg, filter); } }