Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit ea401f7

Browse files
committed
Showing extra information about Unity Player/Editor when attaching the Debugger from VSCode
1 parent aa05d61 commit ea401f7

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

TestProject/PlayerConnection.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class ParsingPlayerConnectionString
1111
public void XboxOneTestCase()
1212
{
1313
var dictionary = PlayerConnection.PlayerInfo.ParsePlayerString(
14-
@"[IP] 192.168.1.9 [Port] 4600 [Flags] 3 [Guid] 1343323326 [EditorId] 2183797363 [Version] 1048832 [Id] XboxOnePlayer(192.168.1.9):4601 [Debug] 1");
14+
@"[IP] 192.168.1.9 [Port] 4600 [Flags] 3 [Guid] 1343323326 [EditorId] 2183797363 [Version] 1048832 [Id] XboxOnePlayer(192.168.1.9):4601 [Debug] 1 [ProjectName] ProjectNameTest");
1515
Assert.AreEqual("192.168.1.9", dictionary["ip"]);
1616
Assert.AreEqual("4600", dictionary["port"]);
1717
Assert.AreEqual("3", dictionary["flags"]);
@@ -20,13 +20,14 @@ public void XboxOneTestCase()
2020
Assert.AreEqual("1048832", dictionary["version"]);
2121
Assert.AreEqual("XboxOnePlayer(192.168.1.9):4601", dictionary["id"]);
2222
Assert.AreEqual("1", dictionary["debug"]);
23+
Assert.AreEqual("ProjectNameTest", dictionary["projectname"]);
2324
}
2425

2526
[Test]
2627
public void PS4PlayerTestCase()
2728
{
2829
var dictionary = PlayerConnection.PlayerInfo.ParsePlayerString(
29-
@"[IP] 192.168.1.4 [Port] 35037 [Flags] 3 [Guid] 1906011430 [EditorId] 2225513615 [Version] 1048832 [Id] PS4Player(192.168.1.4):4601 [Debug] 1");
30+
@"[IP] 192.168.1.4 [Port] 35037 [Flags] 3 [Guid] 1906011430 [EditorId] 2225513615 [Version] 1048832 [Id] PS4Player(192.168.1.4):4601 [Debug] 1 [ProjectName] ProjectNameTest");
3031
Assert.AreEqual("192.168.1.4", dictionary["ip"]);
3132
Assert.AreEqual("35037", dictionary["port"]);
3233
Assert.AreEqual("3", dictionary["flags"]);
@@ -35,6 +36,7 @@ public void PS4PlayerTestCase()
3536
Assert.AreEqual("1048832", dictionary["version"]);
3637
Assert.AreEqual("PS4Player(192.168.1.4):4601", dictionary["id"]);
3738
Assert.AreEqual("1", dictionary["debug"]);
39+
Assert.AreEqual("ProjectNameTest", dictionary["projectname"]);
3840
}
3941
}
4042

@@ -45,7 +47,7 @@ public class PlayerInfo
4547
public void XboxOneTestCase()
4648
{
4749
var playerInfo = PlayerConnection.PlayerInfo.Parse(
48-
@"[IP] 192.168.1.9 [Port] 4600 [Flags] 3 [Guid] 1343323326 [EditorId] 2183797363 [Version] 1048832 [Id] XboxOnePlayer(192.168.1.9):4601 [Debug] 1");
50+
@"[IP] 192.168.1.9 [Port] 4600 [Flags] 3 [Guid] 1343323326 [EditorId] 2183797363 [Version] 1048832 [Id] XboxOnePlayer(192.168.1.9):4601 [Debug] 1 [ProjectName] ProjectNameTest");
4951
Assert.AreEqual("192.168.1.9", playerInfo.m_IPEndPoint.Address.ToString());
5052
Assert.AreEqual(4600, playerInfo.m_IPEndPoint.Port);
5153
Assert.AreEqual(3, playerInfo.m_Flags);
@@ -54,13 +56,14 @@ public void XboxOneTestCase()
5456
Assert.AreEqual(1048832, playerInfo.m_Version);
5557
Assert.AreEqual("XboxOnePlayer(192.168.1.9):4601", playerInfo.m_Id);
5658
Assert.AreEqual(true, playerInfo.m_AllowDebugging);
59+
Assert.AreEqual("ProjectNameTest", playerInfo.m_ProjectName);
5760
}
5861

5962
[Test]
6063
public void PS4PlayerTestCase()
6164
{
6265
var playerInfo = PlayerConnection.PlayerInfo.Parse(
63-
@"[IP] 192.168.1.4 [Port] 35037 [Flags] 3 [Guid] 1906011430 [EditorId] 2225513615 [Version] 1048832 [Id] PS4Player(192.168.1.4):4601 [Debug] 1");
66+
@"[IP] 192.168.1.4 [Port] 35037 [Flags] 3 [Guid] 1906011430 [EditorId] 2225513615 [Version] 1048832 [Id] PS4Player(192.168.1.4):4601 [Debug] 1 [ProjectName] ProjectNameTest");
6467
Assert.AreEqual("192.168.1.4", playerInfo.m_IPEndPoint.Address.ToString());
6568
Assert.AreEqual(35037, playerInfo.m_IPEndPoint.Port);
6669
Assert.AreEqual(3, playerInfo.m_Flags);
@@ -69,6 +72,7 @@ public void PS4PlayerTestCase()
6972
Assert.AreEqual(1048832, playerInfo.m_Version);
7073
Assert.AreEqual("PS4Player(192.168.1.4):4601", playerInfo.m_Id);
7174
Assert.AreEqual(true, playerInfo.m_AllowDebugging);
75+
Assert.AreEqual("ProjectNameTest", playerInfo.m_ProjectName);
7276
}
7377
}
7478
}

UnityDebug/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static string GetUnityProcesses()
8888
{
8989
var processes = UnityProcessDiscovery.GetAttachableProcesses();
9090

91-
return string.Join("\n", processes.Select(x => x.Name + $" ({x.Id})"));
91+
return string.Join("\n", processes.Select(x => $"{x.Name} ({x.Id})" + $" {x.ProjectName}"));
9292
}
9393
}
9494
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"ms-vscode.csharp"
1313
],
1414
"devDependencies": {
15-
"vscode": "^1.1.21",
15+
"vscode": "^1.1.30",
1616
"vscode-debugprotocol": "^1.32.0",
1717
"vscode-nls": "^4.0.0"
1818
},
1919
"dependencies": {
2020
"@types/node": "^10.5.1",
2121
"make": "^0.8.1",
22-
"npm": "^6.1.0"
22+
"npm": "^6.9.0"
2323
},
2424
"categories": [
2525
"Debuggers"

0 commit comments

Comments
 (0)