From eaa27643ef16e01fcb02f53859c1b6a4a31e3dea Mon Sep 17 00:00:00 2001 From: Adam Comella Date: Thu, 31 Aug 2023 16:23:22 -0700 Subject: [PATCH] Fix some processes missing from "Attach to Process (Unity)" I added an optional non-capturing group to take care of the number & comma that comes before the machine name on my machine. --- .../AttachToProcess/UnityPlayerAttachProgramOptionsProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/Dialogs/AttachToProcess/UnityPlayerAttachProgramOptionsProvider.cs b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/Dialogs/AttachToProcess/UnityPlayerAttachProgramOptionsProvider.cs index 55399067d4..8eb8ed8cce 100644 --- a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/Dialogs/AttachToProcess/UnityPlayerAttachProgramOptionsProvider.cs +++ b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/Dialogs/AttachToProcess/UnityPlayerAttachProgramOptionsProvider.cs @@ -92,7 +92,7 @@ public override IEnumerable Create(AttachProgramOptionsPro } } - static readonly Regex playerAnnounceStringRegex = new Regex(@"^\[IP\] (\S+) \[Port\] (\d+) \[Flags\] (-?\d+) \[Guid\] (\d+) \[EditorId\] (\d+) \[Version\] (\d+) \[Id\] ([^\(]+)\(([^\)]+)\)(:(\d+))? \[Debug\] (\d+)"); + static readonly Regex playerAnnounceStringRegex = new Regex(@"^\[IP\] (\S+) \[Port\] (\d+) \[Flags\] (-?\d+) \[Guid\] (\d+) \[EditorId\] (\d+) \[Version\] (\d+) \[Id\] ([^\(]+)\((?:\d+,)?([^\)]+)\)(:(\d+))? \[Debug\] (\d+)"); bool TryParseUnityPlayerData(string s, [NotNullWhen(true)] out string? ipAddress, out ushort port, [NotNullWhen(true)] out string? playerId) { ipAddress = null; port = 0;