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
|
@Override
|
||||||
public void advanceDraft(TournamentCallback draftCallback) {
|
public void advanceDraft() {
|
||||||
if (haveAllPlayersPicked()) {
|
if (haveAllPlayersPicked()) {
|
||||||
if (haveAllCardsBeenChosen()) {
|
if (haveAllCardsBeenChosen()) {
|
||||||
if (haveMorePacks()) {
|
if (haveMorePacks()) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import com.gempukku.lotro.game.CardCollection;
|
|||||||
import com.gempukku.lotro.tournament.TournamentCallback;
|
import com.gempukku.lotro.tournament.TournamentCallback;
|
||||||
|
|
||||||
public interface Draft {
|
public interface Draft {
|
||||||
public void advanceDraft(TournamentCallback draftCallback);
|
public void advanceDraft();
|
||||||
|
|
||||||
public void playerChosenCard(String playerName, String cardId);
|
public void playerChosenCard(String playerName, String cardId);
|
||||||
|
|
||||||
|
|||||||
@@ -297,8 +297,7 @@ public class DefaultTournament implements Tournament {
|
|||||||
List<TournamentProcessAction> result = new LinkedList<>();
|
List<TournamentProcessAction> result = new LinkedList<>();
|
||||||
if (_nextTask == null) {
|
if (_nextTask == null) {
|
||||||
if (_tournamentStage == Stage.DRAFT) {
|
if (_tournamentStage == Stage.DRAFT) {
|
||||||
// Temporary - don't want to involve draft in this
|
_draft.advanceDraft();
|
||||||
_draft.advanceDraft(null);
|
|
||||||
if (_draft.isFinished()) {
|
if (_draft.isFinished()) {
|
||||||
result.add(new BroadcastAction("Drafting in tournament " + _tournamentName + " is finished, starting deck building"));
|
result.add(new BroadcastAction("Drafting in tournament " + _tournamentName + " is finished, starting deck building"));
|
||||||
_tournamentStage = Stage.DECK_BUILDING;
|
_tournamentStage = Stage.DECK_BUILDING;
|
||||||
|
|||||||
Reference in New Issue
Block a user