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

Showing extra information about Unity Player/Editor when attaching th… #129

Merged
merged 1 commit into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions TestProject/PlayerConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ParsingPlayerConnectionString
public void XboxOneTestCase()
{
var dictionary = PlayerConnection.PlayerInfo.ParsePlayerString(
@"[IP] 192.168.1.9 [Port] 4600 [Flags] 3 [Guid] 1343323326 [EditorId] 2183797363 [Version] 1048832 [Id] XboxOnePlayer(192.168.1.9):4601 [Debug] 1");
@"[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");
Assert.AreEqual("192.168.1.9", dictionary["ip"]);
Assert.AreEqual("4600", dictionary["port"]);
Assert.AreEqual("3", dictionary["flags"]);
Expand All @@ -20,13 +20,14 @@ public void XboxOneTestCase()
Assert.AreEqual("1048832", dictionary["version"]);
Assert.AreEqual("XboxOnePlayer(192.168.1.9):4601", dictionary["id"]);
Assert.AreEqual("1", dictionary["debug"]);
Assert.AreEqual("ProjectNameTest", dictionary["projectname"]);
}

[Test]
public void PS4PlayerTestCase()
{
var dictionary = PlayerConnection.PlayerInfo.ParsePlayerString(
@"[IP] 192.168.1.4 [Port] 35037 [Flags] 3 [Guid] 1906011430 [EditorId] 2225513615 [Version] 1048832 [Id] PS4Player(192.168.1.4):4601 [Debug] 1");
@"[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");
Assert.AreEqual("192.168.1.4", dictionary["ip"]);
Assert.AreEqual("35037", dictionary["port"]);
Assert.AreEqual("3", dictionary["flags"]);
Expand All @@ -35,6 +36,7 @@ public void PS4PlayerTestCase()
Assert.AreEqual("1048832", dictionary["version"]);
Assert.AreEqual("PS4Player(192.168.1.4):4601", dictionary["id"]);
Assert.AreEqual("1", dictionary["debug"]);
Assert.AreEqual("ProjectNameTest", dictionary["projectname"]);
}
}

Expand All @@ -45,7 +47,7 @@ public class PlayerInfo
public void XboxOneTestCase()
{
var playerInfo = PlayerConnection.PlayerInfo.Parse(
@"[IP] 192.168.1.9 [Port] 4600 [Flags] 3 [Guid] 1343323326 [EditorId] 2183797363 [Version] 1048832 [Id] XboxOnePlayer(192.168.1.9):4601 [Debug] 1");
@"[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");
Assert.AreEqual("192.168.1.9", playerInfo.m_IPEndPoint.Address.ToString());
Assert.AreEqual(4600, playerInfo.m_IPEndPoint.Port);
Assert.AreEqual(3, playerInfo.m_Flags);
Expand All @@ -54,13 +56,14 @@ public void XboxOneTestCase()
Assert.AreEqual(1048832, playerInfo.m_Version);
Assert.AreEqual("XboxOnePlayer(192.168.1.9):4601", playerInfo.m_Id);
Assert.AreEqual(true, playerInfo.m_AllowDebugging);
Assert.AreEqual("ProjectNameTest", playerInfo.m_ProjectName);
}

[Test]
public void PS4PlayerTestCase()
{
var playerInfo = PlayerConnection.PlayerInfo.Parse(
@"[IP] 192.168.1.4 [Port] 35037 [Flags] 3 [Guid] 1906011430 [EditorId] 2225513615 [Version] 1048832 [Id] PS4Player(192.168.1.4):4601 [Debug] 1");
@"[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");
Assert.AreEqual("192.168.1.4", playerInfo.m_IPEndPoint.Address.ToString());
Assert.AreEqual(35037, playerInfo.m_IPEndPoint.Port);
Assert.AreEqual(3, playerInfo.m_Flags);
Expand All @@ -69,6 +72,7 @@ public void PS4PlayerTestCase()
Assert.AreEqual(1048832, playerInfo.m_Version);
Assert.AreEqual("PS4Player(192.168.1.4):4601", playerInfo.m_Id);
Assert.AreEqual(true, playerInfo.m_AllowDebugging);
Assert.AreEqual("ProjectNameTest", playerInfo.m_ProjectName);
}
}
}
2 changes: 1 addition & 1 deletion UnityDebug/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static string GetUnityProcesses()
{
var processes = UnityProcessDiscovery.GetAttachableProcesses();

return string.Join("\n", processes.Select(x => x.Name + $" ({x.Id})"));
return string.Join("\n", processes.Select(x => $"{x.Name} ({x.Id})" + $" {x.ProjectName}"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just combine these to one interpolated string: $"{x.Name} ({x.Id}) {x.ProjectName}"

}
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
"ms-vscode.csharp"
],
"devDependencies": {
"vscode": "^1.1.21",
"vscode": "^1.1.30",
"vscode-debugprotocol": "^1.32.0",
"vscode-nls": "^4.0.0"
},
"dependencies": {
"@types/node": "^10.5.1",
"make": "^0.8.1",
"npm": "^6.1.0"
"npm": "^6.9.0"
},
"categories": [
"Debuggers"
Expand Down