diff --git a/Content.Server/GameTicking/GameTicker.Player.cs b/Content.Server/GameTicking/GameTicker.Player.cs index f3d8adafb1d..a3e33117cc6 100644 --- a/Content.Server/GameTicking/GameTicker.Player.cs +++ b/Content.Server/GameTicking/GameTicker.Player.cs @@ -1,10 +1,13 @@ using Content.Server.Database; +using Content.Shared.CCVar; using Content.Shared.GameTicking; using Content.Shared.GameWindow; using Content.Shared.Players; using Content.Shared.Preferences; using JetBrains.Annotations; using Robust.Server.Player; +using Robust.Shared.Audio; +using Robust.Shared.Audio.Systems; using Robust.Shared.Enums; using Robust.Shared.Player; using Robust.Shared.Timing; @@ -17,6 +20,7 @@ public sealed partial class GameTicker { [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IServerDbManager _dbManager = default!; + [Dependency] private readonly SharedAudioSystem _audioSystem = default!; private void InitializePlayer() { @@ -69,6 +73,11 @@ private async void PlayerStatusChanged(object? sender, SessionStatusEventArgs ar RaiseNetworkEvent(GetConnectionStatusMsg(), session.Channel); + if (firstConnection && _configurationManager.GetCVar(CCVars.AdminNewPlayerJoinSound)) + _audioSystem.PlayGlobal(new SoundPathSpecifier("/Audio/Effects/newplayerping.ogg"), + Filter.Empty().AddPlayers(_adminManager.ActiveAdmins), false, + audioParams: new AudioParams { Volume = -5f }); + if (LobbyEnabled && _roundStartCountdownHasNotStartedYetDueToNoPlayers) { _roundStartCountdownHasNotStartedYetDueToNoPlayers = false; diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 6427faa113f..e2eebb4c205 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -772,6 +772,12 @@ public static readonly CVarDef public static readonly CVarDef SeeOwnNotes = CVarDef.Create("admin.see_own_notes", false, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER); + /// + /// Should the server play a quick sound to the active admins whenever a new player joins? + /// + public static readonly CVarDef AdminNewPlayerJoinSound = + CVarDef.Create("admin.new_player_join_sound", false, CVar.SERVERONLY); + /// /// The amount of days before the note starts fading. It will slowly lose opacity until it reaches stale. Set to 0 to disable. /// diff --git a/Resources/Audio/Effects/attributions.yml b/Resources/Audio/Effects/attributions.yml index f8568718461..a5f91ef10c6 100644 --- a/Resources/Audio/Effects/attributions.yml +++ b/Resources/Audio/Effects/attributions.yml @@ -216,3 +216,8 @@ copyright: Bhijn and Myr (github username deathride58) license: CC0-1.0 source: https://github.com/space-wizards/space-station-14/pull/23212 + +- files: ["newplayerping.ogg"] + copyright: TGStation at 3df5d3b42bfb6b3b5adba1067ab41f83816255bb + license: CC-BY-SA-3.0 + source: https://github.com/tgstation/tgstation/blob/3df5d3b42bfb6b3b5adba1067ab41f83816255bb/sound/misc/server-ready.ogg diff --git a/Resources/Audio/Effects/newplayerping.ogg b/Resources/Audio/Effects/newplayerping.ogg new file mode 100644 index 00000000000..216533b6f32 Binary files /dev/null and b/Resources/Audio/Effects/newplayerping.ogg differ