* Added some basic logging for deck format validation

This commit is contained in:
LevelX2 2015-01-21 14:40:05 +01:00
parent 8b2445551e
commit b12b044e36
3 changed files with 7 additions and 2 deletions

View file

@ -283,7 +283,6 @@ public class TableController {
} }
return false; return false;
} }
Player player = createPlayer(name, seat.getPlayerType(), skill); Player player = createPlayer(name, seat.getPlayerType(), skill);
if (player == null) { if (player == null) {
String message = new StringBuilder("Could not create player ").append(name).append(" of type ").append(seat.getPlayerType()).toString(); 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); user.showUserMessage("Join Table",message);
return false; return false;
} }
logger.debug("DECK validated: " + table.getValidator().getName() + " " + player.getName() + " " + deck.getName());
if (!player.canJoinTable(table)) { if (!player.canJoinTable(table)) {
user.showUserMessage("Join Table", new StringBuilder("A ").append(seat.getPlayerType()).append(" player can't join this table.").toString()); user.showUserMessage("Join Table", new StringBuilder("A ").append(seat.getPlayerType()).append(" player can't join this table.").toString());
return false; return false;

View file

@ -38,6 +38,7 @@ import mage.cards.Card;
import mage.cards.repository.CardInfo; import mage.cards.repository.CardInfo;
import mage.cards.repository.CardRepository; import mage.cards.repository.CardRepository;
import mage.constants.Rarity; import mage.constants.Rarity;
import org.apache.log4j.Logger;
/** /**
* *
@ -45,6 +46,8 @@ import mage.constants.Rarity;
*/ */
public class Constructed extends DeckValidator { public class Constructed extends DeckValidator {
private static final Logger logger = Logger.getLogger(DeckValidator.class);
protected List<String> banned = new ArrayList<>(); protected List<String> banned = new ArrayList<>();
protected List<String> restricted = new ArrayList<>(); protected List<String> restricted = new ArrayList<>();
protected List<String> setCodes = new ArrayList<>(); protected List<String> setCodes = new ArrayList<>();
@ -60,6 +63,7 @@ public class Constructed extends DeckValidator {
@Override @Override
public boolean validate(Deck deck) { public boolean validate(Deck deck) {
logger.debug("DECK validate start: " + name + " deckname: " + deck.getName() );
boolean valid = true; boolean valid = true;
//20091005 - 100.2a //20091005 - 100.2a
if (deck.getCards().size() < 60) { 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; return valid;
} }

View file

@ -62,6 +62,7 @@ sub toCamelCase {
$string; $string;
} }
# TODO: check for basic lands with ending 1,2,3,4,5 ...
my $toPrint = ''; my $toPrint = '';
foreach my $card (sort cardSort @setCards) { foreach my $card (sort cardSort @setCards) {
my $className = toCamelCase(@{$card}[0]); my $className = toCamelCase(@{$card}[0]);