+ case "askchallenges":
+ // Send my current challenges
+ const myChallenges = this.challenges
+ .filter(c => c.from.sid == this.st.user.sid)
+ .map(c => {
+ // Minimal challenge informations: (from not required)
+ to: c.to,
+ fen: c.fen,
+ vid: c.vid,
+ timeControl: c.timeControl
+ });
+ if (myChallenges.length > 0)
+ {
+ this.st.conn.send(JSON.stringify({code:"challenges",
+ challenges:myChallenges, target:data.from})
+ }
+ break;
+ case "askgame":
+ // TODO: Send my current live game (if any)
+ break;