From e88357f0e5fd09be7ed6ac607c7286f540222539 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Tue, 3 Jul 2012 13:17:54 +0000 Subject: [PATCH] Recurring tournaments off of one queue. --- .../src/main/java/com/gempukku/lotro/hall/HallServer.java | 2 +- ...amentQueue.java => SingleEliminationRecurringQueue.java} | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) rename gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/{SingleEliminationTournamentQueue.java => SingleEliminationRecurringQueue.java} (90%) diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java index 1d4e2af1f..69a27345e 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java @@ -62,7 +62,7 @@ public class HallServer extends AbstractServer { _runningTournaments.addAll(tournamentService.getLiveTournaments()); - _tournamentQueues.put("fotr_queue", new SingleEliminationTournamentQueue(0, _formatLibrary.getFormat("fotr_block"), + _tournamentQueues.put("fotr_queue", new SingleEliminationRecurringQueue(0, _formatLibrary.getFormat("fotr_block"), new CollectionType("default", "All cards"), "fotrQueue-", 1, "Fellowship Block On-Demand", 4, tournamentService)); } diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/SingleEliminationTournamentQueue.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/SingleEliminationRecurringQueue.java similarity index 90% rename from gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/SingleEliminationTournamentQueue.java rename to gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/SingleEliminationRecurringQueue.java index 06bf72612..8664fff86 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/SingleEliminationTournamentQueue.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/SingleEliminationRecurringQueue.java @@ -10,7 +10,7 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; -public class SingleEliminationTournamentQueue implements TournamentQueue { +public class SingleEliminationRecurringQueue implements TournamentQueue { private int _cost; private LotroFormat _lotroFormat; private CollectionType _collectionType; @@ -25,7 +25,7 @@ public class SingleEliminationTournamentQueue implements TournamentQueue { private String _tournamentIdPrefix; private int _tournamentIteration; - public SingleEliminationTournamentQueue(int cost, LotroFormat lotroFormat, CollectionType collectionType, String tournamentIdPrefix, int tournamentIteration, String tournamentQueueName, int playerCap, TournamentService tournamentService) { + public SingleEliminationRecurringQueue(int cost, LotroFormat lotroFormat, CollectionType collectionType, String tournamentIdPrefix, int tournamentIteration, String tournamentQueueName, int playerCap, TournamentService tournamentService) { _cost = cost; _lotroFormat = lotroFormat; _collectionType = collectionType; @@ -55,7 +55,9 @@ public class SingleEliminationTournamentQueue implements TournamentQueue { public synchronized boolean process(TournamentQueueCallback tournamentQueueCallback) { if (_playerDecks.size() == _playerCap) { String tournamentId = _tournamentIdPrefix + System.currentTimeMillis(); + String tournamentName = _tournamentQueueName + " - " + _tournamentIteration; + _tournamentIteration++; String parameters = _lotroFormat.getName() + "," + _collectionType.getCode() + "," + _collectionType.getFullName() + "," + tournamentName;