Daily tournaments added (FotR Solo Draft and Movie Sealed); Removed redundant minPlayers parameter from RecurringScheduledQueue constructor; Fixed constructed tournaments from both queues being always single elimination; Fixed limited tournament collections names properly showing only on active tournaments, not on queues; Fixed daily constructed tournaments description error probably from copy+paste
This commit is contained in:
@@ -472,8 +472,20 @@ var GempLotrHallUI = Class.extend({
|
|||||||
"</tr>";
|
"</tr>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rowstr += "<td>" + queue.getAttribute("collection") + "</td>" +
|
var type = queue.getAttribute("type");
|
||||||
"<td>" + queue.getAttribute("queue") + "</td>" +
|
if(type !== null)
|
||||||
|
type = type.toLowerCase();
|
||||||
|
if(type === "sealed") {
|
||||||
|
rowstr += "<td>Sealed</td>";
|
||||||
|
}
|
||||||
|
else if (type === "solodraft") {
|
||||||
|
rowstr += "<td>Solo Draft</td>";
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rowstr += "<td>" + queue.getAttribute("collection") + "</td>";
|
||||||
|
}
|
||||||
|
rowstr += "<td>" + queue.getAttribute("queue") + "</td>" +
|
||||||
"<td>" + queue.getAttribute("start") + "</td>" +
|
"<td>" + queue.getAttribute("start") + "</td>" +
|
||||||
"<td>" + queue.getAttribute("system") + "</td>" +
|
"<td>" + queue.getAttribute("system") + "</td>" +
|
||||||
"<td><div class='prizeHint' title='Queued Players' value='" + queue.getAttribute("playerList") + "'>" + queue.getAttribute("playerCount") + "</div></td>" +
|
"<td><div class='prizeHint' title='Queued Players' value='" + queue.getAttribute("playerList") + "'>" + queue.getAttribute("playerCount") + "</div></td>" +
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class ImmediateRecurringQueue extends AbstractTournamentQueue implements
|
|||||||
this.format = getFormatCode();
|
this.format = getFormatCode();
|
||||||
this.startTime = DateUtils.Now().toLocalDateTime();
|
this.startTime = DateUtils.Now().toLocalDateTime();
|
||||||
this.type = Tournament.TournamentType.CONSTRUCTED;
|
this.type = Tournament.TournamentType.CONSTRUCTED;
|
||||||
this.playoff = Tournament.PairingType.SINGLE_ELIMINATION;
|
this.playoff = _tournamentInfo._params.playoff;
|
||||||
this.manualKickoff = false;
|
this.manualKickoff = false;
|
||||||
this.cost = getCost();
|
this.cost = getCost();
|
||||||
this.minimumPlayers = _playerCap;
|
this.minimumPlayers = _playerCap;
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ public class RecurringScheduledQueue extends AbstractTournamentQueue implements
|
|||||||
|
|
||||||
private final int _minimumPlayers;
|
private final int _minimumPlayers;
|
||||||
|
|
||||||
public RecurringScheduledQueue(TournamentService tournamentService, String queueId, String queueName, TournamentInfo info, Duration repeatEvery, int minPlayers) {
|
public RecurringScheduledQueue(TournamentService tournamentService, String queueId, String queueName, TournamentInfo info, Duration repeatEvery) {
|
||||||
super(tournamentService, queueId, queueName, info);
|
super(tournamentService, queueId, queueName, info);
|
||||||
_minimumPlayers = minPlayers;
|
_minimumPlayers = info._params.minimumPlayers;
|
||||||
|
|
||||||
_repeatEvery = repeatEvery;
|
_repeatEvery = repeatEvery;
|
||||||
var sinceOriginal = Duration.between(info.StartTime, ZonedDateTime.now());
|
var sinceOriginal = Duration.between(info.StartTime, ZonedDateTime.now());
|
||||||
|
|||||||
@@ -127,7 +127,59 @@ public class TournamentService {
|
|||||||
private void addRecurringScheduledQueue(String queueId, String queueName, String time, String prefix, String formatCode) {
|
private void addRecurringScheduledQueue(String queueId, String queueName, String time, String prefix, String formatCode) {
|
||||||
_tournamentQueues.put(queueId, new RecurringScheduledQueue(this, queueId, queueName,
|
_tournamentQueues.put(queueId, new RecurringScheduledQueue(this, queueId, queueName,
|
||||||
new TournamentInfo(this, _productLibrary, _formatLibrary, DateUtils.ParseStringDate(time),
|
new TournamentInfo(this, _productLibrary, _formatLibrary, DateUtils.ParseStringDate(time),
|
||||||
new TournamentParams(prefix, queueName, formatCode, 0, 4, Tournament.PairingType.SWISS_3, Tournament.PrizeType.DAILY)), _tournamentRepeatPeriod, 4));
|
new TournamentParams(prefix, queueName, formatCode, 0, 4, Tournament.PairingType.SWISS_3, Tournament.PrizeType.DAILY)), _tournamentRepeatPeriod));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addRecurringScheduledSealed(String queueId, String queueName, String time, String prefix, String formatCode) {
|
||||||
|
|
||||||
|
var sealedParams = new SealedTournamentParams();
|
||||||
|
sealedParams.type = Tournament.TournamentType.SEALED;
|
||||||
|
|
||||||
|
sealedParams.deckbuildingDuration = 25;
|
||||||
|
sealedParams.turnInDuration = 5;
|
||||||
|
|
||||||
|
var sealedFormat = _formatLibrary.GetSealedTemplate(formatCode);
|
||||||
|
sealedParams.sealedFormatCode = formatCode;
|
||||||
|
sealedParams.format = sealedFormat.GetFormat().getCode();
|
||||||
|
sealedParams.requiresDeck = false;
|
||||||
|
|
||||||
|
sealedParams.tournamentId = prefix;
|
||||||
|
sealedParams.name = queueName;
|
||||||
|
sealedParams.cost = 0;
|
||||||
|
sealedParams.minimumPlayers = 2;
|
||||||
|
sealedParams.playoff = Tournament.PairingType.SWISS_3;
|
||||||
|
sealedParams.prizes = Tournament.PrizeType.DAILY;
|
||||||
|
|
||||||
|
_tournamentQueues.put(queueId, new RecurringScheduledQueue(this, queueId, queueName,
|
||||||
|
new SealedTournamentInfo(this, _productLibrary, _formatLibrary, DateUtils.ParseStringDate(time),
|
||||||
|
sealedParams), _tournamentRepeatPeriod)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addRecurringScheduledDraft(String queueId, String queueName, String time, String prefix, String formatCode) {
|
||||||
|
|
||||||
|
var soloDraftParams = new SoloDraftTournamentParams();
|
||||||
|
soloDraftParams.type = Tournament.TournamentType.SOLODRAFT;
|
||||||
|
|
||||||
|
soloDraftParams.deckbuildingDuration = 25;
|
||||||
|
soloDraftParams.turnInDuration = 5;
|
||||||
|
|
||||||
|
var soloDraft = _soloDraftLibrary.getSoloDraft(formatCode);
|
||||||
|
soloDraftParams.soloDraftFormatCode = formatCode;
|
||||||
|
soloDraftParams.format = soloDraft.getFormat();
|
||||||
|
soloDraftParams.requiresDeck = false;
|
||||||
|
|
||||||
|
soloDraftParams.tournamentId = prefix;
|
||||||
|
soloDraftParams.name = queueName;
|
||||||
|
soloDraftParams.cost = 0;
|
||||||
|
soloDraftParams.minimumPlayers = 2;
|
||||||
|
soloDraftParams.playoff = Tournament.PairingType.SWISS_3;
|
||||||
|
soloDraftParams.prizes = Tournament.PrizeType.DAILY;
|
||||||
|
|
||||||
|
_tournamentQueues.put(queueId, new RecurringScheduledQueue(this, queueId, queueName,
|
||||||
|
new SoloDraftTournamentInfo(this, _productLibrary, _formatLibrary, DateUtils.ParseStringDate(time),
|
||||||
|
soloDraftParams, _soloDraftLibrary), _tournamentRepeatPeriod)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reloadTournaments(TableHolder tables) {
|
public void reloadTournaments(TableHolder tables) {
|
||||||
@@ -151,9 +203,15 @@ public class TournamentService {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
addRecurringScheduledQueue("fotr_daily_eu", "Daily Gondor Fellowship Block", "2013-01-15 19:30:00", "fotrDailyEu-", "fotr_block");
|
addRecurringScheduledQueue("fotr_daily_eu", "Daily Gondor Fellowship Block", "2013-01-15 19:30:00", "fotrDailyEu-", "fotr_block");
|
||||||
addRecurringScheduledQueue("fotr_daily_us", "Daily Rohan Fellowship Block", "2013-01-16 00:30:00", "fotrDailyEu-", "fotr_block");
|
addRecurringScheduledQueue("fotr_daily_us", "Daily Rohan Fellowship Block", "2013-01-16 00:30:00", "fotrDailyUS-", "fotr_block");
|
||||||
addRecurringScheduledQueue("movie_daily_eu", "Daily Gondor Movie Block", "2013-01-16 19:30:00", "fotrDailyEu-", "movie");
|
addRecurringScheduledQueue("movie_daily_eu", "Daily Gondor Movie Block", "2013-01-16 19:30:00", "movieDailyEu-", "movie");
|
||||||
addRecurringScheduledQueue("movie_daily_us", "Daily Rohan Fellowship Block", "2013-01-17 00:30:00", "fotrDailyEu-", "movie");
|
addRecurringScheduledQueue("movie_daily_us", "Daily Rohan Movie Block", "2013-01-17 00:30:00", "movieDailyUs-", "movie");
|
||||||
|
|
||||||
|
addRecurringScheduledDraft("fotr_draft_daily_eu", "Daily Gondor Fellowship Draft", "2013-01-16 19:30:00", "fotrDraftDailyEu-", "fotr_draft");
|
||||||
|
addRecurringScheduledDraft("fotr_draft_daily_us", "Daily Rohan Fellowship Draft", "2013-01-17 00:30:00", "fotrDraftDailyUS-", "fotr_draft");
|
||||||
|
|
||||||
|
addRecurringScheduledSealed("movie_sealed_daily_eu", "Daily Gondor Movie Sealed", "2013-01-15 19:30:00", "movieSealedDailyEu-", "single_movie_sealed");
|
||||||
|
addRecurringScheduledSealed("movie_sealed_daily_us", "Daily Rohan Movie Sealed", "2013-01-16 00:30:00", "movieSealedDailyUs-", "single_movie_sealed");
|
||||||
|
|
||||||
} catch (DateTimeParseException exp) {
|
} catch (DateTimeParseException exp) {
|
||||||
// Ignore, can't happen
|
// Ignore, can't happen
|
||||||
|
|||||||
Reference in New Issue
Block a user