span.name(:class="{connected: isConnected(1)}")
| {{ game.players[1].name || "@nonymous" }}
span.time(v-if="game.score=='*'") {{ virtualClocks[1] }}
- BaseGame(:game="game" :vr="vr" ref="basegame"
- @newmove="processMove" @gameover="gameOver")
+ BaseGame(:game="game" :vr="vr" @newmove="processMove" @gameover="gameOver")
</template>
<script>
this.drawOffer = "received";
break;
case "newchat":
- {
- const chat = data.data;
- this.newChat = chat;
+ this.newChat = data.data;
if (!document.getElementById("modalChat").checked)
document.getElementById("chatBtn").style.backgroundColor = "#c5fefe";
break;
- }
}
},
socketCloseListener: function() {
GameStorage.get(this.gameRef.id, afterRetrieval);
}
},
- // Post-process a move (which was just played)
+ // Post-process a move (which was just played in BaseGame)
processMove: function(move) {
+ if (this.game.type == "corr" && move.color == this.game.mycolor)
+ {
+ if (!confirm(this.st.tr["Move played:"] + " " + move.notation + "\n" + this.st.tr["Are you sure?"]))
+ return this.$set(this.game, "moveToUndo", move);
+ }
// Update storage (corr or live) if I play in the game
const colorIdx = ["w","b"].indexOf(move.color);
const nextIdx = ["w","b"].indexOf(this.vr.turn);
{
GameStorage.update(this.gameRef.id,
{score: score, scoreMsg: scoreMsg});
+ // Notify the score to main Hall. TODO: only one player (currently double send)
+ this.send("result", {gid:this.game.id, score:score});
}
},
},
color: grey
font-style: italic
+#playersInfo > p
+ margin: 0
+
@media screen and (min-width: 768px)
#actions
width: 300px
#actions
display: inline-block
- margin-top: 10px
+ margin: 0
button
display: inline-block
margin: 0