X-Git-Url: https://git.auder.net/variants/%24%7Bvname%7D/current/git-favicon.png?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=f9bc8430b4878faf2e64a888ddb887f9acad6f54;hb=c7550017d88ff6eb32e2c76a271a7f9edc4a3bf6;hp=317185542c194b1a8be4b0072636e885f5bc9a1d;hpb=882ec6fe88ac4a536dd25eca5fd50ff3d27f7994;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 31718554..f9bc8430 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -474,10 +474,12 @@ export default { // TODO: shuffling and random filtering on server, // if the room is really crowded. Object.keys(data.sockIds).forEach(sid => { - // TODO: test sid != user.sid was already done on server if (sid != this.st.user.sid) { - this.people[sid] = { tmpIds: data.sockIds[sid] }; this.send("askidentity", { target: sid }); + this.people[sid] = { tmpIds: data.sockIds[sid] }; + } else { + // Complete my tmpIds: + Object.assign(this.people[sid].tmpIds, data.sockIds[sid]); } }); break; @@ -627,8 +629,13 @@ export default { this.send("fullgame", { data: gameToSend, target: data.from }); break; case "fullgame": - // Callback "roomInit" to poll clients only after game is loaded - this.loadVariantThenGame(data.data, this.roomInit); + if (!!data.data.empty) { + alert(this.st.tr["The game should be in another tab"]); + this.$router.go(-1); + } + else + // Callback "roomInit" to poll clients only after game is loaded + this.loadVariantThenGame(data.data, this.roomInit); break; case "asklastate": // Sending informative last state if I played a move or score != "*"