};
const socketMessageListener = msg => {
const data = JSON.parse(msg.data);
- console.log("Receive message: " + data.code);
switch (data.code)
{
case "newgame": //opponent found
this.newGame("computer");
},
newGame: function(mode, fenInit, color, oppId, moves, continuation) {
+ //const fen = "qrbnkbrn/pppppppp/8/8/8/8/PPPPPPPP/BNNBRKRQ 1111";//fenInit || VariantRules.GenRandInitFen();
const fen = fenInit || VariantRules.GenRandInitFen();
console.log(fen); //DEBUG
this.score = "*";