panwauu/tac-with-bug

Bug: Server created two similar games after players passed the ready check

Closed this issue · 2 comments

image

Leichtfuss reported, that suddenly two games were running and the players were were spread over 2 rooms and were not able to play.

GameIds: 37525 and 37524

Hi Gereon,
This is a known problem which happens from time to time (#72).
I was not able to reproduce it or to find the error in the code.
I would be very happy for a second opinion!
Here is the implementation of the game creation:

export async function createGame(

Strangely, I need a auxiliary function to change the order of the players I guess:
async function createGameAux(sqlClient: pg.Pool, nPlayers: number, playerIDs: number[], teams: number, meisterVersion: boolean, coop: boolean, colors: string[]) {

Here the game is created if the last players sets the state to ready:
socket.on('waiting:readyPlayer', async (data, cb) => {

Close as stale