add: morpion: backend disconnect

This commit is contained in:
Namonay
2024-05-01 21:29:23 +02:00
parent d0a8d12934
commit d00d2231a4
2 changed files with 10 additions and 5 deletions

View File

@ -36,18 +36,19 @@ class TicTacToe
async onReceive(messageData)
{
console.log(messageData)
switch (messageData.detail)
{
case 'x':
case 'o':
this.sign = messageData.detail;
this.turn = messageData.detail == "x";
if (this.turn && this.game.started == false)
this.setOutline(4, false);
break;
case 'game_start':
this.game.started = true;
if (this.turn)
this.setOutline(4, false);
break;
case 'game_move':