Skip to content

Commit 5bdf740

Browse files
committed
fix: cross platform fixes for mdns and module sandboxing
1 parent 94f5f5a commit 5bdf740

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

VRCFaceTracking.Core/Library/UnifiedLibManager.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
using System;
21
using System.Collections.ObjectModel;
32
using System.Diagnostics;
4-
using System.IO;
53
using System.Reflection;
6-
using System.Runtime.Loader;
4+
using System.Runtime.InteropServices;
75
using Microsoft.Extensions.Logging;
8-
using Sentry.Protocol;
9-
using VRCFaceTracking.Core.Contracts;
106
using VRCFaceTracking.Core.Contracts.Services;
11-
using VRCFaceTracking.Core.Models;
127
using VRCFaceTracking.Core.Sandboxing;
138
using VRCFaceTracking.Core.Sandboxing.IPC;
149

@@ -57,7 +52,7 @@ public UnifiedLibManager(ILoggerFactory factory, IDispatcherService dispatcherSe
5752
_moduleDataService = moduleDataService;
5853

5954
LoadedModulesMetadata = new ObservableCollection<ModuleMetadataInternal>();
60-
_sandboxProcessPath = Path.GetFullPath("VRCFaceTracking.ModuleProcess.exe");
55+
_sandboxProcessPath = Path.GetFullPath(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "VRCFaceTracking.ModuleProcess.exe" : "VRCFaceTracking.ModuleProcess");
6156
if ( !File.Exists(_sandboxProcessPath) )
6257
{
6358
// @TODO: Better error handling

VRCFaceTracking.Core/mDNS/MulticastDnsService.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Net;
22
using System.Net.NetworkInformation;
33
using System.Net.Sockets;
4+
using System.Runtime.InteropServices;
45
using CommunityToolkit.Mvvm.ComponentModel;
56
using Microsoft.Extensions.Logging;
67
using VRCFaceTracking.Core.OSC.Query.mDNS;
@@ -26,9 +27,9 @@ public partial class MulticastDnsService : ObservableObject
2627
private static List<NetworkInterface> GetIpv4NetInterfaces() => NetworkInterface.GetAllNetworkInterfaces()
2728
.Where(net =>
2829
net.OperationalStatus == OperationalStatus.Up &&
29-
net.NetworkInterfaceType != NetworkInterfaceType.Loopback &&
30+
net.NetworkInterfaceType != NetworkInterfaceType.Loopback && (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || (
3031
net.SupportsMulticast &&
31-
net.GetIPProperties().MulticastAddresses.Any())
32+
net.GetIPProperties().MulticastAddresses.Count != 0)))
3233
.ToList();
3334

3435
// Get the first ipv4 address from a specific network interface

0 commit comments

Comments
 (0)