]> git.cworth.org Git - lmno-server/commit
Include still-answering players when ruling on end-asnwering majority
authorCarl Worth <cworth@cworth.org>
Fri, 26 Jun 2020 14:33:04 +0000 (07:33 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 26 Jun 2020 14:33:04 +0000 (07:33 -0700)
commit1aee14be31c8cac3bd8fc089a07e9c526666edd8
treedf0150f7311fb0e5c87e8623183a6e0963e93365
parent7cfa4c75739452a6022e2266cc4d6444ef79f4a5
Include still-answering players when ruling on end-asnwering majority

The test suite exposed a logical bug here. Imagine a 10-player game
where two players have submitted and 8 are still answering. Those two
players should not have the ability to move on without the answers
from the larger set of players still waiting. But that's what the old
logic would have allowed here.

In this commit we count up all players who have already submitted
answers as well as all players who have at least indicated that they
are answering in order to decide how many we need for a majority.

Note: This does mean that if something happens, (like a major network
outage), that prevents a majority of the players from being able to
submit their answers, the game cannot proceed with the minority who
succesfully submitted. I think I'm OK with that. (If the minority
really wants to proceed in a case as dramatic as that then it would be
reasonable for them to start a new game.)

With this commit the test suite is now fully passing again, (for the
first time since the recent addition of new tests).
empathy.js