fix: Allow Relay hosts/servers on WebGL (#2321)

* fix: Allow Relay hosts/servers on WebGL

* Add PR number to CHANGELOG entry
This commit is contained in:
Simon Lemay 2022-11-24 11:57:33 -05:00 коммит произвёл GitHub
Родитель 8ee79ab2a3
Коммит d9ab3a7ffb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -1471,7 +1471,7 @@ namespace Unity.Netcode.Transports.UTP
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.");
}