Tournament Admin can now manually add Solo Draft Tournaments
This commit is contained in:
@@ -917,6 +917,10 @@ public class AdminRequestHandler extends LotroServerRequestHandler implements Ur
|
||||
String turnInDurationStr = getFormParameterSafely(postDecoder, "turnInDuration");
|
||||
String sealedFormatCodeStr = getFormParameterSafely(postDecoder, "sealedFormatCode");
|
||||
|
||||
String soloDraftDeckbuildingDurationStr = getFormParameterSafely(postDecoder, "soloDraftDeckbuildingDuration");
|
||||
String soloDraftTurnInDurationStr = getFormParameterSafely(postDecoder, "soloDraftTurnInDuration");
|
||||
String soloDraftFormatCodeStr = getFormParameterSafely(postDecoder, "soloDraftFormatCode");
|
||||
|
||||
String wcStr = getFormParameterSafely(postDecoder, "wc");
|
||||
String tournamentId = getFormParameterSafely(postDecoder, "tournamentId");
|
||||
String formatStr = getFormParameterSafely(postDecoder, "formatCode");
|
||||
@@ -985,6 +989,21 @@ public class AdminRequestHandler extends LotroServerRequestHandler implements Ur
|
||||
sealedParams.requiresDeck = false;
|
||||
params = sealedParams;
|
||||
}
|
||||
else if (type == Tournament.TournamentType.SOLODRAFT) {
|
||||
var soloDraftParams = new SoloDraftTournamentParams();
|
||||
soloDraftParams.type = Tournament.TournamentType.SOLODRAFT;
|
||||
|
||||
soloDraftParams.deckbuildingDuration = Throw400IfNullOrNonInteger("soloDraftDeckbuildingDuration", soloDraftDeckbuildingDurationStr);
|
||||
soloDraftParams.turnInDuration = Throw400IfNullOrNonInteger("soloDraftTurnInDuration", soloDraftTurnInDurationStr);
|
||||
|
||||
Throw400IfStringNull("soloDraftFormatCode", soloDraftFormatCodeStr);
|
||||
var soloDraftFormat = _soloDraftDefinitions.getSoloDraft(soloDraftFormatCodeStr);
|
||||
Throw400IfValidationFails("soloDraftFormatCode", soloDraftFormatCodeStr,soloDraftFormat != null);
|
||||
soloDraftParams.soloDraftFormatCode = soloDraftFormatCodeStr;
|
||||
soloDraftParams.format = soloDraftFormat.getFormat();
|
||||
soloDraftParams.requiresDeck = false;
|
||||
params = soloDraftParams;
|
||||
}
|
||||
else {
|
||||
params.type = Tournament.TournamentType.CONSTRUCTED;
|
||||
var format = _formatLibrary.getFormat(formatStr);
|
||||
|
||||
@@ -155,14 +155,22 @@ $(document).ready(
|
||||
if(type === "SEALED") {
|
||||
$('.sealed-only').show();
|
||||
$('.constructed-only').hide();
|
||||
$('.solodraft-only').hide();
|
||||
}
|
||||
else if(type === "SOLODRAFT") {
|
||||
$('.sealed-only').hide();
|
||||
$('.constructed-only').hide();
|
||||
$('.solodraft-only').show();
|
||||
}
|
||||
else {
|
||||
$('.sealed-only').hide();
|
||||
$('.constructed-only').show();
|
||||
$('.solodraft-only').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('.sealed-only').hide();
|
||||
$('.solodraft-only').hide();
|
||||
$('.constructed-only').show();
|
||||
|
||||
|
||||
@@ -225,6 +233,20 @@ $(document).ready(
|
||||
}
|
||||
}
|
||||
sortOptionsByName("#sch-tourney-sealed-format");
|
||||
|
||||
for (var prop in drafts) {
|
||||
if (Object.prototype.hasOwnProperty.call(drafts, prop)) {
|
||||
//console.log(prop);
|
||||
|
||||
let code = drafts[prop].format;
|
||||
let id = drafts[prop].id;
|
||||
|
||||
var item = $("<option/>")
|
||||
.attr("value", id)
|
||||
.text(prop);
|
||||
$("#sch-tourney-solodraft-format").append(item);
|
||||
}
|
||||
}
|
||||
},
|
||||
tourneyErrorMap());
|
||||
});
|
||||
@@ -249,6 +271,10 @@ function processScheduledTournament(preview, resultdiv, callback) {
|
||||
$("#sch-tourney-sealed-format").val(),
|
||||
$("#sch-tourney-sealed-deckbuild").val(),
|
||||
$("#sch-tourney-sealed-registration").val(),
|
||||
|
||||
$("#sch-tourney-solodraft-format").val(),
|
||||
$("#sch-tourney-solodraft-deckbuild").val(),
|
||||
$("#sch-tourney-solodraft-registration").val(),
|
||||
|
||||
$("#sch-tourney-start").val(),
|
||||
$("#sch-tourney-cost").val(),
|
||||
@@ -387,6 +413,7 @@ function tourneyErrorMap(outputControl, callback=null) {
|
||||
<select id="sch-tourney-type" class="flex-fill">
|
||||
<option value="CONSTRUCTED">Constructed</option>
|
||||
<option value="SEALED">Sealed</option>
|
||||
<option value="SOLODRAFT">Solo Draft</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
@@ -410,6 +437,21 @@ function tourneyErrorMap(outputControl, callback=null) {
|
||||
<div class="label-column">Deck registration grace period (in minutes): </div>
|
||||
<input type="number" min="1" id="sch-tourney-sealed-registration" value="5" class="flex-fill">
|
||||
</div>
|
||||
|
||||
<div class="flex-horiz solodraft-only">
|
||||
<div class="label-column">Solo Draft Format: </div>
|
||||
<select id="sch-tourney-solodraft-format" name="format" class="flex-fill"></select>
|
||||
</div>
|
||||
|
||||
<div class="flex-horiz solodraft-only">
|
||||
<div class="label-column">Solo Drafting + Deckbuilding duration (in minutes): </div>
|
||||
<input type="number" min="1" id="sch-tourney-solodraft-deckbuild" value="25" class="flex-fill">
|
||||
</div>
|
||||
|
||||
<div class="flex-horiz solodraft-only">
|
||||
<div class="label-column">Deck registration grace period (in minutes): </div>
|
||||
<input type="number" min="1" id="sch-tourney-solodraft-registration" value="5" class="flex-fill">
|
||||
</div>
|
||||
|
||||
<div class="flex-horiz">
|
||||
<div class="label-column">World Championship: </div>
|
||||
|
||||
@@ -1191,6 +1191,7 @@ var GempLotrCommunication = Class.extend({
|
||||
|
||||
processScheduledTournament:function (preview, name, type, wc, tournamentId,
|
||||
formatCode, sealedFormatCode, deckbuildingDuration, turnInDuration,
|
||||
soloDraftFormatCode, soloDraftDeckbuildingDuration, soloDraftTurnInDuration,
|
||||
start, cost, playoff, tiebreaker, prizeStructure, minPlayers, manualKickoff,
|
||||
callback, errorMap) {
|
||||
$.ajax({
|
||||
@@ -1207,6 +1208,9 @@ var GempLotrCommunication = Class.extend({
|
||||
sealedFormatCode:sealedFormatCode,
|
||||
deckbuildingDuration:deckbuildingDuration,
|
||||
turnInDuration:turnInDuration,
|
||||
soloDraftFormatCode:soloDraftFormatCode,
|
||||
soloDraftDeckbuildingDuration:soloDraftDeckbuildingDuration,
|
||||
soloDraftTurnInDuration:soloDraftTurnInDuration,
|
||||
start:start,
|
||||
cost:cost,
|
||||
playoff:playoff,
|
||||
|
||||
Reference in New Issue
Block a user