Bug fixes
- Fixed missing return value in deck stats causing a superfluous error in the log - Fixed deck validation causing an error in PC-Movie if a Map was added before a RB or Ring - Fixed leagues not permitting decks to be altered or tables to be created on the same day of a serie end
This commit is contained in:
@@ -157,6 +157,7 @@ public class DeckRequestHandler extends LotroServerRequestHandler implements Uri
|
|||||||
if(format == null || targetFormat == null)
|
if(format == null || targetFormat == null)
|
||||||
{
|
{
|
||||||
responseWriter.writeHtmlResponse("Invalid format: " + targetFormat);
|
responseWriter.writeHtmlResponse("Invalid format: " + targetFormat);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> validation = format.validateDeck(deck);
|
List<String> validation = format.validateDeck(deck);
|
||||||
|
|||||||
@@ -38,7 +38,14 @@ public class DateUtils {
|
|||||||
public static boolean IsToday(ZonedDateTime date) { return DaysSince(date) == 0; }
|
public static boolean IsToday(ZonedDateTime date) { return DaysSince(date) == 0; }
|
||||||
public static boolean IsAtLeastDayAfter(ZonedDateTime a, ZonedDateTime b) { return DaysBetween(b, a) >= 1; }
|
public static boolean IsAtLeastDayAfter(ZonedDateTime a, ZonedDateTime b) { return DaysBetween(b, a) >= 1; }
|
||||||
public static boolean IsAfterStart(ZonedDateTime date, ZonedDateTime start) { return date.isEqual(start) || date.isAfter(start); }
|
public static boolean IsAfterStart(ZonedDateTime date, ZonedDateTime start) { return date.isEqual(start) || date.isAfter(start); }
|
||||||
public static boolean IsBeforeEnd(ZonedDateTime date, ZonedDateTime end) { return DaysBetween(end, date) < 0; }
|
public static boolean IsBeforeEnd(ZonedDateTime date, ZonedDateTime end) {
|
||||||
|
if(IsSameDay(date, end)) {
|
||||||
|
return date.isBefore(end.plusDays(1));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return date.isBefore(end);
|
||||||
|
}
|
||||||
|
}
|
||||||
public static boolean IsSameDay(ZonedDateTime a, ZonedDateTime b) { return DaysBetween(a, b) == 0; }
|
public static boolean IsSameDay(ZonedDateTime a, ZonedDateTime b) { return DaysBetween(a, b) == 0; }
|
||||||
public static long DaysBetween(ZonedDateTime a, ZonedDateTime b) { return Duration.between(a, b).toDays(); }
|
public static long DaysBetween(ZonedDateTime a, ZonedDateTime b) { return Duration.between(a, b).toDays(); }
|
||||||
public static long DaysSince(ZonedDateTime date) { return DaysBetween(date, Now()); }
|
public static long DaysSince(ZonedDateTime date) { return DaysBetween(date, Now()); }
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.gempukku.lotro.common.*;
|
|||||||
import com.gempukku.lotro.game.*;
|
import com.gempukku.lotro.game.*;
|
||||||
import com.gempukku.lotro.logic.GameUtils;
|
import com.gempukku.lotro.logic.GameUtils;
|
||||||
import com.gempukku.lotro.logic.vo.LotroDeck;
|
import com.gempukku.lotro.logic.vo.LotroDeck;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -712,8 +713,13 @@ public class DefaultLotroFormat implements LotroFormat {
|
|||||||
sites.add(new PhysicalCardImpl(0, bp, "", _library.getLotroCardBlueprint(bp)));
|
sites.add(new PhysicalCardImpl(0, bp, "", _library.getLotroCardBlueprint(bp)));
|
||||||
}
|
}
|
||||||
|
|
||||||
var rb = new PhysicalCardImpl(0, deck.getRingBearer(), "", _library.getLotroCardBlueprint(deck.getRingBearer()));
|
PhysicalCardImpl rb = null, ring = null;
|
||||||
var ring = new PhysicalCardImpl(0, deck.getRing(), "", _library.getLotroCardBlueprint(deck.getRing()));
|
if(!StringUtils.isEmpty(deck.getRingBearer())) {
|
||||||
|
rb = new PhysicalCardImpl(0, deck.getRingBearer(), "", _library.getLotroCardBlueprint(deck.getRingBearer()));
|
||||||
|
}
|
||||||
|
if(!StringUtils.isEmpty(deck.getRing())) {
|
||||||
|
ring = new PhysicalCardImpl(0, deck.getRing(), "", _library.getLotroCardBlueprint(deck.getRing()));
|
||||||
|
}
|
||||||
|
|
||||||
var result = map.validatePreGameDeckCheck(freeps, shadow, sites, rb, ring, new PhysicalCardImpl(0, mapBP, "", map));
|
var result = map.validatePreGameDeckCheck(freeps, shadow, sites, rb, ring, new PhysicalCardImpl(0, mapBP, "", map));
|
||||||
if(!result.success())
|
if(!result.success())
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ public class LeagueService {
|
|||||||
var currentDate = DateUtils.Now();
|
var currentDate = DateUtils.Now();
|
||||||
|
|
||||||
for (LeagueSerieInfo leagueSerieInfo : league.getLeagueData(_productLibrary, _formatLibrary, _soloDraftDefinitions).getSeries()) {
|
for (LeagueSerieInfo leagueSerieInfo : league.getLeagueData(_productLibrary, _formatLibrary, _soloDraftDefinitions).getSeries()) {
|
||||||
if (currentDate.isAfter( leagueSerieInfo.getStart()) && currentDate.isBefore(leagueSerieInfo.getEnd()))
|
if (currentDate.isAfter( leagueSerieInfo.getStart()) && DateUtils.IsBeforeEnd(currentDate, leagueSerieInfo.getEnd()))
|
||||||
return leagueSerieInfo;
|
return leagueSerieInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user