Skip to content

Client ID sometimes assigned after ConnectionState is set to Connected #123

@Shii2

Description

@Shii2

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions