From 9ba6f74bf6e6a03a64e53373217d4755d6f005e4 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Dec 2014 22:55:16 +0100 Subject: [PATCH] * improved message for missing cards on the server. --- Mage/src/mage/cards/decks/Deck.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Mage/src/mage/cards/decks/Deck.java b/Mage/src/mage/cards/decks/Deck.java index 5b0caa8fb0..f7655fd795 100644 --- a/Mage/src/mage/cards/decks/Deck.java +++ b/Mage/src/mage/cards/decks/Deck.java @@ -58,7 +58,7 @@ public class Deck implements Serializable { if (card != null) { deck.cards.add(card); } else if (!ignoreErrors) { - throw new GameException("Error loading card - " + deckCardInfo.getCardName() + " for deck - " + deck.getName()); + throw createCardNotFoundGameException(deckCardInfo, deckCardLists.getName()); } } for (DeckCardInfo deckCardInfo: deckCardLists.getSideboard()) { @@ -66,13 +66,19 @@ public class Deck implements Serializable { if (card != null) { deck.sideboard.add(card); } else if (!ignoreErrors) { - throw new GameException("Error loading card - " + deckCardInfo.getCardName() + " for deck - " + deck.getName()); + throw createCardNotFoundGameException(deckCardInfo, deckCardLists.getName()); } } return deck; } + private static GameException createCardNotFoundGameException(DeckCardInfo deckCardInfo, String deckName) { + return new GameException("Card not found - " + deckCardInfo.getCardName() + " - " + deckCardInfo.getSetCode() + " for deck - " + deckName + "\n" + + "Possible reason is, that you use cards in your deck, that are only supported in newer versions of the server.\n" + + "So it can help to use the same card from another set, that's already supported from this server." ); + } + private static Card createCard(DeckCardInfo deckCardInfo, boolean mockCards) { CardInfo cardInfo = CardRepository.instance.findCard(deckCardInfo.getSetCode(), deckCardInfo.getCardNum()); if (cardInfo == null) {