Skip to content

Connection Approval timeout does not work on client-side #1928

@JesseOlmer

Description

@JesseOlmer

Description

NetworkManager.ApprovalTimeout() is called during the connection process on clients, but will always no-op because NetworkManager.PendingClients is not populated on the client.

ApprovalTimeout Coroutine Invoke:
https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/blob/develop/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs#L1505

PendingClients conditional:
https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/blob/develop/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs#L1427
https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/blob/develop/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs#L1432

See also #1927

Reproduce Steps

  1. Put a breakpoint in NetworkManager.HandleApproval
  2. Attach debugger to a client (I used testproject)
  3. Connect the client to a server
  4. Step through and observe empty PendingClients list

Actual Outcome

The approval timeout coroutine early-outs immediately on the client

Expected Outcome

Either the timeout is not invoked on a client (risky?) or it properly monitors the pending connection status of the client.

Environment

  • OS: macOS
  • Unity Version: 2020.3.33f1
  • Netcode Version: develop latest
  • Netcode Commit: 309ad7f

Additional Context

It looks like this has been broken for a very long time. I believe at one point we had clients adding themselves to the pendingclients list locally, but I haven't been able to find when that was or when/why it would have been removed.
All started from this slack thread: https://unity.slack.com/archives/C01JHPY05T5/p1651612938951379

Metadata

Metadata

Assignees

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
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions