mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Added the -c (clock) flag to determine the maximum time in seconds before the sim execution calls the match a draw. (#8202)
This commit is contained in:
@@ -130,6 +130,10 @@ public class SimulateMatch {
|
||||
}
|
||||
}
|
||||
|
||||
if (params.containsKey("c")) {
|
||||
rules.setSimTimeout(Integer.parseInt(params.get("c").get(0)));
|
||||
}
|
||||
|
||||
sb.append(" - ").append(Lang.nounWithNumeral(nGames, "game")).append(" of ").append(type);
|
||||
|
||||
System.out.println(sb.toString());
|
||||
@@ -163,6 +167,7 @@ public class SimulateMatch {
|
||||
System.out.println("\tT - Type of tournament to run with all provided decks (Bracket, RoundRobin, Swiss)");
|
||||
System.out.println("\tP - Amount of players per match (used only with Tournaments, defaults to 2)");
|
||||
System.out.println("\tF - format of games, defaults to constructed");
|
||||
System.out.println("\tc - Clock flag. Set the maximum time in seconds before calling the match a draw, defaults to 120.");
|
||||
System.out.println("\tq - Quiet flag. Output just the game result, not the entire game log.");
|
||||
}
|
||||
|
||||
@@ -176,7 +181,7 @@ public class SimulateMatch {
|
||||
TimeLimitedCodeBlock.runWithTimeout(() -> {
|
||||
mc.startGame(g1);
|
||||
sw.stop();
|
||||
}, 120, TimeUnit.SECONDS);
|
||||
}, mc.getRules().getSimTimeout(), TimeUnit.SECONDS);
|
||||
} catch (TimeoutException e) {
|
||||
System.out.println("Stopping slow match as draw");
|
||||
} catch (Exception | StackOverflowError e) {
|
||||
|
||||
Reference in New Issue
Block a user