Is there any reason why ctx.currentPlayer is string "0" rather than 0.
This is due to legacy reasons when it was once thought convenient to have a string so that it can be replaced by a player name.
However, the player names shouldn't be stored as part of the game state, and they're stored in a separate metadata section now. So, we don't really have a reason to keep playerID's as strings and they should be integers instead.
@nicolodavis Is there a way for the game & board to access the playerName from lobby for ctx.currentPlayer?
Yes, use the gameMetadata prop as documented here.
@nicolodavis Using Lobby instead of the regular Client I don't have gameMetadata in Board's prop. Is this a bug or am I doing something wrong?
I see pretty much every other field from the docs.
Oh I see this is fixed in #436 but not released yet.
Most helpful comment
This is due to legacy reasons when it was once thought convenient to have a string so that it can be replaced by a player name.
However, the player names shouldn't be stored as part of the game state, and they're stored in a separate metadata section now. So, we don't really have a reason to keep playerID's as strings and they should be integers instead.