- // Only ask game / challenges if first connexion:
- if (!this.people[data.from]) {
- this.people[data.from] = { pages: [{ path: page, focus: true }] };
- if (data.code == "connect")
- this.send("askchallenges", { target: data.from });
- // Ask game only if live:
- else if (!page.match(/\/[0-9]+$/))
- this.send("askgame", { target: data.from, page: page });
- } else {
- // Append page if not already in list
- if (!(this.people[data.from].pages.find(p => p.path == page)))
- this.people[data.from].pages.push({ path: page, focus: true });
+ if (data.code == "connect") {
+ // Ask challenges only on first connexion:
+ if (!this.people[data.from[0]])
+ this.send("askchallenges", { target: data.from[0] });
+ }
+ // Ask game only if live:
+ else if (!page.match(/\/[0-9]+$/))
+ this.send("askgame", { target: data.from[0], page: page });
+ if (!this.people[data.from[0]]) {
+ this.$set(
+ this.people,
+ data.from[0],
+ {
+ tmpIds: {
+ [data.from[1]]: { page: page, focus: true }
+ }
+ }
+ );
+ // For self multi-connects tests:
+ this.newConnect[data.from[0]] = true;
+ this.send("askidentity", { target: data.from[0], page: page });