Navigation

  • Recent
  • Tags
  • Users
  • Search
  • Login
Colyseus
  • Login
  • Search
  • Recent
  • Tags
  • Users

Documentation GitHub

We're migrating to GitHub Discussions. This forum does not accept new registrations since April 6, 2023.
  1. Home
  2. finkton
F

finkton

@finkton

Chat Follow Unfollow
0
Reputation
2
Posts
796
Profile views
0
Followers
0
Following
Joined 2 Jun 2020, 23:38 Last Online 16 Jun 2020, 18:54

  • Profile
  • More
    • Continue chat with finkton
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups
finkton Follow

Posts made by finkton

RE: reconnect method does not seem to work - seat reservation expired error

@endel

I even upgraded to latest 0.13 version but still get issues

I do know the await reconnection function does fire but something after that blows up.
I am using pm2 with a reverse proxy by the way & over SSL

posted in Questions & Help • 4 Jun 2020, 02:44
reconnect method does not seem to work - seat reservation expired error

Hello there,

I am trying to implement reconnection if say a mobile device goes to sleep and can reconnect before 60 seconds is up. Here is example of the server code:

async onLeave(client: Client, consented: boolean = false) {
console.log(
"=========PLAYER LEFT THE GAME - BEFORE session connect: ",
client.sessionId
);
// flag player as disconnected
this.state.players[client.sessionId].connected = false;
console.log(
"=========PLAYER LEFT THE GAME - after session connect: ",
client.sessionId
);
try {
if (consented) {
throw new Error("consented leave");
}
// wait for his reconnection (20 seconds)
await this.allowReconnection(client, 60);
console.log("=====PLAYER IS BACK!!!!!! ", client.sessionId);
// player is back!
this.state.players[client.sessionId].connected = true;
} catch (e) {
console.log("client left game on bad term: " + client.sessionId);
this.state.removePlayer(client.sessionId);
this.disconnect();
}
}

But I always seem to get an error even if I get a console log the player is back first: (my console logs)

=====PLAYER IS BACK!!!!!! 1F79r2PHc
Error: seat reservation expired.

I am using colyseus version 0.11. The strange thing is the server knows a player reconnected and the client says joined successfully after reconnect method. It just shows that the seat reservation expired on client side & server side.

posted in Questions & Help • 2 Jun 2020, 23:39

© 2023 Endel Dreyer