- // Send our "last state" informations to opponent(s)
- const L = this.game.moves.length;
- this.st.conn.send(JSON.stringify({
- code: "lastate",
- target: this.game.oppid,
- gameId: this.gameRef.id,
- lastMove: (L>0 ? this.game.moves[L-1] : undefined),
- score: this.game.score,
- movesCount: L,
- drawOffer: this.drawOffer,
- clocks: this.game.clocks,
- }));
+ if (this.game.type == "live") //corr games are always complete
+ {
+ // Send our "last state" informations to opponent(s)
+ const L = this.game.moves.length;
+ this.st.conn.send(JSON.stringify({
+ code: "lastate",
+ target: this.game.oppid,
+ gameId: this.gameRef.id,
+ lastMove: (L>0 ? this.game.moves[L-1] : undefined),
+ score: this.game.score,
+ movesCount: L,
+ drawOffer: this.drawOffer,
+ clocks: this.game.clocks,
+ }));
+ }