Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host disconnects when a client leaves while joining #2804

Closed
Pixel-Gamer opened this issue Jan 4, 2024 · 2 comments
Closed

Host disconnects when a client leaves while joining #2804

Pixel-Gamer opened this issue Jan 4, 2024 · 2 comments
Labels
type:bug Bug Report

Comments

@Pixel-Gamer
Copy link

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

  1. Host
  2. Join a client
  3. During Client join process shutdown Network Manager
  4. Send Client Rpcs and see if the host is receving them (if they aren't thats the issue)

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

  • OS: Windows 10
  • Unity Version: 2022.2.16f1
  • Netcode Version: v1.7.1

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)

@Pixel-Gamer Pixel-Gamer added stat:awaiting triage Status - Awaiting triage from the Netcode team. type:bug Bug Report labels Jan 4, 2024
@NoelStephensUnity
Copy link
Collaborator

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.

@NoelStephensUnity NoelStephensUnity added the stat:awaiting response Awaiting response from author. This label should be added manually. label Jan 5, 2024
@Pixel-Gamer
Copy link
Author

I found out that the issue is with the Steam Networking Sockets Transport.
So I posted an issue over where the Transport is from
Unity-Technologies/multiplayer-community-contributions#245 (comment)

@michalChrobot michalChrobot removed stat:awaiting response Awaiting response from author. This label should be added manually. stat:awaiting triage Status - Awaiting triage from the Netcode team. labels Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Bug Report
Projects
None yet
Development

No branches or pull requests

3 participants