mas-bandwidth / yojimbo

A network library for client/server games written in C++
BSD 3-Clause "New" or "Revised" License
2.48k stars 244 forks source link

Fix YojimboClient state update logic #191

Closed kbirk closed 1 year ago

kbirk commented 1 year ago

When running some tests I noticed that the YojimboClient would sometimes sets its state to CLIENT_STATE_CONNECTED before the server would execute the OnServerClientConnected callback. Looking at the current logic the YojimboClient sets the state to CLIENT_STATE_CONNECTED when the netcode state is NETCODE_CLIENT_STATE_SENDING_CONNECTION_RESPONSE rather than when it is NETCODE_CLIENT_STATE_CONNECTED.

This PR fixes that.

gafferongames commented 1 year ago

Thank you