Skip to content

Commit

Permalink
Cherry-picked commit b9db06e from space-wizards/space-station-14/master
Browse files Browse the repository at this point in the history
  • Loading branch information
SimpleStation14 authored and DEATHB4DEFEAT committed Mar 24, 2024
1 parent 3bf08c7 commit c433e13
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Content.Server/GameTicking/GameTicker.Player.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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()
{
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,12 @@ public static readonly CVarDef<bool>
public static readonly CVarDef<bool> SeeOwnNotes =
CVarDef.Create("admin.see_own_notes", false, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);

/// <summary>
/// Should the server play a quick sound to the active admins whenever a new player joins?
/// </summary>
public static readonly CVarDef<bool> AdminNewPlayerJoinSound =
CVarDef.Create("admin.new_player_join_sound", false, CVar.SERVERONLY);

/// <summary>
/// The amount of days before the note starts fading. It will slowly lose opacity until it reaches stale. Set to 0 to disable.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions Resources/Audio/Effects/attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file added Resources/Audio/Effects/newplayerping.ogg
Binary file not shown.

0 comments on commit c433e13

Please sign in to comment.