From f143dc561f54cb01b05f9bd2c871baac10c54b13 Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Wed, 18 Dec 2024 09:38:12 -0600 Subject: [PATCH] Draft fixes - Fixed draft mode showing random sites instead of clustering by site number - Changed behavior of the card filter to interpret a provided stat with no comparator as an EQUALS comparator - Added draft definition reloading to the admin definition refresh --- .../gempukku/lotro/async/handler/AdminRequestHandler.java | 8 ++++---- .../com/gempukku/lotro/draft2/SoloDraftDefinitions.java | 1 + .../java/com/gempukku/lotro/game/SortAndFilterCards.java | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/AdminRequestHandler.java b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/AdminRequestHandler.java index cc606cf6e..2217e390d 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/AdminRequestHandler.java +++ b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/AdminRequestHandler.java @@ -5,7 +5,6 @@ import com.gempukku.lotro.async.ResponseWriter; import com.gempukku.lotro.cache.CacheManager; import com.gempukku.lotro.chat.ChatServer; import com.gempukku.lotro.collection.CollectionsManager; -import com.gempukku.lotro.common.DBDefs; import com.gempukku.lotro.common.DateUtils; import com.gempukku.lotro.db.LeagueDAO; import com.gempukku.lotro.db.PlayerDAO; @@ -25,13 +24,13 @@ import com.gempukku.lotro.packs.ProductLibrary; import com.gempukku.lotro.service.AdminService; import com.gempukku.lotro.tournament.*; import com.gempukku.util.JsonUtils; -import com.sun.jersey.core.util.StringIgnoreCaseKeyComparator; import io.netty.handler.codec.http.HttpMethod; import io.netty.handler.codec.http.HttpRequest; import io.netty.handler.codec.http.multipart.HttpPostRequestDecoder; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger;import org.w3c.dom.Document; +import org.apache.logging.log4j.Logger; +import org.w3c.dom.Document; import org.w3c.dom.Element; import javax.xml.parsers.DocumentBuilder; @@ -40,7 +39,6 @@ import java.io.IOException; import java.lang.reflect.Type; import java.sql.SQLException; import java.text.SimpleDateFormat; -import java.time.LocalDateTime; import java.time.ZonedDateTime; import java.time.format.DateTimeParseException; import java.util.*; @@ -1086,6 +1084,8 @@ public class AdminRequestHandler extends LotroServerRequestHandler implements Ur _formatLibrary.ReloadFormats(); _formatLibrary.ReloadSealedTemplates(); + _soloDraftDefinitions.ReloadDraftsFromFile(); + _chatServer.sendSystemMessageToAllChatRooms("@everyone Card definition reload complete. If you are mid-game and you notice any oddities, reload the page and please let the mod team know in the game hall ASAP if the problem doesn't go away."); responseWriter.writeHtmlResponse("OK"); diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/draft2/SoloDraftDefinitions.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/draft2/SoloDraftDefinitions.java index e84d57916..6030f3455 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/draft2/SoloDraftDefinitions.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/draft2/SoloDraftDefinitions.java @@ -41,6 +41,7 @@ public class SoloDraftDefinitions { public void ReloadDraftsFromFile() { try { collectionReady.acquire(); + _draftTypes.clear(); loadDrafts(_draftDefinitionPath); collectionReady.release(); } catch (InterruptedException e) { diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/SortAndFilterCards.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/SortAndFilterCards.java index 5cfcc6a1c..10a0a30fb 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/SortAndFilterCards.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/SortAndFilterCards.java @@ -480,13 +480,13 @@ public class SortAndFilterCards { * @return true or false */ private static boolean isAttributeValueAccepted(Integer filterValue, String compareType, Integer blueprintValue) { - if(filterValue == null || compareType == null) + if(filterValue == null) return true; if (blueprintValue == null) return false; - if ("EQUALS".equals(compareType) || "GREATER_THAN_OR_EQUAL_TO".equals(compareType) || "LESS_THAN_OR_EQUAL_TO".equals(compareType)) { + if (compareType == null || "EQUALS".equals(compareType) || "GREATER_THAN_OR_EQUAL_TO".equals(compareType) || "LESS_THAN_OR_EQUAL_TO".equals(compareType)) { if (blueprintValue.equals(filterValue)) return true; }