X-Git-Url: https://git.cworth.org/git?p=lmno-server;a=blobdiff_plain;f=game.js;h=0023257e796c1f56e49e2fe62742c6ec1f35454b;hp=5386cd212d902b7fb5e2266b26a4c8690ef7b3d2;hb=d7b96ee0316021fa7a5e428950e2d8a9d8754582;hpb=64a0af1235ca767c27e7cbd1f5416c359f212278 diff --git a/game.js b/game.js index 5386cd2..0023257 100644 --- a/game.js +++ b/game.js @@ -165,7 +165,6 @@ class Game { /* First see if we already have a player object for this session. */ 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. @@ -174,6 +173,7 @@ class Game { this.active_players++; this.broadcast_event("player-enter", existing.info_json()); } + existing.add_connection(connection); return existing; }