- // Delete corresponding challenge:
- ArrayFun.remove(this.challenges, c => c.id == data.cid);
- // New game just started: data contain all informations
- this.startNewGame(data.gameInfo);
- break;
- }
-// * - receive "accept/cancel challenge": apply action to challenges list
- // NOTE: challenge "socket" actions accept+withdraw only for live challenges
- case "acceptchallenge":
- {
- // Someone accept an open (or targeted) challenge
- const cIdx = this.challenges.findIndex(c => c.id == data.cid);
- let c = this.challenges[cIdx];
- const pIdx = this.people.findIndex(p => p.sid == data.from);
- c.seat = this.people[pIdx];
- this.launchGame(c);
+ // TODO: next line required ?!
+ //ArrayFun.remove(this.challenges, c => c.id == data.cid);
+ // New game just started: data contain all information
+ if (this.classifyObject(data.gameInfo) == "live")
+ this.startNewGame(data.gameInfo);
+ else
+ {
+ // TODO: notify with game link but do not redirect
+ }