add: tictactoe: security fix

This commit is contained in:
Namonay
2024-05-07 15:55:13 +02:00
parent e46d266b5b
commit ce6f00e835
2 changed files with 9 additions and 6 deletions

View File

@ -55,6 +55,7 @@ class TicTacToe
case 'game_move':
if (messageData.targetMorpion === undefined || messageData.targetCase === undefined)
return ;
this.map[messageData.targetMorpion][messageData.targetCase] = (this.sign == "x") ? 1 : 0;
this.printSign(messageData.targetMorpion, messageData.targetCase, (this.sign == "x") ? "o" : "x");
this.setOutline(this.currentMorpion, false);
@ -154,6 +155,7 @@ class TicTacToe
return -1
}
}
onClick(event, morpion)
{
let x = event.offsetX;