Fixing some server crashes caused by malformed json card definitions.
This commit is contained in:
@@ -117,6 +117,9 @@ public class LotroCardBlueprintLibrary {
|
||||
} catch (ParseException exp) {
|
||||
logger.error("Failed to parse file " + file.getAbsolutePath(), exp);
|
||||
}
|
||||
catch (Exception exp) {
|
||||
logger.error("Unexpected error while parsing file " + file.getAbsolutePath(), exp);
|
||||
}
|
||||
logger.debug("Loaded card file " + file.getName());
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +142,11 @@ public class SortAndFilterCards {
|
||||
SetDefinition setRarity = rarities.get(blueprintId.substring(0, blueprintId.indexOf("_")));
|
||||
if (setRarity != null) {
|
||||
String cardRarity = setRarity.getCardRarity(library.stripBlueprintModifiers(blueprintId));
|
||||
if(cardRarity == null) {
|
||||
//TODO: log that the rarity was not set
|
||||
//real TODO: put the rarity in the friggin json
|
||||
return false;
|
||||
}
|
||||
for (String r : rarity) {
|
||||
if (cardRarity.equals(r))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user