Giter Site home page Giter Site logo

Comments (4)

shakty avatar shakty commented on June 11, 2024

That is strictly correct, however I still don't see the practical difference. It is always the case that the number of connected player is larger than group size if the number of players to dispatch is larger than group size AND a dispatch is happening (see line 1340). Am I missing something?

from nodegame.

TVGG avatar TVGG commented on June 11, 2024

Here is some clarification. The initial post has been edited to better reflect the issue.

Line 1340:
This code runs when game are dispatched and not enough players are connected to fill them. It logs a message

Line 1350:
This code runs when we need to dispatch more than 1 game.

Line 1404:
This code runs when game are dispatched and more players are connect then the amount needed to fill them.

The problem with line 1350:

  • If GROUP_SIZE = 2 and POOL_SIZE = 3 in waitingroom.settings.js, nPlayers will probably equal 3 when games are dispatch.
  • This means that numberOfGames = 1 and groupSize = 2.
  • On line 1338 nPlayersToDispatch is set to 2.
  • On line 1350 no sorting will occur because nPlayersToDispatch equals groupSize.
  • Line 1404 runs anyways.

The DOC makes it seem like sorting would happen on line 1404. It says that sorting should occur when nPlayers > groupSize.

from nodegame.

shakty avatar shakty commented on June 11, 2024

Thanks for the clarification, it makes sense now. I feel the documentation is correct, but the code isn't, so I am marking it as a bug.

The fix should be changing line 1350 this way:

// Old line
// if (nPlayersToDispatch > groupSize) {
// New line
if (nPlayers > groupSize) {

Am I right? If so, do you want to make a Pull Request and become a contributor?

from nodegame.

shakty avatar shakty commented on June 11, 2024

Fixed in v7

from nodegame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.