X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;fp=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=dd9cfe4bc5d694d58a8b8c69b6bde623d4fc82cd;hp=d0d8125833d607dc25ffb1efd2226e62e0721036;hb=3ca7a846ae7bc5d8f7c628417418534f3c92593a;hpb=a6403027a66411ead248aab0369bf3ee3a75d8ec diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index d0d81258..dd9cfe4b 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) @@ -308,6 +312,9 @@ Vue.component('my-game', { } }, loadGame: function() { + // TODO: ask game to remote peer if this.remoteId is set + // (or just if game not found locally) + // NOTE: if it's a corr game, ask it from server const game = getGameFromStorage(this.gameId); this.opponent.id = game.oppid; //opponent ID in case of running HH game this.opponent.name = game.oppname; //maye be blank (if anonymous)