Skip to content

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

@FureurTime

Description

@FureurTime

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stat:importedStatus - Issue is tracked internally at Unitytype:bugBug Report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions