Le multijoueur fonctionne enfin. Mise à jour des scores. Et de la partie.
This commit is contained in:
@@ -240,9 +240,9 @@ export class GameSession {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
id: this.id,
|
||||
scoreLeft: gc.scoreLeft,
|
||||
scoreRight: gc.scoreRight,
|
||||
gameServerIdOfTheMatch: this.id,
|
||||
playerOneUsernameResult: gc.scoreLeft,
|
||||
playerTwoUsernameResult: gc.scoreRight,
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ function privateMatchmaking(player: ClientPlayer)
|
||||
const maxPlayersNumber = 2;
|
||||
privateMatchmakingMap.set(player.id, player);
|
||||
const matchOptions = player.matchOptions;
|
||||
|
||||
console.log(player)
|
||||
const token = player.token;
|
||||
const compatiblePlayers: ClientPlayer[] = [];
|
||||
for (const [id, client] of privateMatchmakingMap)
|
||||
@@ -254,6 +254,8 @@ async function playerReadyConfirmationListener(this: WebSocket, data: string)
|
||||
gameOptions: gameSession.matchOptions,
|
||||
playerOneUsername: (<ClientPlayer>gameSessionPlayersIterator.next().value).username,
|
||||
playerTwoUsername: (<ClientPlayer>gameSessionPlayersIterator.next().value).username,
|
||||
playerOneUsernameResult : 0,
|
||||
playerTwoUsernameResult : 0
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user