X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FComputerGame.vue;h=14c1b071f4514b9dd71760fb7517b320dc95255a;hb=e6a5a8eae62d8af13435687c81d19a20b77f1de3;hp=78f6eb49269647d5dcbf8f2313b6ca2ea6937752;hpb=63ca2b89cfe577efd168c6b2e26750cb01b66d64;p=vchess.git diff --git a/client/src/components/ComputerGame.vue b/client/src/components/ComputerGame.vue index 78f6eb49..14c1b071 100644 --- a/client/src/components/ComputerGame.vue +++ b/client/src/components/ComputerGame.vue @@ -80,12 +80,8 @@ export default { if (!!this.gameInfo.fen) this.launchGame(); }, - // dans variant.js (plutôt room.js) conn gère aussi les challenges - // et les chats dans chat.js. Puis en webRTC, repenser tout ça. methods: { - launchGame: async function() { - const vModule = await import("@/variants/" + this.gameInfo.vname + ".js"); - window.V = vModule.VariantRules; + launchGame: function() { this.compWorker.postMessage(["scripts",this.gameInfo.vname]); this.compWorker.postMessage(["init",this.gameInfo.fen]); this.vr = new V(this.gameInfo.fen); @@ -113,6 +109,8 @@ export default { this.compWorker.postMessage(["askmove"]); }, processMove: function(move) { + if (this.game.score != "*") + return; // Send the move to web worker (including his own moves) this.compWorker.postMessage(["newmove",move]); // subTurn condition for Marseille (and Avalanche) rules