X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=ef3855927b7fea90bbe44c64d1415ae53e949226;hb=214dfe16b01836fb19291ebf209bb7035993bafe;hp=dd9cfe4bc5d694d58a8b8c69b6bde623d4fc82cd;hpb=3ca7a846ae7bc5d8f7c628417418534f3c92593a;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index dd9cfe4b..ef385592 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -128,6 +128,13 @@ Vue.component('my-game', { this.vr = new VariantRules(this.fen); this.fenStart = this.fen; } + // TODO: if I'm one of the players in game, then: + // Send ping to server (answer pong if opponent is connected) + if (true && !!this.conn) + { + this.conn.send(JSON.stringify({ + code:"ping",oppid:this.oppid,gameId:this.gameId})); + } // TODO: also handle "draw accepted" (use opponents array?) // --> must give this info also when sending lastState... // and, if all players agree then OK draw (end game ...etc)