mirror of
https://github.com/correl/mage.git
synced 2024-12-24 03:00:14 +00:00
* Some minor changes to server logging.
This commit is contained in:
parent
13ca02536e
commit
6434df04b2
3 changed files with 12 additions and 9 deletions
|
@ -242,10 +242,10 @@ public class MageServerImpl implements MageServer {
|
|||
@Override
|
||||
public Boolean execute() throws MageException {
|
||||
UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
|
||||
if (logger.isDebugEnabled()) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
User user = UserManager.getInstance().getUser(userId);
|
||||
if (user != null) {
|
||||
logger.debug("join tourn. tableId: " + tableId + " " + name);
|
||||
logger.trace("join tourn. tableId: " + tableId + " " + name);
|
||||
}
|
||||
}
|
||||
if (userId == null) {
|
||||
|
|
|
@ -375,14 +375,17 @@ public class TableController {
|
|||
}
|
||||
|
||||
private void updateDeck(UUID userId, UUID playerId, Deck deck) {
|
||||
if (table.getState() == TableState.SIDEBOARDING) {
|
||||
match.updateDeck(playerId, deck);
|
||||
}
|
||||
else {
|
||||
if (table.isTournament()) {
|
||||
if (tournament != null) {
|
||||
TournamentManager.getInstance().updateDeck(tournament.getId(), playerId, deck);
|
||||
} else {
|
||||
logger.fatal("Tournament == null table: " + table.getId());
|
||||
logger.fatal("Tournament == null table: " + table.getId() +" userId: " + userId);
|
||||
}
|
||||
} else {
|
||||
if (TableState.SIDEBOARDING.equals(table.getState())) {
|
||||
match.updateDeck(playerId, deck);
|
||||
} else {
|
||||
// deck was meanwhile submitted so the autoupdate can be ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public class PlayerFactory {
|
|||
private static final PlayerFactory INSTANCE = new PlayerFactory();
|
||||
private static final Logger logger = Logger.getLogger(PlayerFactory.class);
|
||||
|
||||
private Map<String, Class> playerTypes = new LinkedHashMap<String, Class>();
|
||||
private final Map<String, Class> playerTypes = new LinkedHashMap<>();
|
||||
|
||||
public static PlayerFactory getInstance() {
|
||||
return INSTANCE;
|
||||
|
@ -61,7 +61,7 @@ public class PlayerFactory {
|
|||
if (playerTypeClass != null) {
|
||||
con = playerTypeClass.getConstructor(new Class[]{String.class, RangeOfInfluence.class, int.class});
|
||||
player = (Player)con.newInstance(new Object[] {name, range, skill});
|
||||
logger.debug("Player created: " + name + "-" + player.getId().toString());
|
||||
logger.debug("Player created: " + name + " - " + player.getId());
|
||||
return player;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue