* Minor changes to logging.

This commit is contained in:
LevelX2 2014-10-28 08:14:03 +01:00
parent 4a2be2c3e6
commit 1241f6582b
2 changed files with 4 additions and 1 deletions

View file

@ -288,10 +288,13 @@ public class GameSession extends GameWatcher {
player.quit(game);
} catch (Exception ex) {
if (ex != null) {
// It seems this can happen if two threads try to end the game at the exact same time (one wins and one ends here)
logger.fatal("Game session game quit exception " + (ex.getMessage() == null ? "null":ex.getMessage()));
logger.debug("- gameId:" + game.getId() +" playerId: " + playerId);
if (ex.getCause() != null) {
logger.debug("- Cause: " + (ex.getCause().getMessage() == null ? "null":ex.getCause().getMessage()));
} else {
logger.debug("- ex: " + ex.toString());
}
ex.printStackTrace();
}else {

View file

@ -1749,7 +1749,7 @@ public abstract class PlayerImpl implements Player, Serializable {
}
}
if (opponentsAlive == 0 && !hasWon()) {
logger.debug("player won -> No more oppononets alive game won: " + this.getName());
logger.debug("player won -> No more opponents alive game won: " + this.getName());
game.informPlayers(new StringBuilder(this.getName()).append(" has won the game").toString());
this.wins = true;
game.end();