X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=2beb10cb64c6f5b6193b21a3277ce42aa141a5f2;hb=b9ce3d0fbe6cf8cba01912706ad578144bc9b42f;hp=1753df0d12eaf864d58ef856f01b54a377b9a2ac;hpb=4f524197ee499b58f574908c58bf50efa69dd359;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 1753df0d..2beb10cb 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -753,6 +753,8 @@ export default { // Got opponent infos about last move this.gotLastate = true; this.lastate = data.data; + if (this.lastate.movesCount - 1 > this.gotMoveIdx) + this.gotMoveIdx = this.lastate.movesCount - 1; if (this.game.rendered) // Game is rendered (Board component) this.processLastate(); @@ -760,6 +762,12 @@ export default { break; } case "newmove": { + +// DEBUG: +console.log("Receive move"); +console.log(data.data); +//moveslist not updated when receiving a move? (see in baseGame) + const movePlus = data.data; const movesCount = this.game.moves.length; if (movePlus.index > movesCount) { @@ -1054,7 +1062,7 @@ export default { let gameInfo = { id: getRandString(), //ignored if corr fen: V.GenRandInitFen(this.game.randomness), - players: this.game.players.reverse(), + players: [this.game.players[1], this.game.players[0]], vid: this.game.vid, cadence: this.game.cadence }; @@ -1265,7 +1273,7 @@ export default { this.$nextTick(() => { this.game.rendered = true; // Did lastate arrive before game was rendered? - if (this.lastate) this.processLastate(); + if (!!this.lastate) this.processLastate(); }); if (this.lastateAsked) { this.lastateAsked = false;