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:
@@ -56,7 +56,7 @@ public class DefaultDraft implements Draft {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void advanceDraft(TournamentCallback draftCallback) {
|
||||
public void advanceDraft() {
|
||||
if (haveAllPlayersPicked()) {
|
||||
if (haveAllCardsBeenChosen()) {
|
||||
if (haveMorePacks()) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user