Skip to content

fix: Allow Relay hosts/servers on WebGL #2321

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 3 commits into from
Nov 24, 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
3 changes: 3 additions & 0 deletions com.unity.netcode.gameobjects/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ Additional documentation and release notes are available at [Multiplayer Documen
### Added

### Changed

- The default listen address of `UnityTransport` is now 0.0.0.0. (#2307)

### Fixed

- Fixed an issue in `UnityTransport` where an exception would be thrown if starting a Relay host/server on WebGL. This exception should only be thrown if using direct connections (where WebGL can't act as a host/server). (#2321)

## [1.2.0] - 2022-11-21

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ public void CreateDriver(UnityTransport transport, out NetworkDriver driver,
heartbeatTimeoutMS: transport.m_HeartbeatTimeoutMS);

#if UNITY_WEBGL && !UNITY_EDITOR
if (NetworkManager.IsServer)
if (NetworkManager.IsServer && m_ProtocolType != ProtocolType.RelayUnityTransport)
{
throw new Exception("WebGL as a server is not supported by Unity Transport, outside the Editor.");
}
Expand Down