]> git.cworth.org Git - empires-server/commitdiff
Fix JSON stringification of game-state at game reset
authorCarl Worth <cworth@cworth.org>
Sat, 27 Jun 2020 21:55:46 +0000 (14:55 -0700)
committerCarl Worth <cworth@cworth.org>
Sat, 27 Jun 2020 21:55:46 +0000 (14:55 -0700)
The initial stream of game state upon player connection was already
careful to use a subsitute function for correct stringification of
Set objects, but the streaming at game reset was not.

I didn't notice this for a while because the client always reset its
own state data before applying what was streamed from the server. The
application of the server-provided state would fail, (encountering an
empty object instead of an empty array), but since the client state
was already reset anyway, that wasn't noticed, (as long as the failure
only happened after the prompt data, for example).

I uncovered the bug with a recent client fix to not display the
category-input form until the game-state was received, (and the
Boolean to trigger that display happened only after the portions of
the game state that were failing due to the bug described above).


No differences found