info_json() {
return JSON.stringify({
id: this.id,
+ active: this.active,
name: this.name,
team: this.team.name,
score: this.score
response.write(`event: player-info\ndata: ${player.info_json()}\n\n`);
/* As well as player-enter events for all existing, active players. */
- this.players.filter(p => p !== player && p.active).forEach(p => {
+ this.players.filter(
+ p => (p !== player
+ && (p.active || p.score))).forEach(p => {
response.write(`event: player-enter\ndata: ${p.info_json()}\n\n`);
});