From: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Date: Sun, 24 Mar 2024 02:46:45 +0000 (-0700) Subject: Admin New Player Notification Sound (#24327) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=b9db06ebb1af41f2809f6c31dc4990b6a729d041;p=space-station-14.git Admin New Player Notification Sound (#24327) play a sound to active admins when a new player joins --- diff --git a/Content.Server/GameTicking/GameTicker.Player.cs b/Content.Server/GameTicking/GameTicker.Player.cs index 6deda49583..7cafc06b3d 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 @@ namespace Content.Server.GameTicking { [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IServerDbManager _dbManager = default!; + [Dependency] private readonly SharedAudioSystem _audioSystem = default!; private void InitializePlayer() { @@ -68,6 +72,11 @@ namespace Content.Server.GameTicking 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 8a592d4b30..51f782991e 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -779,6 +779,12 @@ namespace Content.Shared.CCVar 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 f856871846..a5f91ef10c 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 0000000000..216533b6f3 Binary files /dev/null and b/Resources/Audio/Effects/newplayerping.ogg differ