- p(v-html="infoMessage")
+ p
+ span {{ st.tr["Rematch in progress:"] }}
+ a(
+ :href="'#/game/' + rematchId"
+ onClick="document.getElementById('modalInfo').checked=false"
+ )
+ | {{ "#/game/" + rematchId }}
isConnected: function(index) {
const player = this.game.players[index];
// Is it me ? In this case no need to bother with focus
isConnected: function(index) {
const player = this.game.players[index];
// Is it me ? In this case no need to bother with focus
// Still have to check for name (because of potential multi-accounts
// on same browser, although this should be rare...)
return (!this.st.user.name || this.st.user.name == player.name);
// Still have to check for name (because of potential multi-accounts
// on same browser, although this should be rare...)
return (!this.st.user.name || this.st.user.name == player.name);
const gtype = this.getGameType(game);
const tc = extractTime(game.cadence);
const myIdx = game.players.findIndex(p => {
const gtype = this.getGameType(game);
const tc = extractTime(game.cadence);
const myIdx = game.players.findIndex(p => {
});
const mycolor = [undefined, "w", "b"][myIdx + 1]; //undefined for observers
if (!game.chats) game.chats = []; //live games don't have chat history
});
const mycolor = [undefined, "w", "b"][myIdx + 1]; //undefined for observers
if (!game.chats) game.chats = []; //live games don't have chat history
- if (L >= 1) {
- const gameLastupdate = game.moves[L-1].played;
- game.initime[L % 2] = gameLastupdate;
- if (L >= 2) {
- game.clocks[L % 2] =
- tc.mainTime - (Date.now() - gameLastupdate) / 1000;
- }
- }
+ if (L >= 1) game.initime[L % 2] = game.moves[L-1].played;
+ // NOTE: game.clocks shouldn't be computed right now:
+ // job will be done in re_setClocks() called soon below.
}
// Sort chat messages from newest to oldest
game.chats.sort((c1, c2) => {
}
// Sort chat messages from newest to oldest
game.chats.sort((c1, c2) => {
// opponent sid not strictly required (or available), but easier
// at least oppsid or oppid is available anyway:
oppsid: myIdx < 0 ? undefined : game.players[1 - myIdx].sid,
// opponent sid not strictly required (or available), but easier
// at least oppsid or oppid is available anyway:
oppsid: myIdx < 0 ? undefined : game.players[1 - myIdx].sid,
this.game.scoreMsg = scoreMsg;
this.$set(this.game, "scoreMsg", scoreMsg);
const myIdx = this.game.players.findIndex(p => {
this.game.scoreMsg = scoreMsg;
this.$set(this.game, "scoreMsg", scoreMsg);
const myIdx = this.game.players.findIndex(p => {