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 12:07:04 +07:00
parent ecf5e097fd
commit ea31ff2bae
3 changed files with 3 additions and 4 deletions

View File

@@ -56,7 +56,7 @@ public class DefaultDraft implements Draft {
}
@Override
public void advanceDraft(TournamentCallback draftCallback) {
public void advanceDraft() {
if (haveAllPlayersPicked()) {
if (haveAllCardsBeenChosen()) {
if (haveMorePacks()) {

View File

@@ -6,7 +6,7 @@ import com.gempukku.lotro.game.CardCollection;
import com.gempukku.lotro.tournament.TournamentCallback;
public interface Draft {
public void advanceDraft(TournamentCallback draftCallback);
public void advanceDraft();
public void playerChosenCard(String playerName, String cardId);

View File

@@ -297,8 +297,7 @@ public class DefaultTournament implements Tournament {
List<TournamentProcessAction> result = new LinkedList<>();
if (_nextTask == null) {
if (_tournamentStage == Stage.DRAFT) {
// Temporary - don't want to involve draft in this
_draft.advanceDraft(null);
_draft.advanceDraft();
if (_draft.isFinished()) {
result.add(new BroadcastAction("Drafting in tournament " + _tournamentName + " is finished, starting deck building"));
_tournamentStage = Stage.DECK_BUILDING;