Have room module ignore when the user herself logs in

This commit is contained in:
Tissevert 2019-12-21 23:07:19 +01:00
parent 96424bfa2e
commit 0c285c47bb

View file

@ -47,11 +47,13 @@ function Room(modules) {
} }
function enter(key, name) { function enter(key, name) {
name = name || "anon"; if(!modules.session.is(key)) {
var player = new Player(key, name); name = name || "anon";
players[key] = player; var player = new Player(key, name);
player.position = modules.fun.insert(key, sortedKeys, compareKeysByLogin); players[key] = player;
sortedKeys.splice(player.position, 0, key); player.position = modules.fun.insert(key, sortedKeys, compareKeysByLogin);
sortedKeys.splice(player.position, 0, key);
}
} }
function populate(o) { function populate(o) {