]> git.cworth.org Git - lmno.games/commit
Add handling for a spectators list in addition to the players list
authorCarl Worth <cworth@cworth.org>
Sun, 24 May 2020 15:27:09 +0000 (08:27 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 24 May 2020 15:27:09 +0000 (08:27 -0700)
commit5bcc934af2effc02ea873e847bf564bbc6b61125
tree727f7450ae0ac7e5c8d32b5b5fc42b6140cbb121
parent53c003049ece892e3f648675b897b6cea8f4dc8b
Add handling for a spectators list in addition to the players list

The model is that when people initially join the game, (providing a
name for themselves), they are a spectator. They then move from the
spectator list to the player list when then they choose a character
name.

The server isn't very clever about this. It has distinct endpoints for
adding/removing players and adding/removing spectators. So in this
code we have to explicitly remove ourselves as a spectator when we add
ourselves as a player.
empires/game.css
empires/game.js