Skip to content

Host disconnects when a client leaves while joining #2804

@Pixel-Gamer

Description

@Pixel-Gamer

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions