Skip to content

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

Merged
merged 4 commits into from
Oct 5, 2022
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
1 change: 1 addition & 0 deletions com.unity.netcode.gameobjects/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Additional documentation and release notes are available at [Multiplayer Documen

### Added

- `UnityTransport` now provides a way to set the Relay server data directly from the `RelayServerData` structure (provided by the Unity Transport package) throuh its `SetRelayServerData` method. This allows making use of the new APIs in UTP 1.3 that simplify integration of the Relay SDK. (#2235)
- IPv6 is now supported for direct connections when using `UnityTransport`. (#2232)
- Added WebSocket support when using UTP 2.0 with `UseWebSockets` property in the `UnityTransport` component of the `NetworkManager` allowing to pick WebSockets for communication. When building for WebGL, this selection happens automatically. (#2201)
- Added position, rotation, and scale to the `ParentSyncMessage` which provides users the ability to specify the final values on the server-side when `OnNetworkObjectParentChanged` is invoked just before the message is created (when the `Transform` values are applied to the message). (#2146)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,14 @@ public void SetRelayServerData(string ipv4Address, ushort port, byte[] allocatio
SetProtocol(ProtocolType.RelayUnityTransport);
}

/// <summary>Set the relay server data (using the lower-level Unity Transport data structure).</summary>
/// <param name="serverData">Data for the Relay server to use.</param>
public void SetRelayServerData(RelayServerData serverData)
{
m_RelayServerData = serverData;
SetProtocol(ProtocolType.RelayUnityTransport);
}

/// <summary>Set the relay server data for the host.</summary>
/// <param name="ipAddress">IP address of the relay server.</param>
/// <param name="port">UDP port of the relay server.</param>
Expand Down