Have room module ignore when the user herself logs in
This commit is contained in:
parent
96424bfa2e
commit
0c285c47bb
1 changed files with 7 additions and 5 deletions
|
@ -47,12 +47,14 @@ function Room(modules) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function enter(key, name) {
|
function enter(key, name) {
|
||||||
|
if(!modules.session.is(key)) {
|
||||||
name = name || "anon";
|
name = name || "anon";
|
||||||
var player = new Player(key, name);
|
var player = new Player(key, name);
|
||||||
players[key] = player;
|
players[key] = player;
|
||||||
player.position = modules.fun.insert(key, sortedKeys, compareKeysByLogin);
|
player.position = modules.fun.insert(key, sortedKeys, compareKeysByLogin);
|
||||||
sortedKeys.splice(player.position, 0, key);
|
sortedKeys.splice(player.position, 0, key);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function populate(o) {
|
function populate(o) {
|
||||||
for(var key in o.room) {
|
for(var key in o.room) {
|
||||||
|
|
Loading…
Reference in a new issue