]> git.cworth.org Git - lmno-server/commitdiff
Fix bug when a player reclaims a previous player object by name
authorCarl Worth <cworth@cworth.org>
Tue, 30 Jun 2020 00:01:29 +0000 (17:01 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 6 Jul 2020 01:43:58 +0000 (18:43 -0700)
Previously, we were forgetting to update the session ID map, leading
to an experience where the player couldn't submit any words,
etc. (Sorry, David!).

game.js

diff --git a/game.js b/game.js
index 55145bbaee018b89d37aff24c2c617f907fc1636..fa290681f2fc85117500a0c883683c9fb230ead7 100644 (file)
--- a/game.js
+++ b/game.js
@@ -184,6 +184,7 @@ class Game {
         this.broadcast_event("player-enter", existing.info_json());
       }
       existing.add_connection(connection);
+      this.players_by_session[session.id] = existing;
       return existing;
     }