On-demand tournament name.

This commit is contained in:
marcins78@gmail.com
2012-07-03 13:21:29 +00:00
parent e88357f0e5
commit 17a07a46a2
3 changed files with 10 additions and 6 deletions

View File

@@ -18,6 +18,12 @@ public class DateUtils {
return date.get(Calendar.YEAR) * 100000000 + (date.get(Calendar.MONTH) + 1) * 1000000 + date.get(Calendar.DAY_OF_MONTH) * 10000 + date.get(Calendar.HOUR_OF_DAY) * 100 + date.get(Calendar.MINUTE);
}
public static String getStringDateWithHour() {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
format.setTimeZone(TimeZone.getTimeZone("GMT"));
return format.format(new Date());
}
public static int offsetDate(int start, int dayOffset) {
try {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");

View File

@@ -63,7 +63,7 @@ public class HallServer extends AbstractServer {
_runningTournaments.addAll(tournamentService.getLiveTournaments());
_tournamentQueues.put("fotr_queue", new SingleEliminationRecurringQueue(0, _formatLibrary.getFormat("fotr_block"),
new CollectionType("default", "All cards"), "fotrQueue-", 1, "Fellowship Block On-Demand", 4,
new CollectionType("default", "All cards"), "fotrQueue-", "Fellowship Block", 4,
tournamentService));
}

View File

@@ -1,5 +1,6 @@
package com.gempukku.lotro.tournament;
import com.gempukku.lotro.DateUtils;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.db.vo.CollectionType;
import com.gempukku.lotro.game.LotroFormat;
@@ -23,16 +24,14 @@ public class SingleEliminationRecurringQueue implements TournamentQueue {
private TournamentService _tournamentService;
private String _tournamentIdPrefix;
private int _tournamentIteration;
public SingleEliminationRecurringQueue(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, String tournamentQueueName, int playerCap, TournamentService tournamentService) {
_cost = cost;
_lotroFormat = lotroFormat;
_collectionType = collectionType;
_tournamentQueueName = tournamentQueueName;
_playerCap = playerCap;
_tournamentIdPrefix = tournamentIdPrefix;
_tournamentIteration = tournamentIteration;
_tournamentService = tournamentService;
}
@@ -56,8 +55,7 @@ public class SingleEliminationRecurringQueue implements TournamentQueue {
if (_playerDecks.size() == _playerCap) {
String tournamentId = _tournamentIdPrefix + System.currentTimeMillis();
String tournamentName = _tournamentQueueName + " - " + _tournamentIteration;
_tournamentIteration++;
String tournamentName = _tournamentQueueName + " - " + DateUtils.getStringDateWithHour();
String parameters = _lotroFormat.getName() + "," + _collectionType.getCode() + "," + _collectionType.getFullName() + "," + tournamentName;