-
Notifications
You must be signed in to change notification settings - Fork 464
feat: Add new SetRelayServerData method to UnityTransport #2235
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
Conversation
SamuelBellomo
left a comment
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.
Reading the description for this PR, this looks really cool. This will remove the should remove the need for our UnityRelayUtilities in boss room I believe. Will need to try.
Would be very curious to get some feedback once this is integrated in Boss Room. I've written the new APIs with the goal of simplifying integration with the Relay SDK. And while it did simplify our samples in UTP a lot, trying it in a real project like Boss Room will be interesting. |
|
@ashwinimurt , this is the PR I was mentioning to add for NGO 1.1 |
@simon-lemay-unity I have a PR for NGO:1.1 update in boss room here Unity-Technologies/com.unity.multiplayer.samples.coop#708 |
…nologies#2235) * feat: Add new SetRelayServerData method to UnityTransport * Don't pass server data by reference * Add PR number to CHANGELOG entry
This PR adds a new API to
UnityTransportthat allows setting the Relay server data directly from theRelayServerDatastructure provided by UTP. The idea behind this change is to make it easier for NGO users to benefit from new APIs introduced in UTP 1.3. These new APIs allow creatingRelayServerDatastructures directly from allocation objects from the Relay SDK.For example, given an
allocationobject coming directly from the Relay SDK, this PR allows configuring the Relay server data in this manner:Compared to the previous ways of configuring the server data, this has many advantages:
RelayServerDataconstructors accept bothAllocationandJoinAllocationobjects.Allocation/JoinAllocationobjects in their individual fields just to pass them to NGO.isSecureparameter ofSetClientRelayDataandSetHostRelayData(e.g. you can't select a DTLS endpoint and forget to setisSecureto true).The previous APIs to set Relay server data remain available (and I'll get them to work with secure WebSockets in a future PR). Although if this lands I'll probably modify the Relay documentation to use the new ones.
Changelog
UnityTransportnow provides a way to set the Relay server data directly from theRelayServerDatastructure (provided by the Unity Transport package) throuh itsSetRelayServerDatamethod. This allows making use of the new APIs in UTP 1.3 that simplify integration of the Relay SDK.Testing and Documentation