Modified - removed separate queue and tournament sections from hall; made new sections to display info about scheduled events; the default place for queues is waiting tables, for tournaments playing tables

This commit is contained in:
jakub.salavec
2025-06-17 14:13:45 +02:00
parent 2ca0a58066
commit c5455a8385
10 changed files with 169 additions and 119 deletions

View File

@@ -185,11 +185,12 @@
<table class='tables wc-queues'> <table class='tables wc-queues'>
<tr> <tr>
<th width='10%'>Format</th> <th width='10%'>Format</th>
<th width='20%'>Event</th> <th width='8%'>Collection</th>
<th width='30%'>Event Name</th>
<th width='16%'>Starts</th> <th width='16%'>Starts</th>
<th width='10%'>System</th> <th width='16%'>System</th>
<th width='6%'>Players</th> <th width='8%'>Cost</th>
<th width='10%'>Actions</th> <th width='12%'>Prizes</th>
</tr> </tr>
</table> </table>
</div> </div>
@@ -199,34 +200,47 @@
<table class='tables wc-events'> <table class='tables wc-events'>
<tr> <tr>
<th width='10%'>Format</th> <th width='10%'>Format</th>
<th width='20%'>Event</th> <th width='8%'>Collection</th>
<th width='20%'>Event Name</th>
<th width='10%'>System</th> <th width='10%'>System</th>
<th width='16%'>Stage</th> <th width='16%'>Stage</th>
<th width='6%'>Round</th> <th width='6%'>Round</th>
<th width='6%'>Players</th> <th width='8%'>Players</th>
<th width='10%'>Actions</th>
</tr>
</table>
</div>
<div id="tournamentQueuesHeader" class='eventHeader queues'>Tournament Queues<span class='count'>(0)</span></div>
<div id="tournamentQueuesContent" class='visibilityToggle'>
<table class='tables queues'>
<tr>
<th width='10%'>Format</th>
<th width='8%'>Collection</th>
<th width='20%'>Queue name</th>
<th width='16%'>Starts</th>
<th width='10%'>System</th>
<th width='6%'>Players</th>
<th width='8%'>Cost</th>
<th width='12%'>Prizes</th>
<th width='10%'>Actions</th>
</tr> </tr>
</table> </table>
</div> </div>
<div id="queueSpawnerHeader" class='eventHeader limitedGames'>Tournaments & Limited Games</div> <div id="scheduledQueuesHeader" class='eventHeader scheduledQueues'>Scheduled Events<span class='count'>(0)</span></div>
<div id="scheduledQueuesContent" class='visibilityToggle'>
<table class='tables scheduledQueues'>
<tr>
<th width='10%'>Format</th>
<th width='8%'>Collection</th>
<th width='30%'>Event Name</th>
<th width='16%'>Starts</th>
<th width='16%'>System</th>
<th width='8%'>Cost</th>
<th width='12%'>Prizes</th>
</tr>
</table>
</div>
<div id="recurringQueuesHeader" class='eventHeader recurringQueues'>Recurring Events<span class='count'>(0)</span></div>
<div id="recurringQueuesContent" class='visibilityToggle'>
<table class='tables recurringQueues'>
<tr>
<th width='10%'>Format</th>
<th width='8%'>Collection</th>
<th width='30%'>Event Name</th>
<th width='16%'>Next Start</th>
<th width='16%'>System</th>
<th width='8%'>Cost</th>
<th width='12%'>Prizes</th>
</tr>
</table>
</div>
<div id="queueSpawnerHeader" class='eventHeader limitedGames'>Create Tournaments & Limited Games</div>
<div id="queueSpawnerContent" class='visibilityToggle'> <div id="queueSpawnerContent" class='visibilityToggle'>
<form id="queueSpawnerForm"> <form id="queueSpawnerForm">
<!-- Game Type Selection --> <!-- Game Type Selection -->

View File

