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

ConnectedClients & ConnectedClientsList Not Updated on Distributed Authority Session Owner #3116

Closed
Moe-Baker opened this issue Nov 6, 2024 · 3 comments
Assignees
Labels
stat:awaiting response Status - Awaiting response from author. type:support Questions or other support

Comments

@Moe-Baker
Copy link

Description

Both NetworkManager.ConnectedClients & NetworkManager.ConnectedClientsList are not updated on the NetworkManager's session owner client, and only updated on the non-session owner clients.
While NetworkManager.ConnectedClientsIds is updated accordingly on all clients.

Reproduce Steps

Put

if (NetworkManager.Singleton && NetworkManager.Singleton.IsConnectedClient)
      Debug.LogWarning($"Connected Clients Count: {NetworkManager.Singleton.ConnectedClients.Count} | {NetworkManager.Singleton.ConnectedClientsIds.Count} | {NetworkManager.Singleton.ConnectedClientsList.Count}");

in any Update Loop and connect two clients together, the session owner will print "Connected Clients Count: 1 | 2 | 1" when both clients are connected.

Actual Outcome

It's broken.

Expected Outcome

It not being broken.

Environment

  • OS: [Windows Editor]
  • Unity Version: [6000.0.23f1]
  • Netcode Version: [2.0.0]
  • Netcode Commit: [None]
@Moe-Baker Moe-Baker added stat:awaiting triage Status - Awaiting triage from the Netcode team. type:bug Bug Report labels Nov 6, 2024
@NoelStephensUnity NoelStephensUnity added the Investigating Issue is currently being investigated label Nov 8, 2024
@NoelStephensUnity
Copy link
Collaborator

@Moe-Baker
Below is a replication of your steps using a generic project I use to run through issues:
3116_Replication.zip

You can find the code to check the client counts within the ExtendedNetworkManager.OnUpdateGUIConnected method on line 261:
image

When using the above project, I am not seeing the same thing you are seeing.
image

It really depends upon when you are checking those values since one is updated upon the initial connection accepted message and then a second message is received very shortly after that (around 1/2 RTT to the service) which provides the rest of the client information.

You will need to update the Services information to point to your own organization and most likely want to create a new cloud project prior to testing:
image

Take a look at the attached project and let me know if that helps?

@NoelStephensUnity NoelStephensUnity added type:support Questions or other support stat:awaiting response Status - Awaiting response from author. and removed type:bug Bug Report stat:awaiting triage Status - Awaiting triage from the Netcode team. Investigating Issue is currently being investigated labels Nov 8, 2024
@NoelStephensUnity NoelStephensUnity self-assigned this Nov 8, 2024
@NoelStephensUnity
Copy link
Collaborator

@Moe-Baker
Just following up to see if the attached project and description helped?

@Moe-Baker
Copy link
Author

Sorry for the delay.
It's all working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Status - Awaiting response from author. type:support Questions or other support
Projects
None yet
Development

No branches or pull requests

2 participants