]> git.cworth.org Git - lmno-server/commit
Mark players as active:false when they drop all connections
authorCarl Worth <cworth@cworth.org>
Thu, 25 Jun 2020 01:29:45 +0000 (18:29 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 26 Jun 2020 14:37:59 +0000 (07:37 -0700)
commit443a21300369b2bfe01a6e62eaad91953541d9d8
treed3a8c42fb9d0b700b076d862c3889430a9fb624b
parent13553d82c4746db09ce801421f0e9a5efcc300bb
Mark players as active:false when they drop all connections

Prior to this commit, the intent had been to delete players entirely
when they had no remaining connections. But this code was broken for
the same reason as the bug fixed in the previous commit (filter
returns a new array).

But instead of fixing that bug, here we're actually changing the
semantics so that once a player has so remaining connections they are
simply marked as active:false. This is still broadcast out to all
active players as a "player-exit" event but it means the server is
holding onto the data so that a player can reclaim their spot (and
their score) by rejoining later.
game.js