- case "askgame":
- {
- // Send my current live game (if any)
- GameStorage.getCurrent((game) => {
- if (!!game)
- {
- const myGame =
- {
- // Minimal game informations:
- id: game.id,
- players: game.players.map(p => p.name),
- vid: game.vid,
- timeControl: game.timeControl,
- };
- this.st.conn.send(JSON.stringify({code:"game",
- game:myGame, target:data.from}));
- }
- });
- break;
- }