X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=game.js;fp=game.js;h=34a0d13b4168868a4ed6e55d275c2139b0774dbc;hb=038e9507a47ff66398f01931f271159d4a0b2aa5;hp=24e36adbc4106db5df835ddcfcc3ea403f575988;hpb=76232144e294f384cde30933687de514fd90584a;p=lmno-server diff --git a/game.js b/game.js index 24e36ad..34a0d13 100644 --- a/game.js +++ b/game.js @@ -223,6 +223,11 @@ class Game { /* 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) {