/* And the player-info event. */
response.write(`event: player-info\ndata: ${player.info_json()}\n\n`);
+ /* As well as player-enter events for all existing players. */
+ this.players.filter(p => p !== player).forEach(p => {
+ response.write(`event: player-enter\ndata: ${p.info_json()}\n\n`);
+ });
+
/* Finally, if this game class has a "state" property, stream that
* current state to the client. */
if (this.state) {