From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 21 Feb 2024 22:14:57 +0000 (+1100) Subject: Fix bwoink sounds (#25441) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=79c6385ca7d1b42263e154dc1dad4fe912ac0bbf;p=space-station-14.git 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 --- 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)