diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index 496067906d..39c87163cc 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -336,7 +336,7 @@ public class GameController implements GameCallback { joinType = "rejoined"; } user.addGame(playerId, gameSession); - logger.debug("Player " + player.getLogName()+ " " + playerId + " has " + joinType + " gameId: " + game.getId()); + logger.debug("Player " + player.getName()+ " " + playerId + " has " + joinType + " gameId: " + game.getId()); ChatManager.getInstance().broadcast(chatId, "", game.getPlayer(playerId).getLogName() + " has " + joinType + " the game", MessageColor.ORANGE, true, MessageType.GAME); checkStart(); } diff --git a/Mage/src/mage/cards/CardsImpl.java b/Mage/src/mage/cards/CardsImpl.java index a5c19f3a9f..c06e6db5f9 100644 --- a/Mage/src/mage/cards/CardsImpl.java +++ b/Mage/src/mage/cards/CardsImpl.java @@ -42,9 +42,7 @@ import java.util.UUID; import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; -import mage.players.Player; import mage.util.ThreadLocalStringBuilder; -import org.apache.log4j.Logger; /** @@ -53,13 +51,11 @@ import org.apache.log4j.Logger; */ public class CardsImpl extends LinkedHashSet implements Cards, Serializable { - private static final Logger logger = Logger.getLogger(CardsImpl.class); private static final transient ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(200); private static Random rnd = new Random(); private UUID ownerId; private Zone zone; - private boolean errorLogged = false; public CardsImpl() { } @@ -200,21 +196,9 @@ public class CardsImpl extends LinkedHashSet implements Cards, Serializabl Set cards = new LinkedHashSet<>(); for (UUID cardId: this) { Card card = game.getCard(cardId); - if (card != null) { + if (card != null) { // this can happen during the cancelation (player concedes) of a game cards.add(card); - } else { - if (!errorLogged) { // this runs in iteration, so the flag helps to stop to fill the log file - // seems like this can happen during the cancelation of a game - logger.error("Card not found cardId: " + cardId + " gameId: " + game.getId() ); - for (Player player :game.getPlayers().values()) { - logger.error(player.getName() + " inGame=" + (player.isInGame() ? "true":"false")); - } - for (StackTraceElement stackTraceElement: Thread.currentThread().getStackTrace()) { - logger.error(stackTraceElement.toString()); - } - errorLogged = true; - } - } + } } return cards; } diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 30bc982f6b..e24075d5b1 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -1925,14 +1925,14 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public void lostForced(Game game) { - logger.debug(this.getLogName() + " has lost gameId: " + game.getId()); + logger.debug(this.getName() + " has lost gameId: " + game.getId()); //20100423 - 603.9 if (!this.wins) { this.loses = true; game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LOST, null, null, playerId)); game.informPlayers(this.getLogName() + " has lost the game."); } else { - logger.debug(this.getLogName() + " has already won - stop lost"); + logger.debug(this.getName() + " has already won - stop lost"); } // for draw - first all players that have lost have to be set to lost if (!hasLeft()) {