Skip to content

ClientId is 0 (or default) in the OnClientDisconnectedCallback when client is refused immediately #2566

Closed
@LeFlown

Description

@LeFlown

Description

ClientId is 0 (or default) in the OnClientDisconnectedCallback if server refuse the connection immediately

Reproduce Steps

  • Start a server with a simple approval callback, no client connected.
  • Connect a client.
  • In the ConnectionApprovalCallback (server-side), the ClientId is 1 (request.ClientNetworkId)
  • Refused the client immediately (Version mismatch for example)
  • In the OnClientDisconnectCallback, observe the clientId parameter value, 0 instead of 1.

Actual Outcome

Wrong client Id in the OnClientDisconnectedCallback parameter

Expected Outcome

Good client Id in the OnClientDisconnectedCallback parameter

Screenshots

Showing that the TransportIdCleanUp is called twice, returning the wrong value the second time:
image
image
image
image
image

Environment

  • OS: Windows 10
  • Unity Version: 2022.2.3
  • Netcode Version: 1.4

Metadata

Metadata

Labels

priority:mediumThis issue has medium priority and may take some time to be resolvedstat: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