X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=fe18941366032ce9766715284798a17204d24c5b;hb=4ac41c44a18777ad3003abf0c51955f81e5e9f0a;hp=c91e1270c1f0e8e4858e47f738a47c5cbb72778c;hpb=b2273c1bfd09e4ecf5e123cfa2eef2fa60838399;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index c91e1270..fe189413 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -315,20 +315,24 @@ export default { // Automatic challenge sending, for tournaments this.loadNewchallVariant( () => { - this.newchallenge = { - fen: "", - vid: - this.st.variants - .find(v => v.name == this.$route.query["variant"]) - .id, - to: this.$route.query["challenge"], - color: this.$route.query["color"] || '', - cadence: this.$route.query["cadence"], - // Tournament: no randomness (TODO: for now at least) - randomness: 0, - memorize: false - }; - this.issueNewChallenge(); + this.newchallenge = Object.assign( + this.newchallenge, + { + fen: "", + vid: + this.st.variants + .find(v => v.name == this.$route.query["variant"]) + .id, + to: this.$route.query["challenge"], + color: this.$route.query["color"] || '', + cadence: this.$route.query["cadence"], + // Tournament: no randomness (TODO: for now at least) + randomness: 0, + memorize: false + } + ); + window.doClick("modalNewgame"); + //this.issueNewChallenge(); //NOTE: doesn't work yet. }, this.$route.query["variant"] ); @@ -1130,7 +1134,9 @@ export default { this.challenges.splice(challToDelIdx, 1); } this.send("newchallenge", { - data: Object.assign({ from: this.st.user.sid }, chall) + data: Object.assign( + // Temporarily add sender infos to display challenge on Discord. + { from: this.st.user.sid, sender: this.st.user.name }, chall) }); // Add new challenge: chall.from = { @@ -1305,6 +1311,7 @@ export default { // on game just after, the main Hall will be notified. }; if (c.type == "live") { + // TODO: ask my IP + opp IP, to add to game infos? (potential bans) notifyNewgame(); this.startNewGame(gameInfo); // Increment game stats counter in DB