+ case "askchallenge":
+ // Send my current live challenge
+ const cIdx = this.challenges
+ .findIndex(c => c.from.sid == this.st.user.sid && c.liveGame);
+ if (cIdx >= 0)
+ {
+ const c = this.challenges[cIdx];
+ const myChallenge =
+ {
+ // Minimal challenge informations: (from not required)
+ to: c.to,
+ fen: c.fen,
+ vid: c.vid,
+ timeControl: c.timeControl
+ };
+ this.st.conn.send(JSON.stringify({code:"challenge",
+ challenge:myChallenge, target:data.from})
+ }
+ break;
+ case "askgame":
+ // TODO: Send my current live game (if any): variant, players, movesCount
+ break;