X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=2d085c87c9b5426aed244a505a52485ce1c63980;hb=656b187886e5187e52fafe44b7dc0fb45ccd9222;hp=984a66bff76c7fd8ecc65e92a2205fefe82847ae;hpb=dc284d90d4f9228fc99e0b39394cbfded23657e5;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 984a66bf..2d085c87 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -8,6 +8,7 @@ h3#abortBoxTitle.section {{ st.tr["Terminate game?"] }} button(@click="abortGame") {{ st.tr["Sorry I have to go"] }} button(@click="abortGame") {{ st.tr["Game seems over"] }} + button(@click="abortGame") {{ st.tr["Opponent is gone"] }} BaseGame(:game="game" :vr="vr" ref="basegame" @newmove="processMove" @gameover="gameOver") div Names: {{ game.players[0].name }} - {{ game.players[1].name }} @@ -189,7 +190,7 @@ export default { { // Minimal game informations: id: this.game.id, - players: this.game.players.map(p => p.name), + players: this.game.players.map(p => { return {name:p.name}; }), vid: this.game.vid, timeControl: this.game.timeControl, }; @@ -512,7 +513,11 @@ export default { gameOver: function(score) { this.game.mode = "analyze"; this.game.score = score; - GameStorage.update(this.gameRef.id, { score: score }); + const myIdx = this.game.players.findIndex(p => { + return p.sid == this.st.user.sid || p.uid == this.st.user.id; + }); + if (myIdx >= 0) //OK, I play in this game + GameStorage.update(this.gameRef.id, { score: score }); }, }, };