From 0c285c47bb96d6186fbad7282d7dbc77b74cda41 Mon Sep 17 00:00:00 2001 From: Tissevert Date: Sat, 21 Dec 2019 23:07:19 +0100 Subject: [PATCH] Have room module ignore when the user herself logs in --- www/room.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/www/room.js b/www/room.js index 76e835b..d183959 100644 --- a/www/room.js +++ b/www/room.js @@ -47,11 +47,13 @@ function Room(modules) { } function enter(key, name) { - name = name || "anon"; - var player = new Player(key, name); - players[key] = player; - player.position = modules.fun.insert(key, sortedKeys, compareKeysByLogin); - sortedKeys.splice(player.position, 0, key); + if(!modules.session.is(key)) { + name = name || "anon"; + var player = new Player(key, name); + players[key] = player; + player.position = modules.fun.insert(key, sortedKeys, compareKeysByLogin); + sortedKeys.splice(player.position, 0, key); + } } function populate(o) {