]> git.cworth.org Git - empires-server/commit
Assign new players to the first team with no players
authorCarl Worth <cworth@cworth.org>
Sat, 6 Jun 2020 00:07:10 +0000 (17:07 -0700)
committerCarl Worth <cworth@cworth.org>
Sat, 6 Jun 2020 00:07:10 +0000 (17:07 -0700)
commit0149bfd84c21bd3c53e6e0e4d4eee96c50b3f232
tree10036c70ba7a09d2bb5b20b1dbe352c27ed155a8
parentc381788fa303d9ca392fc4b7b25c4d55344717da
Assign new players to the first team with no players

But only if the game has already started, (since with an unstarted
game, all players are intentionally unassigned so that any player can
go first).

If there is no team that has no players, the new player will be
unassigned, (and will instead be a spectator until they join a team).

This logic is designed so that a game in which the precise number of
people were invited to play, (most notabl, a two-player game), these
players will be automatically assigned to teams as soon as one player
makes a move, (regardless of whether the players joined the game
before or after that move).
game.js