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

clientId of OnClientConnectedCallback is 0 for all clients when using Distributed Authority and Scene Management is disabled #3211

Open
FureurTime opened this issue Jan 19, 2025 · 0 comments
Labels
stat:awaiting triage Status - Awaiting triage from the Netcode team. type:bug Bug Report

Comments

@FureurTime
Copy link

Description

When using the Distributed Authority topology and disabling scene management on the NetworkManager, the OnClientConnectedCallback callback have clientId set as 0 for all clients.

Reproduce Steps

  1. Set Network Topology to Distributed Authority on the NetworkManager
  2. Disable Scene Management on the NetworkManager

Image

  1. Implement the following code to check the output when a client connects:
void Start()
{
    NetworkManager.Singleton.OnClientConnectedCallback += OnClientConnectedCallback;
}

void OnClientConnectedCallback(ulong clientId)
{
    Debug.Log($"OnClientConnected clientId={clientId}, LocalClientId={NetworkManager.Singleton.LocalClientId}");
}

Actual Outcome

clientId is always 0. whether we are the host or not.

Expected Outcome

clientId should be the same as NetworkManager.Singleton.LocalClientId.

More Info

When Scene Management is enabled on the NetworkManager the output is :
OnClientConnected clientId=1, LocalClientId=1

When Scene Management is disabled the output is :
OnClientConnected clientId=0, LocalClientId=1

If another client connects to the server, their output is :
OnClientConnected clientId=0, LocalClientId=2

Environment

  • OS: Windows 11
  • Unity Version: 6000.0.32f1
  • Netcode Version: 2.2.0
@FureurTime FureurTime added stat:awaiting triage Status - Awaiting triage from the Netcode team. type:bug Bug Report labels Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting triage Status - Awaiting triage from the Netcode team. type:bug Bug Report
Projects
None yet
Development

No branches or pull requests

1 participant