-
I try reconnect in unity, when I call private void OnLeave(int code)
{
Debug.Log($"leave: {code}");
// OnDisconnect?.Invoke(code);
// OnDelayReset();
switch (code)
{
case 1000:
case 1006:
TryReconnect();
return;
}
}
private async void TryReconnect()
{
Debug.Log($"try reconnect {backToRoomToken.Token} {backToRoomToken.RoomId}");
_room = await _client.Reconnect<RoomState>(backToRoomToken);
Debug.Log(_room);
} // When a client leaves the room
async onLeave (client, consented) {
console.log("leave", client.sessionId, consented)
if (this.PK) {
this.dispatcher.dispatch(new OnAnchorLeaveCommand(), {client, consented});
}else {
try {
if (!consented) {
// allow disconnected client to reconnect into this room until 20 seconds
console.log(client, "wait come back")
await this.allowReconnection(client, 20);
}
} catch (e) {
console.log(e)
}
}
} but there is an error "seat reservation expired." , What should I do? |
Beta Was this translation helpful? Give feedback.
Answered by
endel
Sep 10, 2023
Replies: 1 comment 3 replies
-
Hi @kelvinlee, which version of the SDK are you in? We had a fix for a reconnection bug recently in Jun 9 colyseus/colyseus-unity-sdk@2aa5c14 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right, replacing the SDK to the latest version (0.15.4) should fix this, then! Let me know if that works for you.