DarkRift icon indicating copy to clipboard operation
DarkRift copied to clipboard

Client ID sometimes assigned after ConnectionState is set to Connected

Open Shii2 opened this issue 3 years ago • 0 comments

Quick Description

Client ID sometimes assigned after ConnectionState is set to Connected that in rare cases can cause getting wrong ID.

Explanation

DarkRift should assign client ID before setting ConnectionState to Connected to prevent this issue.

For example if I connecting to server using ConnectInBackground method and somewhere in code I have coroutine waiting for connection like this: while (_unityClient.ConnectionState != ConnectionState.Connected) yield return null; In rare case if I try to get _unityClient.ID right after while loop ID might be wrong (still 0, not assigned)

Shii2 avatar Sep 30 '21 07:09 Shii2