-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: move UTP integration into NGO, delete UTP Adapter package #1823
Conversation
com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs
Outdated
Show resolved
Hide resolved
|
||
<!-- Add JIRA link here. Short version (e.g. MTT-123) also works and gets auto-linked. --> | ||
|
||
<!-- Add RFC link here if applicable. --> | ||
|
||
## Changelog | ||
|
||
### com.unity.netcode.gameobjects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed section separation since there is no other package under this repo anymore
@@ -1,11 +0,0 @@ | |||
{ | |||
"name": "com.unity.netcode.adapter.utp", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think deleting this package would mean something on UDash/Operate side too.
We should update that catalog thing we maintain for online dashboards people use via Unity Cloud Services site @ashwinimurt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes there is, I will do a PR there and add you.
- name: com.unity.netcode.adapter.utp | ||
path: com.unity.netcode.adapter.utp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
less work on Yamato, faster CI, faster PRs!
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7 | ||
ExtractNetworkMetrics(); | ||
if (NetworkManager) | ||
{ | ||
ExtractNetworkMetrics(); | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an additional change, not just a copy-paste from UTP Adapter package.
UnityTransportTests
& UnityTransportConnectionTests
don't necessarily require a NetworkManager
instance to be there, they were working just fine.
however, ExtractNetworkMetrics();
requires one and there won't be a NetworkManager
during these tests.
there are tests running with ExtractNetworkMetrics();
and NetworkManager
present but this fix basically disables ExtractNetworkMetrics();
call in UnityTransportTests
& UnityTransportConnectionTests
only which I think is totally fine but just wanted to mention here. @becksebenius-unity @simon-lemay-unity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks fine to me. Makes sense in that context. I am not concerned about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! My only concern is not with the change itself, but how it will have to be handled by users. If someone already has the adapter package installed, when they update to this version of NGO, will things break? Assuming things do break, does it break in a way where it's pretty obvious what they need to do to fix the issue?
@@ -109,9 +110,7 @@ public bool OnVerifyCanReceive(ulong senderId, Type messageType) | |||
public enum InstanceTransport | |||
{ | |||
SIP, | |||
#if UTP_ADAPTER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes me so happy :D
#if MULTIPLAYER_TOOLS_1_0_0_PRE_7 | ||
ExtractNetworkMetrics(); | ||
if (NetworkManager) | ||
{ | ||
ExtractNetworkMetrics(); | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks fine to me. Makes sense in that context. I am not concerned about it.
While I think this is a reasonable change.... is there any concern at the fact that now you will have to release a new package any time UTP needs to be updated? One of the nice things about having the other package was if you needed to update UTP you could and you didn't pull in any changes for NGO as they were separated. @simon-lemay-unity I agree with this concern because essentially you can install both packages independently of each other which means I could install a newer version of NGO that has UTP, and then install the other package and they will both install as long as they are API compatible and then potentially cause compiler errors. What I would recommend doing is actually adding some editor checks to see which version of NGO you are using and if you are using a version that has this change in it and you have the old package installed then remove it. You can use the package manager API for this... This is similar to what Unity is doing for the IL2CPP Cross compiler package except its uninstalling instead of installing. I would also work to get the package marked as deprecated in the manifest.json file for an editor release because that will just remove the package if its present. |
yes, this is expected and we're OK with that. if we want to fix UTP <-> NGO integration, that'll happen underneath NGO. also, if we want to upgrade UTP version, that also will happen in a minor NGO version release.
as we briefly discussed, it does make sense to implement an editor code to remove UTP Adapter package automatically if present in the project. (for the reference:
yeah, I think we need to mark UTP Adapter as deprecated and people should not be able to search/discover it. I'll follow-up on that internally too. thank you @wackoisgod :) |
…ally from the project
@@ -10,3 +10,4 @@ | |||
[assembly: InternalsVisibleTo("TestProject.RuntimeTests")] | |||
[assembly: InternalsVisibleTo("Unity.Netcode.RuntimeTests")] | |||
[assembly: InternalsVisibleTo("Unity.Netcode.TestHelpers.Runtime")] | |||
[assembly: InternalsVisibleTo("Unity.Netcode.Adapter.UTP")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needed to be put back to prevent projects with UTP Adapter package installed from breaking.
With this PR, we're removing
com.unity.netcode.adapter.utp
package entirely and moving its contents into the package directly. This makes the package depend oncom.unity.transport
package directly, also allows us to present UTP as our default, 1st-party supported transport in post-UNET world (2022+).MTT-2884
Changelog
UnityTransport
implementation andcom.unity.transport
package dependencyTesting and Documentation