From 58536e0de3bfa33937969000302cc38c8e891305 Mon Sep 17 00:00:00 2001 From: "jakub.salavec" Date: Tue, 18 Feb 2025 14:02:59 +0100 Subject: [PATCH] Tournaments with player(s) waiting are now displayed with waiting tables --- .../src/main/web/js/gemp-022/hallUi.js | 41 ++++++++++++++++++- .../lotro/tournament/TournamentService.java | 22 +++++----- 2 files changed, 52 insertions(+), 11 deletions(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js index 6e09997c5..62136e5b8 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js @@ -480,7 +480,6 @@ var GempLotrHallUI = Class.extend({ } else if (type === "solodraft") { rowstr += "Solo Draft"; - } else { rowstr += "" + queue.getAttribute("collection") + ""; @@ -497,6 +496,24 @@ var GempLotrHallUI = Class.extend({ var row = $(rowstr); row.append(actionsField); + // Row for tournament queue table + var tablesRow = $(""); + tablesRow.append("" + queue.getAttribute("format") + ""); + var type = queue.getAttribute("type"); + if(type !== null) + type = type.toLowerCase(); + if(type === "sealed") { + type = "Sealed"; + } + else if (type === "solodraft") { + type = "Solo Draft"; + } + tablesRow.append(" Tournament - " + type + " - " + queue.getAttribute("queue") + ""); + tablesRow.append("" + queue.getAttribute("start") + ""); + tablesRow.append("" + queue.getAttribute("playerList") + ""); + var actionsFieldClone = actionsField.clone(true); + tablesRow.append(actionsFieldClone); + if (action == "add") { if(isWC) { $("table.wc-queues", this.tablesDiv) @@ -505,6 +522,11 @@ var GempLotrHallUI = Class.extend({ else { $("table.queues", this.tablesDiv) .append(row); + // Display 2-man queues with 1 player joined as tables + if (queue.getAttribute("playerCount") != 0) { + $("table.waitingTables", this.tablesDiv) + .append(tablesRow); + } } } else if (action == "update") { if(isWC) { @@ -512,6 +534,21 @@ var GempLotrHallUI = Class.extend({ } else { $(".queue" + id, this.tablesDiv).replaceWith(row); + + // Display 2-man queues with 1 player joined as tables + if (queue.getAttribute("playerCount") != 0) { + var existingRow = $(".table" + id, this.tablesDiv); + if (existingRow.length > 0) { + // If the row exists, replace it + existingRow.replaceWith(tablesRow); + } else { + // If the row does not exist, append it + $("table.waitingTables", this.tablesDiv).append(tablesRow); + } + } else if (queue.getAttribute("playerCount") == 0) { + // Remove tournaments displayed as tables + $(".table" + id, this.tablesDiv).remove(); + } } } @@ -529,6 +566,8 @@ var GempLotrHallUI = Class.extend({ } else { $(".queue" + id, this.tablesDiv).remove(); + // Remove tournaments displayed as tables + $(".table" + id, this.tablesDiv).remove(); } } diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/TournamentService.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/TournamentService.java index 866889b43..ad64a92d1 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/TournamentService.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/TournamentService.java @@ -146,7 +146,7 @@ public class TournamentService { sealedParams.tournamentId = prefix; sealedParams.name = queueName; sealedParams.cost = 0; - sealedParams.minimumPlayers = 2; + sealedParams.minimumPlayers = 4; sealedParams.playoff = Tournament.PairingType.SWISS_3; sealedParams.prizes = Tournament.PrizeType.DAILY; @@ -172,7 +172,7 @@ public class TournamentService { soloDraftParams.tournamentId = prefix; soloDraftParams.name = queueName; soloDraftParams.cost = 0; - soloDraftParams.minimumPlayers = 2; + soloDraftParams.minimumPlayers = 4; soloDraftParams.playoff = Tournament.PairingType.SWISS_3; soloDraftParams.prizes = Tournament.PrizeType.DAILY; @@ -187,6 +187,11 @@ public class TournamentService { clearCache(); _tournamentQueues.clear(); + addImmediateRecurringSealed("fotr_sealed_queue", "FotR Sealed", "fotrSealedQueue-", "single_fotr_block_sealed"); + addImmediateRecurringSealed("movie_sealed_queue", "Movie Sealed", "movieSealedQueue-", "single_movie_sealed"); + addImmediateRecurringDraft("fotr_draft_queue", "FotR Draft", "fotrDraftQueue-", "fotr_draft"); + addImmediateRecurringDraft("ttt_draft_queue", "TTT Draft", "tttDraftQueue-", "ttt_draft"); + addImmediateRecurringQueue("fotr_queue", "Fellowship Block", "fotrQueue-", "fotr_block"); addImmediateRecurringQueue("pc_fotr_queue", "PC-Fellowship", "pcfotrQueue-", "pc_fotr_block"); addImmediateRecurringQueue("ts_queue", "Towers Standard", "tsQueue-", "towers_standard"); @@ -195,9 +200,6 @@ public class TournamentService { addImmediateRecurringQueue("expanded_queue", "Expanded", "expandedQueue-", "expanded"); addImmediateRecurringQueue("pc_expanded_queue", "PC-Expanded", "pcexpandedQueue-", "pc_expanded"); - addImmediateRecurringSealed("sealed_queue", "FotR Sealed", "sealedQueue-", "single_fotr_block_sealed"); - addImmediateRecurringDraft("draft_queue", "FotR Draft", "draftQueue-", "fotr_draft"); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); @@ -207,11 +209,11 @@ public class TournamentService { addRecurringScheduledQueue("movie_daily_eu", "Daily Gondor Movie Block", "2013-01-16 19:30:00", "movieDailyEu-", "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"); +// 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) { // Ignore, can't happen