multiplayer-community-contributions icon indicating copy to clipboard operation
multiplayer-community-contributions copied to clipboard

[SteamP2P] Coroutine couldn't be started error on application quit

Open furic opened this issue 4 years ago • 2 comments

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:

  1. Open any demo project with MLAPI and SteamP2P, e.g. this
  2. Start play in Unity editor
  3. Host a room
  4. 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

furic avatar Apr 19 '21 07:04 furic

Created a ticket (MTTSA-94) to fix this.

LukeStampfli avatar Apr 23 '21 13:04 LukeStampfli

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?

JamesMcGhee avatar Sep 05 '22 12:09 JamesMcGhee