question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: Improve match-making routine

See original GitHub issue

I’d like to propose a change in the API, to allow restructuring of the match-making process, and avoid unexpected issues during its process.

The proposed API here is not final. I’d love to hear your thoughts about it!

Current behaviour

Currently, the match-making process may cause unexpected issues due to async rooms being disposed in the middle of the process, like https://github.com/gamestdio/colyseus/issues/174

On the client-side, the room instance is immediately created even though the room might not be successfully created.

const room = client.join("my_room", { /* options */ });
room.onJoin.add(() => console.log("joined successfully!"))
room.onError.add(() => console.log("room couldn't be created?"))
  • This API can be confusing since both room creation errors, and regular room errors are dispatched into the same handler, without a differentiation between them.
  • It’s not possible to determine whether a join error was caused by wrong credentials (onAuth) or a bug in the server.

Desired behaviour

The server can make extra-checks during the match-making process to avoid this error (https://github.com/gamestdio/colyseus/issues/174), and provide better error handling in the client-side.

client.matchmake("my_room", {/* options */}, (err, room) => {
  if (err) { 
    console.log("match-making error: couldn't join into 'my_room'");
    console.log("reason:", err)
    return;
  }

  room.onJoin.add(() => console.log("joined successfully!"));
  room.onError.add(() => console.log("only room errors here"));
});

Version 1.0.0

As this is a big change in the API, I’m planning to have this on version 1.0.0.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:21 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
seiyriacommented, Aug 16, 2018

Anything to fix #174 sounds great to me! If the matchmake function can resolve this, I’m fine with it.

2reactions
oyedcommented, Oct 17, 2018

@seiyria I’m not entirely sure you’re in the minority - Colyseus is a netcode lib, not a matchmaking lib - attempting to do “too much” could easily take away what Colyseus is, a netcode lib. It would be nice to optionally have a built-in, simplistic, non-scalable matchmaking service like we currently do, however for the future, supporting something like mentioned in #179 would really benefit the library and allow @endel to focus on more important things.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Choose One Proposal: What Indian Matchmaker Has to Teach ...
Ask tons of questions. “Simauntie,” as her clients referred to her, meets with families and gathers information about what they're looking for in...
Read more >
Proposal matchmaking session Culture & Creativity
This session aims to support all the living labs members to start drafting together a set of ideas by looking at several Horizon...
Read more >
A Simple Fix for a Better Marriage Proposal - Scribd
A Simple Fix for a Better Marriage Proposal - Read online for free. ... Tatiana Caicedo's job is to help people plan their...
Read more >
Meta Discovery and Role Based Matchmaking - FLEX
The research presented here proposes a model which utilises the. META of the game and allocates players based on their role preference. This ......
Read more >
Dating & Matchmaking Business Plan [Sample Template for ...
Are you about starting a dating & matchmaking company? If YES, here is a detailed sample matchmaking business plan template & FREE feasibility...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found