From abca043229df733e7c8e880ae86c684c737000c0 Mon Sep 17 00:00:00 2001 From: Danil Iarosh Date: Wed, 4 Mar 2026 14:00:51 +0300 Subject: [PATCH] fix: fixed ComHub error of using string deviceId instead of DeviceDisconnectMessage object --- .../Scripts/Controls/Inputs/ComSystem/ComHub.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Controls/Inputs/ComSystem/ComHub.cs b/Assets/Scripts/Controls/Inputs/ComSystem/ComHub.cs index 6efa119..9cf6f8a 100644 --- a/Assets/Scripts/Controls/Inputs/ComSystem/ComHub.cs +++ b/Assets/Scripts/Controls/Inputs/ComSystem/ComHub.cs @@ -338,6 +338,9 @@ namespace RR.Common.Controls return; } + string role = client.ControllerRole; + string mac = client.MacAddress; + UnsubscribeDevice(client); _devices.Remove(deviceId); @@ -352,12 +355,21 @@ namespace RR.Common.Controls _defaultDeviceId = _devices.Keys.FirstOrDefault() ?? string.Empty; } - _disconnectedQueue.Enqueue(deviceId); + _disconnectedQueue.Enqueue(new DeviceDisconnectMessage(deviceId, role, mac)); } private void OnDeviceConnectionLost(string deviceId) { - _disconnectedQueue.Enqueue(deviceId); + string role = string.Empty; + string mac = string.Empty; + + if (_devices.TryGetValue(deviceId, out ComDeviceClient client)) + { + role = client.ControllerRole; + mac = client.MacAddress; + } + + _disconnectedQueue.Enqueue(new DeviceDisconnectMessage(deviceId, role, mac)); } private IComControllerHandler CreateHandlerForDevice(string deviceId)