diff --git a/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs b/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs index 871708a711..ee2f082a1c 100644 --- a/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs +++ b/Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs @@ -39,7 +39,7 @@ public sealed class AHelpUIController: UIController, IOnStateChanged(DiscordRelayUpdated); + SubscribeNetworkEvent(DiscordRelayUpdated); } public void OnStateEntered(GameplayState state) @@ -137,7 +137,7 @@ public sealed class AHelpUIController: UIController, IOnStateChanged().GetSawmill("AHELP"); _maxAdditionalChars = GenerateAHelpMessage("", "", true).Length; + _playerManager.PlayerStatusChanged += OnPlayerStatusChanged; SubscribeLocalEvent(OnGameRunLevelChanged); } + private void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs e) + { + if (e.NewStatus != SessionStatus.InGame) + return; + + RaiseNetworkEvent(new BwoinkDiscordRelayUpdated(!string.IsNullOrWhiteSpace(_webhookUrl)), e.Session); + } + private void OnGameRunLevelChanged(GameRunLevelChangedEvent args) { // Don't make a new embed if we diff --git a/Content.Shared/Administration/SharedBwoinkSystem.cs b/Content.Shared/Administration/SharedBwoinkSystem.cs index 597d2c0a6c..d8d719857a 100644 --- a/Content.Shared/Administration/SharedBwoinkSystem.cs +++ b/Content.Shared/Administration/SharedBwoinkSystem.cs @@ -46,20 +46,20 @@ namespace Content.Shared.Administration Text = text; } } + } - /// - /// Sent by the server to notify all clients when the webhook url is sent. - /// The webhook url itself is not and should not be sent. - /// - [Serializable, NetSerializable] - public sealed class BwoinkDiscordRelayUpdated : EntityEventArgs + /// + /// Sent by the server to notify all clients when the webhook url is sent. + /// The webhook url itself is not and should not be sent. + /// + [Serializable, NetSerializable] + public sealed class BwoinkDiscordRelayUpdated : EntityEventArgs + { + public bool DiscordRelayEnabled { get; } + + public BwoinkDiscordRelayUpdated(bool enabled) { - public bool DiscordRelayEnabled { get; } - - public BwoinkDiscordRelayUpdated(bool enabled) - { - DiscordRelayEnabled = enabled; - } + DiscordRelayEnabled = enabled; } } }