Admin New Player Notification Sound (#24327)
play a sound to active admins when a new player joins
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user