Moved the creation of games and broadcasting outside of tournament lock to prevent theoretical deadlocks. These actions are now made through a list of actions returned from tournament advance method.

This commit is contained in:
MarcinSc
2024-08-28 11:58:42 +07:00
parent d433c4d859
commit ecf5e097fd

View File

@@ -308,7 +308,7 @@ public class DefaultTournament implements Tournament {
}
}
if (_tournamentStage == Stage.DECK_BUILDING) {
if (_deckBuildStartTime + DeckBuildTime > System.currentTimeMillis()
if (_deckBuildStartTime + DeckBuildTime < System.currentTimeMillis()
|| _playerDecks.size() == _players.size()) {
_tournamentStage = Stage.PLAYING_GAMES;
_tournamentService.updateTournamentStage(_tournamentId, _tournamentStage);