From b12b044e36b89afb9b875fb4221608cbc8239175 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 21 Jan 2015 14:40:05 +0100 Subject: [PATCH] * Added some basic logging for deck format validation --- Mage.Server/src/main/java/mage/server/TableController.java | 2 +- Mage/src/mage/cards/decks/Constructed.java | 6 +++++- Utils/gen-list-unimplemented-cards-for-set.pl | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Mage.Server/src/main/java/mage/server/TableController.java b/Mage.Server/src/main/java/mage/server/TableController.java index 9690e0da2c..9433c1d032 100644 --- a/Mage.Server/src/main/java/mage/server/TableController.java +++ b/Mage.Server/src/main/java/mage/server/TableController.java @@ -283,7 +283,6 @@ public class TableController { } return false; } - Player player = createPlayer(name, seat.getPlayerType(), skill); if (player == null) { String message = new StringBuilder("Could not create player ").append(name).append(" of type ").append(seat.getPlayerType()).toString(); @@ -291,6 +290,7 @@ public class TableController { user.showUserMessage("Join Table",message); return false; } + logger.debug("DECK validated: " + table.getValidator().getName() + " " + player.getName() + " " + deck.getName()); if (!player.canJoinTable(table)) { user.showUserMessage("Join Table", new StringBuilder("A ").append(seat.getPlayerType()).append(" player can't join this table.").toString()); return false; diff --git a/Mage/src/mage/cards/decks/Constructed.java b/Mage/src/mage/cards/decks/Constructed.java index 4e1113d794..8218afa0fc 100644 --- a/Mage/src/mage/cards/decks/Constructed.java +++ b/Mage/src/mage/cards/decks/Constructed.java @@ -38,6 +38,7 @@ import mage.cards.Card; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; import mage.constants.Rarity; +import org.apache.log4j.Logger; /** * @@ -45,6 +46,8 @@ import mage.constants.Rarity; */ public class Constructed extends DeckValidator { + private static final Logger logger = Logger.getLogger(DeckValidator.class); + protected List banned = new ArrayList<>(); protected List restricted = new ArrayList<>(); protected List setCodes = new ArrayList<>(); @@ -60,6 +63,7 @@ public class Constructed extends DeckValidator { @Override public boolean validate(Deck deck) { + logger.debug("DECK validate start: " + name + " deckname: " + deck.getName() ); boolean valid = true; //20091005 - 100.2a if (deck.getCards().size() < 60) { @@ -153,7 +157,7 @@ public class Constructed extends DeckValidator { } } } - + logger.debug("DECK validate end: " + name + " deckname: " + deck.getName() + " invalids:" + invalid.size()); return valid; } diff --git a/Utils/gen-list-unimplemented-cards-for-set.pl b/Utils/gen-list-unimplemented-cards-for-set.pl index 41e09fd7c0..39255747d4 100644 --- a/Utils/gen-list-unimplemented-cards-for-set.pl +++ b/Utils/gen-list-unimplemented-cards-for-set.pl @@ -62,6 +62,7 @@ sub toCamelCase { $string; } +# TODO: check for basic lands with ending 1,2,3,4,5 ... my $toPrint = ''; foreach my $card (sort cardSort @setCards) { my $className = toCamelCase(@{$card}[0]);