Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session expired when attempting to reconnect #166

Open
LeCommandeur opened this issue Jul 22, 2021 · 0 comments
Open

Session expired when attempting to reconnect #166

LeCommandeur opened this issue Jul 22, 2021 · 0 comments

Comments

@LeCommandeur
Copy link

Hi!

I have been trying to implement automatic reconnection with colyseus but have been unsuccessful so far.
When I disconnect one of my clients and try to reconnect the same client (basically, I close the application and relaunch it) the reconnection fails with the message "session expired: SESSION_NAME" along with the error code 4214.

The server is still running, there is still another client connected and I have added the line
await this.allowReconnection(client, 60);
in my onLeave() method. I attempt the reconnection within the 60 following seconds (usually 4 or 5 seconds after closing the app.)

When the 60 seconds have passed, the remaining client connected to the server realizes someone is missing and the app displays a special screen indicating someone left the game.

I'm pretty sure I provide the correct roomId and sessionId but the Client.Reconnect() method still throws an exception.
Any idea as to what the problem could be? Thanks in advance!

Environment:
Colyseus: 0.14.0
Nodejs: 12.18.2
Windows 10 21H1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant