Closed Pixel-Gamer closed 10 months ago
If you can't reproduce it with a reproduction project (i.e. blank project with the same basic scripts), then I would look to see if there is anything in the hybrid transport portions of your script and set the NetworkManager LogLevel to developer to see if you can get any additional information as to why the host is having this issue.
You might also try replacing your manifest.json file with this:
"com.unity.netcode.gameobjects": "https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#develop",
PR #2789 fixes several issues with the shutdown sequence and notifications.
If you can't find anything that stands out in the hybrid transport portions of your script and the most current version of NGO does not resolve the issue, then (with LogLevel set to developer) could you post the host's log for a session where this occurs? I might be able to see something in that which could explain the issue.
I found out that the issue is with the Steam Networking Sockets Transport. So I posted an issue over where the Transport is from https://github.com/Unity-Technologies/multiplayer-community-contributions/issues/245#issue-2071579968
Description I have an issue where when a client shutdowns their Network Manager while it is trying to join a lobby, the host of that lobby then breaks. This will also occur if the client closes the game through task manager while joining or if the connection is interrupted during the joining process.
How To Reproduce
Outcome The client part of the host(server, client) will disconnect, but the host's Network Manager will still be connected to other clients and running as the host. (DontDestroyWithOwner bool set to false) The host's player Object will be deleted (DontDestroyWithOwner bool set to True) The host's player NetworkObject will lose it's observers The host's game won't receive ClientRpc's anymore The host gets the OnClientDisconnect callback for when the Client part of the Host disconnects.
Expected Outcome All that should happen is the client should stop trying to join and not break the hosts' game
Environment
Additional Context I have tried reproducing the issue in a blank project to see if I could reproduce this issue, but I can't the blank project uses the same joining scripts and leaving methods in my other game. And the only other difference is the game that has this issue is using a hybrid of Unity Transport and Steam Networking Sockets Transport, but I don't think that is the issue because before start I have a bool I can toggle that switches the game's code from Unity Transport (local and for testing) and Steam Networking Sockets Transport (for game builds)