mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
More draft stability (#9718)
This commit is contained in:
parent
3a036fe52a
commit
0627dc4640
3 changed files with 20 additions and 4 deletions
|
|
@ -8,6 +8,7 @@ import mage.game.events.*;
|
|||
import mage.game.events.TableEvent.EventType;
|
||||
import mage.players.Player;
|
||||
import mage.players.PlayerList;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
|
@ -20,6 +21,8 @@ import java.util.concurrent.TimeUnit;
|
|||
*/
|
||||
public abstract class DraftImpl implements Draft {
|
||||
|
||||
protected static final Logger logger = Logger.getLogger(DraftImpl.class);
|
||||
|
||||
protected final UUID id;
|
||||
protected final Map<UUID, DraftPlayer> players = new LinkedHashMap<>();
|
||||
protected final PlayerList table = new PlayerList();
|
||||
|
|
@ -225,7 +228,7 @@ public abstract class DraftImpl implements Draft {
|
|||
synchronized (this) {
|
||||
while (!donePicking()) {
|
||||
try {
|
||||
this.wait();
|
||||
this.wait(10000); // checked every 10s to make sure the draft moves on
|
||||
} catch (InterruptedException ex) {
|
||||
}
|
||||
}
|
||||
|
|
@ -245,6 +248,7 @@ public abstract class DraftImpl implements Draft {
|
|||
boosterLoadingCounter++;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.fatal("Fatal boosterLoadingHandle error in draft " + id + " pack " + boosterNum + " pick " + cardNum, ex);
|
||||
}
|
||||
}, 0, BOOSTER_LOADING_INTERVAL, TimeUnit.SECONDS);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue