X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=ac2e26ecf8c8f6e68f13ca9ae28703b4f7e639f0;hp=4cb46ec98311a91547014276d5176b5819596e14;hb=584f81b93154313a3856112400b7df98e0eb2632;hpb=da37e2b8639a5c2fa8f10d7a94acb90a7b358647 diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 4cb46ec9..ac2e26ec 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -685,7 +685,7 @@ export default { const game = data.data; // Ignore games where I play (will go in MyGames page) if (game.players.every(p => - p.sid != this.st.user.sid || p.id != this.st.user.id)) + p.sid != this.st.user.sid || p.uid != this.st.user.id)) { let locGame = this.games.find(g => g.id == game.id); if (!locGame) { @@ -948,6 +948,16 @@ export default { }, // NOTE: when launching game, the challenge is already being deleted launchGame: function(c) { + let players = + !!c.mycolor + ? (c.mycolor == "w" ? [c.seat, c.from] : [c.from, c.seat]) + : shuffle([c.from, c.seat]); + // Convention for players IDs in stored games is 'uid' + players.forEach(p => { + let pWithUid = p; + pWithUid["uid"] = p.id; + delete pWithUid["id"]; + }); // These game informations will be shared let gameInfo = { id: getRandString(),