@@ -126,14 +126,10 @@ var GempLotrHallUI = Class.extend({
this.initTable(hallSettings[2] == "1", "finishedTablesHeader", "finishedTablesContent"); this.initTable(hallSettings[2] == "1", "finishedTablesHeader", "finishedTablesContent");
this.initTable(hallSettings[3] == "1", "wcQueuesHeader", "wcQueuesContent"); this.initTable(hallSettings[3] == "1", "wcQueuesHeader", "wcQueuesContent");
this.initTable(hallSettings[4] == "1", "wcEventsHeader", "wcEventsContent"); this.initTable(hallSettings[4] == "1", "wcEventsHeader", "wcEventsContent");
this.initTable(hallSettings[5] == "1", "tournamentQueuesHeader", "tournamentQueuesContent"); this.initTable(hallSettings[5] == "1", "scheduledQueuesHeader", "scheduledQueuesContent");
this.initTable(hallSettings[6] == "1", "queueSpawnerHeader", "queueSpawnerContent"); this.initTable(hallSettings[6] == "1", "recurringQueuesHeader", "recurringQueuesContent");
this.initTable(hallSettings[7] == "1", "queueSpawnerHeader", "queueSpawnerContent");
$('#wcQueuesHeader').hide();
$('#wcQueuesContent').hide();
$('#wcEventsHeader').hide();
$('#wcEventsContent').hide();
$("#deckbuilder-button").button(); $("#deckbuilder-button").button();
$("#bug-button").button(); $("#bug-button").button();
$("#report-button").button(); $("#report-button").button();
@@ -543,7 +539,7 @@ var GempLotrHallUI = Class.extend({
return $(visibilityToggle[index]).hasClass("hidden") ? "0" : "1"; return $(visibilityToggle[index]).hasClass("hidden") ? "0" : "1";
}; };
var newHallSettings = getSettingValue(0) + "|" + getSettingValue(1) + "|" + getSettingValue(2) + "|" + getSettingValue(3) + "|" + getSettingValue(4)+ "|" + getSettingValue(5) + "|" + getSettingValue(6) + "|" + getSettingValue(7) + "|" + getSettingValue(8); var newHallSettings = getSettingValue(0) + "|" + getSettingValue(1) + "|" + getSettingValue(2) + "|" + getSettingValue(3) + "|" + getSettingValue(4)+ "|" + getSettingValue(5) + "|" + getSettingValue(6) + "|" + getSettingValue(7);
console.log("New settings: " + newHallSettings); console.log("New settings: " + newHallSettings);
$.cookie("hallSettings", newHallSettings, { expires:365 }); $.cookie("hallSettings", newHallSettings, { expires:365 });
}, },
@@ -755,6 +751,9 @@ var GempLotrHallUI = Class.extend({
var queue = queues[i]; var queue = queues[i];
var id = queue.getAttribute("id"); var id = queue.getAttribute("id");
var isWC = queue.getAttribute("wc") == "true"; var isWC = queue.getAttribute("wc") == "true";
var isRecurring = queue.getAttribute("recurring") == "true";
var isScheduled = queue.getAttribute("scheduled") == "true";
var displayInWaitingTables = queue.getAttribute("displayInWaitingTables") == "true";
var action = queue.getAttribute("action"); var action = queue.getAttribute("action");
if (action == "add" || action == "update") { if (action == "add" || action == "update") {
var actionsField = $("<td></td>"); var actionsField = $("<td></td>");
@@ -772,7 +771,7 @@ var GempLotrHallUI = Class.extend({
var queueId = queueInfo.getAttribute("id"); var queueId = queueInfo.getAttribute("id");
var type = queueInfo.getAttribute("type"); var type = queueInfo.getAttribute("type");
if(type !== null) if (type !== null)
type = type.toLowerCase(); type = type.toLowerCase();
var queueName = queueInfo.getAttribute("queue"); var queueName = queueInfo.getAttribute("queue");
var queueStart = queueInfo.getAttribute("start"); var queueStart = queueInfo.getAttribute("start");
@@ -788,36 +787,35 @@ var GempLotrHallUI = Class.extend({
if(type === "sealed") { if(type === "sealed") {
message = "You have signed up to participate in the <b>" + queueName message = "You have signed up to participate in the <b>" + queueName
+ "</b> tournament.<br><br>When the event begins, you will be issued sealed packs to open and make a deck. " + + "</b> tournament.<br><br>When the event begins, you will be issued sealed packs to open and make a deck. " +
"At any time during the deckbuilding phase and for a short time after it ends, you will need to lock-in your deck before the tournament begins.<br><br>" + "At any time during the deck building phase, you will need to lock-in your deck before the tournament begins.<br><br>" +
"Deckbuilding begins at " + queueStart + ". Good luck!"; "Deck building begins at " + queueStart + ". Good luck!";
} }
if(type === "solodraft") { if(type === "solodraft") {
message = "You have signed up to participate in the <b>" + queueName message = "You have signed up to participate in the <b>" + queueName
+ "</b> tournament.<br><br>When the event begins, use the 'Go to Draft' button in the Active Tournaments Section, and then build your deck in the Deck Builder. " + + "</b> tournament.<br><br>When the event begins, use the 'Go to Draft' button in the Playing Tables Section, and then build your deck in the Deck Builder. " +
"At any time during the deckbuilding phase and for a short time after it ends, you will need to lock-in your deck before the tournament begins.<br><br>" + "At any time during the deck building phase, you will need to lock-in your deck before the tournament begins.<br><br>" +
"Deckbuilding begins at " + queueStart + ". Good luck!"; "Deck building begins at " + queueStart + ". Good luck!";
} }
if(type === "table_solodraft") { if(type === "table_solodraft") {
message = "You have signed up to participate in the <b>" + queueName message = "You have signed up to participate in the <b>" + queueName
+ "</b> tournament.<br><br>When the event begins, use the 'Go to Draft' button in the Active Tournaments Section, and then build your deck in the Deck Builder. " + + "</b> tournament.<br><br>When the event begins, use the 'Go to Draft' button in the Playing Tables Section, and then build your deck in the Deck Builder. " +
"At any time during the deckbuilding phase and for a short time after it ends, you will need to lock-in your deck before the tournament begins.<br><br>" + "At any time during the deck building phase, you will need to lock-in your deck before the tournament begins.<br><br>" +
"Deckbuilding begins at " + queueStart + ". Good luck!"; "Deck building begins at " + queueStart + ". Good luck!";
} }
if(type === "table_draft") { if(type === "table_draft") {
message = "You have signed up to participate in the <b>" + queueName message = "You have signed up to participate in the <b>" + queueName
+ "</b> tournament.<br><br>When the event begins, use the 'Go to Draft' button in the Active Tournaments Section, and then build your deck in the Deck Builder. " + + "</b> tournament.<br><br>When the event begins, use the 'Go to Draft' button in the Playing Tables Section, and then build your deck in the Deck Builder. " +
"At any time during the deckbuilding phase and for a short time after it ends, you will need to lock-in your deck before the tournament begins.<br><br>" + "At any time during the deck building phase, you will need to lock-in your deck before the tournament begins.<br><br>" +
"Draft begins at " + queueStart + ". Good luck!"; "Draft begins at " + queueStart + ". Good luck!";
} }
that.showDialog("Joined Tournament", message, 320); that.showDialog("Joined Tournament", message, 320);
} }
}, that.hallErrorMap()); }, that.hallErrorMap());
}; };
} })(queue));
)(queue));
actionsField.append(but); actionsField.append(but);
} else if (joined == "true") { } else if (joined == "true") {
that.inTournament = true; that.inTournament = true;
@@ -833,8 +831,6 @@ var GempLotrHallUI = Class.extend({
if(result) { if(result) {
that.inTournament = false; that.inTournament = false;
that.showDialog("Left Tournament", "You have been removed from the <b>" + queueName
+ "</b> tournament.<br><br>If you wish to rejoin, you will need to requeue before it starts at " + queueStart + ".", 230);
} }
}); });
} }
@@ -855,10 +851,10 @@ var GempLotrHallUI = Class.extend({
actionsField.append(startBut); actionsField.append(startBut);
} }
if (+queue.getAttribute("readyCheckSecsRemaining") > -1) { if (+queue.getAttribute("readyCheckSecsRemaining") > -1) { // The '+' sign converts string to number
if ($("button:contains('READY CHECK')").length === 0 && queue.getAttribute("confirmedReadyCheck") == "false") { if ($("button:contains('READY CHECK')").length === 0 && queue.getAttribute("confirmedReadyCheck") == "false") {
that.showDialog("Ready Check", "Ready Check started for the <b>" + queue.getAttribute("queue") that.showDialog("Ready Check", "Ready Check started for the <b>" + queue.getAttribute("queue")
+ "</b> tournament.<br><br>To confirm you are present, click the Ready Check button within next " + "</b> tournament.<br><br>To confirm you are present, click the Ready Check button in the Waiting Tables Section within the next "
+ queue.getAttribute("readyCheckSecsRemaining") + " seconds.", 230); + queue.getAttribute("readyCheckSecsRemaining") + " seconds.", 230);
} }
var checkBut = $("<button>READY CHECK - " + queue.getAttribute("readyCheckSecsRemaining") + " s</button>"); var checkBut = $("<button>READY CHECK - " + queue.getAttribute("readyCheckSecsRemaining") + " s</button>");
@@ -892,44 +888,34 @@ var GempLotrHallUI = Class.extend({
else if (type === "table_draft") { else if (type === "table_draft") {
type = "Table Draft"; type = "Table Draft";
} }
else if (type === "constructed") {
type = "Constructed";
}
var rowstr = "<tr class='queue" + id + "'><td>" + queue.getAttribute("format") + "</td>"; var rowstr = "<tr class='queue" + id + "'><td>" + queue.getAttribute("format") + "</td>";
var collectionTd = "<td>" + queue.getAttribute("collection") + "</td>";
var queueNameTd = "<td>" + queue.getAttribute("queue") + "</td>";
var startTd = "<td>" + queue.getAttribute("start") + "</td>"; var startTd = "<td>" + queue.getAttribute("start") + "</td>";
var systemTd = "<td>" + queue.getAttribute("system") + "</td>"; var systemTd = "<td>" + queue.getAttribute("system") + "</td>";
var playersTd = "<td><div class='prizeHint' title='Queued Players' value='" + queue.getAttribute("playerList") + "'>" + queue.getAttribute("playerCount") + "</div></td>";
var costPrizesTds = "<td align='right'>" + formatPrice(queue.getAttribute("cost")) + "</td><td>" + queue.getAttribute("prizes") + "</td>"; var costPrizesTds = "<td align='right'>" + formatPrice(queue.getAttribute("cost")) + "</td><td>" + queue.getAttribute("prizes") + "</td>";
if (isWC) { // assumes that wc queue is always constructed if (type.includes("Sealed") || type.includes("Draft")) {
rowstr += "<td>" + queue.getAttribute("queue") + "</td>" + collectionTd = "<td>" + type + "</td>";
startTd +
systemTd +
playersTd +
"</tr>";
} else if (type.includes("Sealed") || type.includes("Draft")) {
// No prizes and cost displayed for limited games
rowstr += "<td>" + type + "</td>";
rowstr += "<td><div";
if (type.includes("Table") && queue.hasAttribute("draftCode")) {
rowstr += " class='draftFormatInfo' draftCode='"+ queue.getAttribute("draftCode") + "'";
}
rowstr += ">" + queue.getAttribute("queue") + "</div></td>" +
startTd +
systemTd +
playersTd +
costPrizesTds +
"</tr>";
} else { queueNameTd = "<td><div";
rowstr += "<td>" + queue.getAttribute("collection") + "</td>" + if (type.includes("Table") && queue.hasAttribute("draftCode")) {
"<td>" + queue.getAttribute("queue") + "</td>" + queueNameTd += " class='draftFormatInfo' draftCode='"+ queue.getAttribute("draftCode") + "'";
}
queueNameTd += ">" + queue.getAttribute("queue") + "</div></td>";
}
rowstr += collectionTd +
queueNameTd +
startTd + startTd +
systemTd + systemTd +
playersTd +
costPrizesTds + costPrizesTds +
"</tr>"; "</tr>";
}
var row = $(rowstr); var row = $(rowstr);
row.append(actionsField);
// Row for tournament queue waiting table // Row for tournament queue waiting table
var tablesRow = $("<tr class='table" + id + "'></tr>"); var tablesRow = $("<tr class='table" + id + "'></tr>");
@@ -948,28 +934,33 @@ var GempLotrHallUI = Class.extend({
tablesRow.append(htmlTd); tablesRow.append(htmlTd);
tablesRow.append("<td>" + queue.getAttribute("start") + "</td>"); tablesRow.append("<td>" + queue.getAttribute("start") + "</td>");
tablesRow.append("<td>" + queue.getAttribute("playerList") + "</td>"); tablesRow.append("<td>" + queue.getAttribute("playerList") + "</td>");
var actionsFieldClone = actionsField.clone(true); tablesRow.append(actionsField);
tablesRow.append(actionsFieldClone); if (joined == "true") {
if (joined == "true")
tablesRow.addClass("played"); tablesRow.addClass("played");
} else if (isWC) {
tablesRow.addClass("wc-events");
}
if (action == "add") { if (action == "add") {
if(isWC) { if(isWC) {
$("table.wc-queues", this.tablesDiv) $("table.wc-queues", this.tablesDiv)
.append(row); .append(row);
} else { } else if (isRecurring) {
$("table.queues", this.tablesDiv) $("table.recurringQueues", this.tablesDiv)
.append(row);
} else if (isScheduled) {
$("table.scheduledQueues", this.tablesDiv)
.append(row); .append(row);
} }
// Display queues with waiting players also as waiting tables // Display queues in waiting tables section
if (queue.getAttribute("playerCount") != 0 || isWC) { if (displayInWaitingTables) {
$("table.waitingTables", this.tablesDiv) $("table.waitingTables", this.tablesDiv)
.append(tablesRow); .append(tablesRow);
} }
} else if (action == "update") { } else if (action == "update") {
$(".queue" + id, this.tablesDiv).replaceWith(row); $(".queue" + id, this.tablesDiv).replaceWith(row);
// Display queues with waiting players also as waiting tables // Display queues with waiting players also as waiting tables
if (queue.getAttribute("playerCount") != 0) { if (displayInWaitingTables) {
var existingRow = $(".table" + id, this.tablesDiv); var existingRow = $(".table" + id, this.tablesDiv);
if (existingRow.length > 0) { if (existingRow.length > 0) {
// If the row exists, replace it // If the row exists, replace it
@@ -978,7 +969,7 @@ var GempLotrHallUI = Class.extend({
// If the row does not exist, append it // If the row does not exist, append it
$("table.waitingTables", this.tablesDiv).append(tablesRow); $("table.waitingTables", this.tablesDiv).append(tablesRow);
} }
} else if (queue.getAttribute("playerCount") == 0) { } else {
// Remove tournaments displayed as tables // Remove tournaments displayed as tables
$(".table" + id, this.tablesDiv).remove(); $(".table" + id, this.tablesDiv).remove();
} }
@@ -987,8 +978,8 @@ var GempLotrHallUI = Class.extend({
this.animateRowUpdate(".queue" + id); this.animateRowUpdate(".queue" + id);
} else if (action == "remove") { } else if (action == "remove") {
// Remove from both the Waiting Tables Section and Queue Sections
$(".queue" + id, this.tablesDiv).remove(); $(".queue" + id, this.tablesDiv).remove();
// Remove tournaments displayed as tables
$(".table" + id, this.tablesDiv).remove(); $(".table" + id, this.tablesDiv).remove();
} }
} }
@@ -1000,6 +991,13 @@ var GempLotrHallUI = Class.extend({
$('#wcQueuesHeader').show(); $('#wcQueuesHeader').show();
} }
if($('.scheduledQueues tr').length <= 1) {
$('#scheduledQueuesHeader').hide();
$('#scheduledQueuesContent').hide();
} else {
$('#scheduledQueuesHeader').show();
}
var tournaments = root.getElementsByTagName("tournament"); var tournaments = root.getElementsByTagName("tournament");
for (var i = 0; i < tournaments.length; i++) { for (var i = 0; i < tournaments.length; i++) {
var tournament = tournaments[i]; var tournament = tournaments[i];
@@ -1125,28 +1123,24 @@ var GempLotrHallUI = Class.extend({
} }
} }
// Tournament for for tournament table (not in Playing Tables Section)
var rowstr = ""; var rowstr = "";
rowstr += "<tr class='tournament" + id + "'><td>" + tournament.getAttribute("format") + "</td>";
if(isWC) { if(type === "sealed") {
rowstr += "<tr class='tournament" + id + "'><td>" + tournament.getAttribute("format") + "</td>"; rowstr += "<td>Sealed</td>";
} else { }
rowstr += "<tr class='tournament" + id + "'><td>" + tournament.getAttribute("format") + "</td>"; else if (type === "solodraft") {
if(type === "sealed") { rowstr += "<td>Solo Draft</td>";
rowstr += "<td>Sealed</td>";
}
else if (type === "solodraft") {
rowstr += "<td>Solo Draft</td>";
} }
else if (type === "table_solodraft") { else if (type === "table_solodraft") {
rowstr += "<td>Solo Table Draft</td>"; rowstr += "<td>Solo Table Draft</td>";
} }
else if (type === "table_draft") { else if (type === "table_draft") {
rowstr += "<td>Table Draft</td>"; rowstr += "<td>Table Draft</td>";
} }
else { else {
rowstr += "<td>" + tournament.getAttribute("collection") + "</td>"; rowstr += "<td>" + tournament.getAttribute("collection") + "</td>";
}
} }
rowstr += "<td>" + tournament.getAttribute("name") + "</td>" + rowstr += "<td>" + tournament.getAttribute("name") + "</td>" +
"<td>" + tournament.getAttribute("system") + "</td>"; "<td>" + tournament.getAttribute("system") + "</td>";
@@ -1157,9 +1151,7 @@ var GempLotrHallUI = Class.extend({
} }
rowstr += "<td>" + tournament.getAttribute("round") + "</td>" + rowstr += "<td>" + tournament.getAttribute("round") + "</td>" +
"<td><div class='prizeHint' title='Competing Players' value='" + tournament.getAttribute("playerList") + "<br><br>* = abandoned'>" + tournament.getAttribute("playerCount") + "</div></td></tr>"; "<td><div class='prizeHint' title='Competing Players' value='" + tournament.getAttribute("playerList") + "<br><br>* = abandoned'>" + tournament.getAttribute("playerCount") + "</div></td></tr>";
var row = $(rowstr); var row = $(rowstr);
row.append(actionsField);
// Row for tournament playing table // Row for tournament playing table
var displayType = type; var displayType = type;
@@ -1175,21 +1167,29 @@ var GempLotrHallUI = Class.extend({
else if (type === "table_draft") { else if (type === "table_draft") {
displayType = "Table Draft"; displayType = "Table Draft";
} }
else if (type === "constructed") {
displayType = "Constructed";
}
var tablesRow = $("<tr class='table" + id + "'></tr>"); var tablesRow = $("<tr class='table" + id + "'></tr>");
tablesRow.append("<td>" + tournament.getAttribute("format") + "</td>"); tablesRow.append("<td>" + tournament.getAttribute("format") + "</td>");
tablesRow.append("<td> Tournament - " + displayType + " - " + tournament.getAttribute("name") + "</td>"); tablesRow.append("<td>" + tournament.getAttribute("system") + " Tournament - " + displayType + " - " + tournament.getAttribute("name") + "</td>");
if (tournament.hasAttribute("timeRemaining")) { if (tournament.hasAttribute("timeRemaining")) {
tablesRow.append("<td>" + tournament.getAttribute("stage") + " - " + tournament.getAttribute("timeRemaining") + "</td>"); tablesRow.append("<td>" + tournament.getAttribute("stage") + " - " + tournament.getAttribute("timeRemaining") + "</td>");
} else if (tournament.getAttribute("stage") === "Playing Games") {
tablesRow.append("<td>" + tournament.getAttribute("stage") + " - Round " + tournament.getAttribute("round") + "</td>");
} else { } else {
tablesRow.append("<td>" + tournament.getAttribute("stage") + "</td>"); tablesRow.append("<td>" + tournament.getAttribute("stage") + "</td>");
} }
tablesRow.append("<td>" + tournament.getAttribute("playerList") + "</td>"); tablesRow.append("<td>" + tournament.getAttribute("playerList") + "</td>");
var actionsFieldClone = actionsField.clone(true); tablesRow.append(actionsField);
tablesRow.append(actionsFieldClone); if (joined == "true") {
if (joined == "true")
tablesRow.addClass("played"); // red highlight tablesRow.addClass("played"); // red highlight
} else if (isWC) {
tablesRow.addClass("wc-events"); // yellow highlight
}
if (action == "add") { if (action == "add") {
// Right now the only tournament section is for WC events
if (isWC) { if (isWC) {
$("table.wc-events", this.tablesDiv) $("table.wc-events", this.tablesDiv)
.append(row); .append(row);
@@ -1213,9 +1213,10 @@ var GempLotrHallUI = Class.extend({
} }
} else if (action == "update") { } else if (action == "update") {
// Update row in tournaments sections
$(".tournament" + id, this.tablesDiv).replaceWith(row); $(".tournament" + id, this.tablesDiv).replaceWith(row);
// Display tournaments also as playing tables // Update row in playing tables section
var existingRow = $(".table" + id, this.tablesDiv); var existingRow = $(".table" + id, this.tablesDiv);
if (existingRow.length > 0) { if (existingRow.length > 0) {
// If the row exists, replace it // If the row exists, replace it
@@ -1228,8 +1229,8 @@ var GempLotrHallUI = Class.extend({
this.animateRowUpdate(".tournament" + id); this.animateRowUpdate(".tournament" + id);
} else if (action == "remove") { } else if (action == "remove") {
// Remove tournament both from playing tables section and tournament sections
$(".tournament" + id, this.tablesDiv).remove(); $(".tournament" + id, this.tablesDiv).remove();
// Remove tournaments displayed as tables
$(".table" + id, this.tablesDiv).remove(); $(".table" + id, this.tablesDiv).remove();
} }
} }
@@ -1426,7 +1427,8 @@ var GempLotrHallUI = Class.extend({
} }
} }
$(".count", $(".eventHeader.queues")).html("(" + ($("tr", $("table.queues")).length - 1) + ")"); $(".count", $(".eventHeader.recurringQueues")).html("(" + ($("tr", $("table.recurringQueues")).length - 1) + ")");
$(".count", $(".eventHeader.scheduledQueues")).html("(" + ($("tr", $("table.scheduledQueues")).length - 1) + ")");
$(".count", $(".eventHeader.waitingTables")).html("(" + ($("tr", $("table.waitingTables")).length - 1) + ")"); $(".count", $(".eventHeader.waitingTables")).html("(" + ($("tr", $("table.waitingTables")).length - 1) + ")");
$(".count", $(".eventHeader.playingTables")).html("(" + ($("tr", $("table.playingTables")).length - 1) + ")"); $(".count", $(".eventHeader.playingTables")).html("(" + ($("tr", $("table.playingTables")).length - 1) + ")");
$(".count", $(".eventHeader.finishedTables")).html("(" + ($("tr", $("table.finishedTables")).length - 1) + ")"); $(".count", $(".eventHeader.finishedTables")).html("(" + ($("tr", $("table.finishedTables")).length - 1) + ")");

View File

@@ -107,7 +107,8 @@ public class HallCommunicationChannel implements LongPollableResource {
@Override @Override
public void visitTournamentQueue(String tournamentQueueKey, int cost, String collectionName, String formatName, String type, String tournamentQueueName, public void visitTournamentQueue(String tournamentQueueKey, int cost, String collectionName, String formatName, String type, String tournamentQueueName,
String tournamentPrizes, String pairingDescription, String startCondition, int playerCount, String playerList, boolean playerSignedUp, String tournamentPrizes, String pairingDescription, String startCondition, int playerCount, String playerList, boolean playerSignedUp,
boolean joinable, boolean startable, int readyCheckSecsRemaining, boolean confirmedReadyCheck, boolean wc, String draftCode) { boolean joinable, boolean startable, int readyCheckSecsRemaining, boolean confirmedReadyCheck, boolean wc, String draftCode,
boolean recurring, boolean scheduled, boolean displayInWaitingTables) {
Map<String, String> props = new HashMap<>(); Map<String, String> props = new HashMap<>();
props.put("cost", String.valueOf(cost)); props.put("cost", String.valueOf(cost));
props.put("collection", collectionName); props.put("collection", collectionName);
@@ -128,6 +129,9 @@ public class HallCommunicationChannel implements LongPollableResource {
if (draftCode != null) { if (draftCode != null) {
props.put("draftCode", draftCode); props.put("draftCode", draftCode);
} }
props.put("recurring", String.valueOf(recurring));
props.put("scheduled", String.valueOf(scheduled));
props.put("displayInWaitingTables", String.valueOf(displayInWaitingTables));
tournamentQueuesOnServer.put(tournamentQueueKey, props); tournamentQueuesOnServer.put(tournamentQueueKey, props);
} }

View File

@@ -15,7 +15,8 @@ public interface HallInfoVisitor {
public void visitTournamentQueue(String tournamentQueueKey, int cost, String collectionName, String formatName, String type, String tournamentQueueName, String tournamentPrizes, public void visitTournamentQueue(String tournamentQueueKey, int cost, String collectionName, String formatName, String type, String tournamentQueueName, String tournamentPrizes,
String pairingDescription, String startCondition, int playerCount, String playerList, boolean playerSignedUp, boolean joinable, boolean startable, String pairingDescription, String startCondition, int playerCount, String playerList, boolean playerSignedUp, boolean joinable, boolean startable,
int readyCheckSecsRemaining, boolean confirmedReadyCheck, boolean wc, String draftCode); int readyCheckSecsRemaining, boolean confirmedReadyCheck, boolean wc, String draftCode, boolean recurring, boolean scheduled,
boolean displayInWaitingTables);
public void visitTournament(String tournamentKey, String collectionName, String formatName, String tournamentName, String type, public void visitTournament(String tournamentKey, String collectionName, String formatName, String tournamentName, String type,
String pairingDescription, String tournamentStage, int round, int playerCount, String playerList, boolean playerInCompetition, boolean abandoned, boolean joinable, String pairingDescription, String tournamentStage, int round, int playerCount, String playerList, boolean playerInCompetition, boolean abandoned, boolean joinable,

View File

@@ -2,6 +2,7 @@ package com.gempukku.lotro.tournament;
import com.gempukku.lotro.collection.CollectionsManager; import com.gempukku.lotro.collection.CollectionsManager;
// Made obsolete by PlayerMadeQueue -> those queues have no longer support in ui and won't be displayed if empty
public class ImmediateRecurringQueue extends AbstractTournamentQueue implements TournamentQueue { public class ImmediateRecurringQueue extends AbstractTournamentQueue implements TournamentQueue {
private final int _playerCap; private final int _playerCap;
private final int maxPlayers; private final int maxPlayers;
@@ -43,4 +44,9 @@ public class ImmediateRecurringQueue extends AbstractTournamentQueue implements
public boolean isJoinable() { public boolean isJoinable() {
return (maxPlayers < 0 || _players.size() < maxPlayers); return (maxPlayers < 0 || _players.size() < maxPlayers);
} }
@Override
public boolean shouldBeDisplayedAsWaiting() {
return _players.size() > 0;
}
} }

View File

@@ -43,4 +43,9 @@ public class PlayerMadeQueue extends AbstractTournamentQueue implements Tourname
public boolean isJoinable() { public boolean isJoinable() {
return (getInfo()._params.maximumPlayers < 0 || _players.size() < getInfo()._params.maximumPlayers) && !isReadyCheckTimerRunning(); return (getInfo()._params.maximumPlayers < 0 || _players.size() < getInfo()._params.maximumPlayers) && !isReadyCheckTimerRunning();
} }
@Override
public boolean shouldBeDisplayedAsWaiting() {
return true; // Always display player made queues in waiting tables section
}
} }

View File

@@ -55,6 +55,12 @@ public class RecurringScheduledQueue extends AbstractTournamentQueue implements
return ZonedDateTime.now().isAfter(_nextStart.minus(_signupTimeBeforeStart)) && (_maximumPlayers < 0 || _players.size() < _maximumPlayers); return ZonedDateTime.now().isAfter(_nextStart.minus(_signupTimeBeforeStart)) && (_maximumPlayers < 0 || _players.size() < _maximumPlayers);
} }
@Override
public boolean shouldBeDisplayedAsWaiting() {
// Display in waiting tables section 1 hour before start
return ZonedDateTime.now().isAfter(_nextStart.minus(_signupTimeBeforeStart));
}
@Override @Override
public boolean process() throws SQLException, IOException { public boolean process() throws SQLException, IOException {
if (ZonedDateTime.now().isAfter(_nextStart)) { if (ZonedDateTime.now().isAfter(_nextStart)) {

View File

@@ -63,4 +63,13 @@ public class ScheduledTournamentQueue extends AbstractTournamentQueue implements
} }
return DateUtils.Now().isAfter(_startTime.minus(window)) && (maximumPlayers < 0 || _players.size() < maximumPlayers); return DateUtils.Now().isAfter(_startTime.minus(window)) && (maximumPlayers < 0 || _players.size() < maximumPlayers);
} }
@Override
public boolean shouldBeDisplayedAsWaiting() {
var window = _signupTimeBeforeStart;
if (isWC()) {
window = _wcSignupTimeBeforeStart;
}
return DateUtils.Now().isAfter(_startTime.minus(window));
}
} }

View File

@@ -56,4 +56,6 @@ public interface TournamentQueue {
boolean isWC(); boolean isWC();
String getDraftCode(); String getDraftCode();
boolean shouldBeDisplayedAsWaiting();
} }

View File

@@ -159,7 +159,8 @@ public class TournamentService {
formatLibrary.getFormat(queue.getFormatCode()).getName(), queue.getInfo().Parameters().type.toString(), queue.getTournamentQueueName(), formatLibrary.getFormat(queue.getFormatCode()).getName(), queue.getInfo().Parameters().type.toString(), queue.getTournamentQueueName(),
queue.getPrizesDescription(), queue.getPairingDescription(), queue.getStartCondition(), queue.getPrizesDescription(), queue.getPairingDescription(), queue.getStartCondition(),
queue.getPlayerCount(), queue.getPlayerList(), queue.isPlayerSignedUp(player.getName()), queue.isJoinable(), queue.isStartable(player.getName()), queue.getPlayerCount(), queue.getPlayerList(), queue.isPlayerSignedUp(player.getName()), queue.isJoinable(), queue.isStartable(player.getName()),
queue.getSecondsRemainingForReadyCheck(), queue.hasConfirmedReadyCheck(player.getName()), queue.isWC(), queue.getDraftCode()); queue.getSecondsRemainingForReadyCheck(), queue.hasConfirmedReadyCheck(player.getName()), queue.isWC(), queue.getDraftCode(),
queue instanceof RecurringScheduledQueue, queue instanceof ScheduledTournamentQueue, queue.shouldBeDisplayedAsWaiting());
} }
for (var entry : _activeTournaments.entrySet()) { for (var entry : _activeTournaments.entrySet()) {