So I just managed to integrate Unity Mirror with FizzySteamworks as transportation layer.
My networkmanager is initialized in the offline scene (a main menu) and once I click "Play Game" everything works correctly until I quit (which I do by calling the method networkManager.StopHost()
). This moves me to the offline scene, but whenever I press play again I get the following error: InvalidOperationException: Steamworks is not initialized.
Is it possible that I disconnect/quit the game in a wrongful way? Should I disconnect via steamworks (Fizzy) instead?
Why is the SteamWorks API initialized only the first time when I enter the Main Menu and not the second?
I had to enable "Persist Network Manager To Offline Scene".
However, this added another problem whereas clients could not re-host a session if they had been automatically kicked from a previous session (kicked from the host quitting).
I noticed that SteamMatchmaking.LeaveLobby() didn't run on the client's side once a host auto kicks clients by calling a quit.
I therefore added a ClientRpc call from my DisconnectHost() method to make sure all clients left the Steam lobby before anyone lgot kicked by a host
.