mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* Scope creep my ass * why was this shit not pushed???? * gone... * fix that * review plus buildd * asfsafsafsafsafas * grug * burber * I'll fix this later * shrimply die * also this * it's snerf or snuthin * assaads * round snend * aaaa * fix this shit for real * actually, don't start GameRules until MapInit now that I think aboot it. * forgot u * don't actually need this part nullable * Deffer comp removal * one liner * do that too * chungus * Honestly makes more sense here, plus WHY are we doing all that shit on "GameRuleAdded" rather than GameRuleStarted(?) * deferred removal :V * aaaaaaaaaaaaaaa * whhop * Whoop * better * landmine that I placed for myself then forgot about lmao * cleanup * FUCKING `!` * gotovo * amogus * please don't check by metadata I beg * waawsasfdfsasfa * sfafsasfafsas * fdsaasffsasfa * code * fix * fasasffasfasfsad * chungaas * I may be stupid * gra * graaaaaaaaaaaaaaaaa * comment * gra * clearing is not predicted and would require major refactors, so don't cache on client. * lame shit :P * last holes * nukeopsfsafsasafsfafsa * why was that shit public bruh * bubrbgwahrghfaka * dynamic * revert change that did nothing lmao
66 lines
2.4 KiB
C#
66 lines
2.4 KiB
C#
using Content.Server.Station.Systems;
|
|
using Content.Shared.Audio;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.Audio.Systems;
|
|
using Robust.Shared.Console;
|
|
using Robust.Shared.Player;
|
|
|
|
namespace Content.Server.Audio;
|
|
|
|
public sealed partial class ServerGlobalSoundSystem : SharedGlobalSoundSystem
|
|
{
|
|
[Dependency] private IConsoleHost _conHost = default!;
|
|
[Dependency] private ServerStationSystem _stationSystem = default!;
|
|
[Dependency] private SharedAudioSystem _audio = default!;
|
|
|
|
public override void Shutdown()
|
|
{
|
|
base.Shutdown();
|
|
_conHost.UnregisterCommand("playglobalsound");
|
|
}
|
|
|
|
public void PlayAdminGlobal(Filter playerFilter, ResolvedSoundSpecifier specifier, AudioParams? audioParams = null, bool replay = true)
|
|
{
|
|
var msg = new AdminSoundEvent(specifier, audioParams);
|
|
RaiseNetworkEvent(msg, playerFilter, recordReplay: replay);
|
|
}
|
|
|
|
private Filter GetStationAndPvs(EntityUid source)
|
|
{
|
|
var stationFilter = _stationSystem.GetInOwningStation(source);
|
|
stationFilter.AddPlayersByPvs(source, entityManager: EntityManager);
|
|
return stationFilter;
|
|
}
|
|
|
|
public void PlayGlobalOnStation(EntityUid source, ResolvedSoundSpecifier specifier, AudioParams? audioParams = null)
|
|
{
|
|
var msg = new GameGlobalSoundEvent(specifier, audioParams);
|
|
var filter = GetStationAndPvs(source);
|
|
RaiseNetworkEvent(msg, filter);
|
|
}
|
|
|
|
public void StopStationEventMusic(EntityUid source, StationEventMusicType type)
|
|
{
|
|
// TODO REPLAYS
|
|
// these start & stop events are gonna be a PITA
|
|
// theres probably some nice way of handling them. Maybe it just needs dedicated replay data (in which case these events should NOT get recorded).
|
|
|
|
var msg = new StopStationEventMusic(type);
|
|
var filter = GetStationAndPvs(source);
|
|
RaiseNetworkEvent(msg, filter);
|
|
}
|
|
|
|
public void DispatchStationEventMusic(EntityUid source, SoundSpecifier sound, StationEventMusicType type)
|
|
{
|
|
DispatchStationEventMusic(source, _audio.ResolveSound(sound), type);
|
|
}
|
|
|
|
public void DispatchStationEventMusic(EntityUid source, ResolvedSoundSpecifier specifier, StationEventMusicType type)
|
|
{
|
|
var audio = AudioParams.Default.AddVolume(-8);
|
|
var msg = new StationEventMusicEvent(specifier, type, audio);
|
|
|
|
var filter = GetStationAndPvs(source);
|
|
RaiseNetworkEvent(msg, filter);
|
|
}
|
|
}
|