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
- Put a breakpoint in
NetworkManager.HandleApproval
- Attach debugger to a client (I used
testproject)
- Connect the client to a server
- 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
Description
NetworkManager.ApprovalTimeout()is called during the connection process on clients, but will always no-op becauseNetworkManager.PendingClientsis 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
NetworkManager.HandleApprovaltestproject)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
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