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
This commit is contained in:
Christian 'ketura' McCarty
2024-12-18 09:38:12 -06:00
parent 3eabebbfb8
commit f143dc561f
3 changed files with 7 additions and 6 deletions

View File

@@ -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");

View File

@@ -41,6 +41,7 @@ public class SoloDraftDefinitions {
public void ReloadDraftsFromFile() {
try {
collectionReady.acquire();
_draftTypes.clear();
loadDrafts(_draftDefinitionPath);
collectionReady.release();
} catch (InterruptedException e) {

View File

@@ -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;
}