Skip to content

Commit

Permalink
Fix some processes missing from "Attach to Process (Unity)"
Browse files Browse the repository at this point in the history
I added an optional non-capturing group to take care of the number & comma that comes before the machine name on my machine.
  • Loading branch information
rigdern committed Sep 11, 2023
1 parent 7c2a786 commit eaa2764
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public override IEnumerable<AttachProgramOptions> 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;
Expand Down

0 comments on commit eaa2764

Please sign in to comment.