tictactoe: Adapt to new server event type: game-state
authorCarl Worth <cworth@cworth.org>
Mon, 1 Jun 2020 17:52:19 +0000 (10:52 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 1 Jun 2020 17:52:19 +0000 (10:52 -0700)
commit0edb467eb1b8922d885ef6a756fca68c9d2d0a08
treeb7b9fa6b6c695c243c8145fa47565ce1006991d5
parent49cb71f5d7657c00ece637a6a08dcd763b113653
tictactoe: Adapt to new server event type: game-state

Previously, when a client joined a game in progress the server would
send all previous moves as "move" events (just the same as if a player
were making those moves live).

The server was recently changed to instead a single "game-state" event
in this case, (which also does contain the entire move history). So
when we receive that, we reset the game state, then replay the moves
from that history.
tictactoe/tictactoe.jsx