From 13a1be646250290229570d334f8dbc8fb9192fa4 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sun, 26 Apr 2020 00:53:09 +0200 Subject: [PATCH] Update submodule. --- .../Components/Instruments/InstrumentComponent.cs | 15 ++++++++------- RobustToolbox | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Content.Server/GameObjects/Components/Instruments/InstrumentComponent.cs b/Content.Server/GameObjects/Components/Instruments/InstrumentComponent.cs index a4ad5d6b00..b6512b8ee6 100644 --- a/Content.Server/GameObjects/Components/Instruments/InstrumentComponent.cs +++ b/Content.Server/GameObjects/Components/Instruments/InstrumentComponent.cs @@ -21,7 +21,7 @@ namespace Content.Server.GameObjects.Components.Instruments /// /// The client channel currently playing the instrument, or null if there's none. /// - private INetChannel _instrumentPlayer; + private ICommonSession _instrumentPlayer; private bool _handheld; [ViewVariables] @@ -49,8 +49,9 @@ namespace Content.Server.GameObjects.Components.Instruments public override void HandleNetworkMessage(ComponentMessage message, INetChannel channel, ICommonSession session = null) { base.HandleNetworkMessage(message, channel, session); + // If the client that sent the message isn't the client playing this instrument, we ignore it. - if (channel != _instrumentPlayer) return; + if (session != _instrumentPlayer) return; switch (message) { case InstrumentMidiEventMessage midiEventMsg: @@ -79,7 +80,7 @@ namespace Content.Server.GameObjects.Components.Instruments if (session == null) return; - _instrumentPlayer = session.ConnectedClient; + _instrumentPlayer = session; } public void HandDeselected(HandDeselectedEventArgs eventArgs) @@ -96,7 +97,7 @@ namespace Content.Server.GameObjects.Components.Instruments if (_instrumentPlayer != null) return; - _instrumentPlayer = actor.playerSession.ConnectedClient; + _instrumentPlayer = actor.playerSession; OpenUserInterface(actor.playerSession); } @@ -105,14 +106,14 @@ namespace Content.Server.GameObjects.Components.Instruments if (!eventArgs.User.TryGetComponent(out IActorComponent actor)) return false; - if(_instrumentPlayer == actor.playerSession.ConnectedClient) + if(_instrumentPlayer == actor.playerSession) OpenUserInterface(actor.playerSession); return false; } - private void UserInterfaceOnClosed(ServerBoundUserInterfaceMessage obj) + private void UserInterfaceOnClosed(IPlayerSession player) { - if (!Handheld && obj.Session.ConnectedClient == _instrumentPlayer) + if (!Handheld && player == _instrumentPlayer) { _instrumentPlayer = null; SendNetworkMessage(new InstrumentStopMidiMessage()); diff --git a/RobustToolbox b/RobustToolbox index e492e3b521..7c4b1af967 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit e492e3b521370fdd6913e5e07f1c1778c2944cd2 +Subproject commit 7c4b1af96743d2b87a787726c851e141b7ba45c2