From b8138127dc0bf6427b0d6fb7fd743bc51d7dc276 Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Thu, 12 Jan 2023 13:32:59 +0100 Subject: [PATCH] correction du draw pour tictactoe online --- bob_party/src/Games/Tic-Tac-Toe/tic_tac_toe_online.tsx | 5 +++-- bob_party/src/services/userServices/ISaverUser.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bob_party/src/Games/Tic-Tac-Toe/tic_tac_toe_online.tsx b/bob_party/src/Games/Tic-Tac-Toe/tic_tac_toe_online.tsx index df73a10..6a12d23 100644 --- a/bob_party/src/Games/Tic-Tac-Toe/tic_tac_toe_online.tsx +++ b/bob_party/src/Games/Tic-Tac-Toe/tic_tac_toe_online.tsx @@ -60,14 +60,15 @@ export default function TicTacToeOnline(props: { navigation: any }){ function setUpTicTacToeOnline() { if (initTic===0){ setInitTic(1); - socket.on("oppPlayTicTacToe", (rowIndex, columnIndex, turn) =>{ + socket.on("oppPlayTicTacToe", async (rowIndex, columnIndex, turn) =>{ setMap((existingMap) =>{ const updateMap = [...existingMap] updateMap[rowIndex][columnIndex]=turn; return updateMap; }); - if (!checkWinning()){ + const retour= await checkWinning(); + if(retour!=true){ checkComplete(); } if (turn==="x"){ diff --git a/bob_party/src/services/userServices/ISaverUser.ts b/bob_party/src/services/userServices/ISaverUser.ts index 515a98f..e94c23f 100644 --- a/bob_party/src/services/userServices/ISaverUser.ts +++ b/bob_party/src/services/userServices/ISaverUser.ts @@ -20,7 +20,7 @@ export default interface ISaverUser{ * updateUser methode that update a User in the data management system * u the user we want to update */ - updateUser(u:User | null): Promise; + updateUser(u:User | null): Promise; addSkinList(u: User, s:Skin): Promise;