X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=game.js;h=f244eaa32ef7901c1f5eb484ec3626906408334f;hb=674a3db4a23ee236f08bf3997a1c4fb939e78724;hp=8ea26e34084d140a84d51454cfdaf2c58846bba6;hpb=ca261367bfa9dbb281a09547548c6695df91bb86;p=lmno-server diff --git a/game.js b/game.js index 8ea26e3..f244eaa 100644 --- a/game.js +++ b/game.js @@ -166,6 +166,15 @@ class Game { const existing = this.players_by_session[session.id]; if (existing) { existing.add_connection(connection); + if (! existing.active) { + /* If we're re-activating a previously idled player, then we + * need to alert everyone that this player is now back. + */ + existing.active = true; + this.active_players++; + const player_data = JSON.stringify({ id: existing.id, name: existing.name }); + this.broadcast_event("player-enter", player_data); + } return existing; }