mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Minor changes to logging.
This commit is contained in:
parent
4a2be2c3e6
commit
1241f6582b
2 changed files with 4 additions and 1 deletions
|
@ -288,10 +288,13 @@ public class GameSession extends GameWatcher {
|
||||||
player.quit(game);
|
player.quit(game);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
if (ex != null) {
|
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.fatal("Game session game quit exception " + (ex.getMessage() == null ? "null":ex.getMessage()));
|
||||||
logger.debug("- gameId:" + game.getId() +" playerId: " + playerId);
|
logger.debug("- gameId:" + game.getId() +" playerId: " + playerId);
|
||||||
if (ex.getCause() != null) {
|
if (ex.getCause() != null) {
|
||||||
logger.debug("- Cause: " + (ex.getCause().getMessage() == null ? "null":ex.getCause().getMessage()));
|
logger.debug("- Cause: " + (ex.getCause().getMessage() == null ? "null":ex.getCause().getMessage()));
|
||||||
|
} else {
|
||||||
|
logger.debug("- ex: " + ex.toString());
|
||||||
}
|
}
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}else {
|
}else {
|
||||||
|
|
|
@ -1749,7 +1749,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (opponentsAlive == 0 && !hasWon()) {
|
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());
|
game.informPlayers(new StringBuilder(this.getName()).append(" has won the game").toString());
|
||||||
this.wins = true;
|
this.wins = true;
|
||||||
game.end();
|
game.end();
|
||||||
|
|
Loading…
Reference in a new issue