From 79c6385ca7d1b42263e154dc1dad4fe912ac0bbf Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:14:57 +1100 Subject: [PATCH] Fix bwoink sounds (#25441) * Fix bwoink sounds Didn't get a chance to test with 2 clients as I'm about to sleep but otherwise I'll check tomorrow. * a --- Content.Server/Administration/Systems/BwoinkSystem.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Content.Server/Administration/Systems/BwoinkSystem.cs b/Content.Server/Administration/Systems/BwoinkSystem.cs index ffbe2e5ed6..2e236688ac 100644 --- a/Content.Server/Administration/Systems/BwoinkSystem.cs +++ b/Content.Server/Administration/Systems/BwoinkSystem.cs @@ -72,7 +72,7 @@ namespace Content.Server.Administration.Systems Subs.CVar(_config, CVars.GameHostName, OnServerNameChanged, true); Subs.CVar(_config, CCVars.AdminAhelpOverrideClientName, OnOverrideChanged, true); _sawmill = IoCManager.Resolve().GetSawmill("AHELP"); - _maxAdditionalChars = GenerateAHelpMessage("", "", true, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, false).Length; + _maxAdditionalChars = GenerateAHelpMessage("", "", true, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, playedSound: false).Length; _playerManager.PlayerStatusChanged += OnPlayerStatusChanged; SubscribeLocalEvent(OnGameRunLevelChanged); @@ -411,7 +411,8 @@ namespace Content.Server.Administration.Systems bwoinkText = $"{(message.PlaySound ? "" : "(S) ")}{bwoinkText}: {escapedText}"; - var playSound = senderAHelpAdmin && message.PlaySound; + // If it's not an admin / admin chooses to keep the sound then play it. + var playSound = !senderAHelpAdmin || message.PlaySound; var msg = new BwoinkTextMessage(message.UserId, senderSession.UserId, bwoinkText, playSound: playSound); LogBwoink(msg); @@ -470,7 +471,7 @@ namespace Content.Server.Administration.Systems str = str[..(DescriptionMax - _maxAdditionalChars - unameLength)]; } var nonAfkAdmins = GetNonAfkAdmins(); - _messageQueues[msg.UserId].Enqueue(GenerateAHelpMessage(senderSession.Name, str, !personalChannel, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, playSound, nonAfkAdmins.Count == 0)); + _messageQueues[msg.UserId].Enqueue(GenerateAHelpMessage(senderSession.Name, str, !personalChannel, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, playedSound: playSound, noReceivers: nonAfkAdmins.Count == 0)); } if (admins.Count != 0 || sendsWebhook) -- 2.51.2