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. ahtashamabbasse
  3. Best
  • Profile
  • More
    • Continue chat with ahtashamabbasse
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

Best posts made by ahtashamabbasse

RE: onLeave timeout

@DinhNguyen and @rscata I think you both are looking for rejoin the game. Below snippet will solve your problem. For more details: Rejoin Link.

async onLeave (client, consented: boolean) {
  // flag client as inactive for other users
  this.state.players[client.sessionId].connected = false;

  try {
    if (consented) {
        throw new Error("consented leave");
    }

    // allow disconnected client to rejoin into this room until 20 seconds
    await this.allowReconnection(client, 20);

    // client returned! let's re-activate it.
    this.state.players[client.sessionId].connected = true;

  } catch (e) {

    // 20 seconds expired. let's remove the client.
    delete this.state.players[client.sessionId];
  }
}
posted in Questions & Help • 28 Mar 2019, 11:37
Could we start Colyseus app with npm package forever?

We are facing some issue while using npm package forever Trying to restart the server automatically after crash.
Below is the code.
Before
"start":"nodemon --watch '**/*.ts' --exec ts-node index.ts""
After
"start": "forever start --minUptime 1000 --spinSleepTime 10000 ./index.ts",

"scripts": {
    "start": "forever start --minUptime 1000 --spinSleepTime 10000 ./index.ts",
    "bundle-colyseus-client": "browserify ./node_modules/colyseus.js/lib/index.js -s Colyseus -o static/colyseus.js",
    "build": "npm run bundle-colyseus-client",
    "heroku-postbuild": "npm run build"
  }

Server Stop after processing file

0_1548224034861_ea265c02-00d7-47cd-ba25-d2258773e124-image.png

posted in Questions & Help • 23 Jan 2019, 06:05
RE: How to overcome requesting "locked"Timeout setting: 200ms issue

Nope, we are not using RedisPresence right now. It's happened more than 10 times.

posted in Questions & Help • 28 Feb 2019, 06:27

© 2023 Endel Dreyer