X-Git-Url: https://git.auder.net/doc/index.css?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=8662028c909fd0117686760e7fe1e5afe9c27c47;hb=60d9063fdfcd4b7628fbc0e0fc594f083bda8761;hp=d370d66e72cb38323acf21b07f4e79d508a99264;hpb=a3ab5fdb6e9d614f55bb7ecef5887ddb7875df4b;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index d370d66e..8662028c 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -1,6 +1,10 @@ // Game logic on a variant page: 3 modes, analyze, computer or human // TODO: envoyer juste "light move", sans FEN ni notation ...etc // TODO: if I'm an observer and player(s) disconnect/reconnect, how to find me ? +// onClick :: ask full game to remote player, and register as an observer in game +// (use gameId to communicate) +// on landing on game :: if gameId not found locally, check remotely +// ==> il manque un param dans game : "remoteId" Vue.component('my-game', { // gameId: to find the game in storage (assumption: it exists) // fen: to start from a FEN without identifiers (analyze mode) @@ -31,11 +35,11 @@ Vue.component('my-game', { }; }, watch: { - fen: function(newFen) { + fen: function() { // (Security) No effect if a computer move is in progress: if (this.mode == "computer" && this.lockCompThink) return this.$emit("computer-think"); - this.newGameFromFen(newFen); + this.newGameFromFen(); }, gameId: function() { this.loadGame(); @@ -105,9 +109,12 @@ Vue.component('my-game', {