Search Issue Tracker

Fixed

Fixed in ngo-1.10.0

Votes

0

Found in [Package]

netcode-gameobjects-1.8.1

netcode-gameobjects-1.9.1

Issue ID

MTTB-135

Regression

No

[GH-2927] ConnectedClients.Count hasn't been updated" when OnClientDisconnectCallback is triggered

Package: Multiplayer Netcode for GameObjects

-

[https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/2927]
h3. Description

I add listener functions for both OnClientConnectedCallback() and OnClientDisconnectCallback() to update client amount when clients connect or disconnect.

Inside OnClientConnectedCallback(), the NetworkManager.Singleton.ConnectedClients.Count is correct while it's wrong inside OnClientDisconnectCallback()
h3. Reproduce Steps

  1. Client: StartClient()
  1. Server: OnClientConnectedCallback() gets triggered, NetworkManager.Singleton.ConnectedClientsIds has proper amount of clients which is 1
  1. Client: Shutdown() or just close app
  1. Server: OnClientDisconnectCallback() gets triggered, NetworkManager.Singleton.ConnectedClientsIds has WRONG amount of clients which is still 1 rather than 0

h3. Environment

  • OS: macOS Sonoma
  • Unity Version: 2022.3.20
  • Netcode Version: 1.8.1

 

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.