diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index abc7731841..9a9a08bc6f 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -31,6 +31,7 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Changed +- Ensured that a useful error is thrown when attempting to build a dedicated server with Unity Transport that uses websockets. (#3336) - Changed root in-scene placed `NetworkObject` instances now will always have either the `Distributable` permission set unless the `SessionOwner` permission is set. (#3305) - Changed the `DestroyObject` message to reduce the serialized message size and remove the unnecessary message field. (#3304) - Changed the `NetworkTimeSystem.Sync` method to use half RTT to calculate the desired local time offset as opposed to the full RTT. (#3212) diff --git a/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs b/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs index f8db2e30d9..f08e3cebaa 100644 --- a/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs +++ b/com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs @@ -1668,6 +1668,21 @@ public void CreateDriver(UnityTransport transport, out NetworkDriver driver, } #endif +#if UNITY_SERVER + if (m_ProtocolType == ProtocolType.RelayUnityTransport) + { + if (m_UseWebSockets) + { + Debug.LogError("Transport is configured to use Websockets, but websockets are not available on server builds. Ensure that the \"Use WebSockets\" checkbox is checked under \"Unity Transport\" component."); + } + + if (m_RelayServerData.IsWebSocket != 0) + { + Debug.LogError("Relay server data indicates usage of WebSockets, but websockets are not available on server builds. Be sure to use \"dtls\" or \"udp\" as the connection type when creating the server data"); + } + } +#endif + #if UTP_TRANSPORT_2_0_ABOVE if (m_UseEncryption) {