cadence: this.game.cadence
};
const notifyNewGame = () => {
- const oppsid = this.getOppsid(); //may be null
- this.send("rnewgame", { data: gameInfo, oppsid: oppsid });
+ this.send("rnewgame", { data: gameInfo });
// To main Hall if corr game:
if (this.game.type == "corr")
this.send("newgame", { data: gameInfo, page: "/" });
this.notifyMyGames("newgame", gameInfo);
};
if (this.game.type == "live") {
+ GameStorage.update(
+ this.gameRef,
+ { rematchOffer: "" }
+ );
// Increment game stats counter in DB
ajax(
"/gamestat",
}
else {
// corr game
+ this.updateCorrGame({ rematchOffer: 'n' });
ajax(
"/games",
"POST",
{
data: { gameInfo: gameInfo },
success: (response) => {
- gameInfo.id = response.gameId;
+ gameInfo.id = response.id;
notifyNewGame();
- this.$router.push("/game/" + response.gameId);
+ this.$router.push("/game/" + response.id);
}
}
);
let query =
"SELECT " +
"g.id, g.fen, g.fenStart, g.cadence, g.created, " +
- "g.white, g.black, g.score, g.scoreMsg, " +
- "g.chatReadWhite, g.chatReadBlack, " +
- "g.drawOffer, g.rematchOffer, v.name AS vname " +
+ "g.white, g.black, g.randomness, g.score, g.scoreMsg, " +
+ "g.chatReadWhite, g.chatReadBlack, g.drawOffer, " +
+ // TODO: vid and vname are redundant
+ "g.rematchOffer, v.id as vid, v.name AS vname " +
"FROM Games g " +
"JOIN Variants v " +
" ON g.vid = v.id " +