multiplayer-community-contributions
multiplayer-community-contributions copied to clipboard
[SteamP2P] Coroutine couldn't be started error on application quit
When stop playing in Unity, MLAPI output following error:
Coroutine couldn't be started because the the game object 'NetworkManager' is inactive!
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
MLAPI.Transports.SteamP2P.SteamP2PTransport:Shutdown() (at Library/PackageCache/com.mlapi.contrib.transport.steamp2p@ea6c2d8db0/Runtime/SteamP2PTransport.cs:393)
MLAPI.NetworkManager:Shutdown() (at Library/PackageCache/com.unity.multiplayer.mlapi@3e3aef6aa0/Runtime/Core/NetworkManager.cs:632)
MLAPI.NetworkManager:OnDestroy() (at Library/PackageCache/com.unity.multiplayer.mlapi@3e3aef6aa0/Runtime/Core/NetworkManager.cs:596)
This happens in both Unity editor and builds and (seems to) causes the Steam connection not to be disconnected occasionally. If the player starts playing again and starts a host, a duplicated room hosted by the same player may happen.
Reproduce steps:
- Open any demo project with MLAPI and SteamP2P, e.g. this
- Start play in Unity editor
- Host a room
- Stop play in Unity editor
Environment:
- Windows 10 19042.867 / macOS 11.2.3
- Unity 2019.4.18f1
- MLAPI 0.1.0 preview
- SteamP2P Transport 1.0.0
Created a ticket (MTTSA-94) to fix this.
This should be considered resolved by #179 pull request and similar before it updated the SteamP2PTransport to SteamNetworkingTransport and we have now added SteamNetworkingSocketTransport.
The previous SteamP2PTransport had a number of issues the resolution of which may have resolved this.
@furic have you had this issue with recent builds or recent updates to the Steam related transports?