fix: use new interface in direct server

This commit is contained in:
Andrew Welker
2025-07-17 12:16:32 -05:00
parent c1eccfd790
commit 2bf0f2092b

View File

@@ -319,7 +319,10 @@ namespace PepperDash.Essentials.WebSocketServer
continue; continue;
} }
var ip = touchpanel.Touchpanel.ConnectedIps.Any(ipInfo => string ip = processorIp;
if (touchpanel.Touchpanel is IMobileControlCrestronTouchpanelController crestronTouchpanel)
{
ip = crestronTouchpanel.ConnectedIps.Any(ipInfo =>
{ {
if (System.Net.IPAddress.TryParse(ipInfo.DeviceIpAddress, out var parsedIp)) if (System.Net.IPAddress.TryParse(ipInfo.DeviceIpAddress, out var parsedIp))
{ {
@@ -328,6 +331,7 @@ namespace PepperDash.Essentials.WebSocketServer
this.LogWarning("Invalid IP address: {deviceIpAddress}", ipInfo.DeviceIpAddress); this.LogWarning("Invalid IP address: {deviceIpAddress}", ipInfo.DeviceIpAddress);
return false; return false;
}) ? csIpAddress.ToString() : processorIp; }) ? csIpAddress.ToString() : processorIp;
}
var appUrl = $"http://{ip}:{_parent.Config.DirectServer.Port}/mc/app?token={touchpanel.Key}"; var appUrl = $"http://{ip}:{_parent.Config.DirectServer.Port}/mc/app?token={touchpanel.Key}";