Merge changes

This commit is contained in:
magenoxx 2014-05-03 11:00:05 +05:30
commit 9f2466f42f
63 changed files with 1515 additions and 421 deletions

View file

@ -172,9 +172,7 @@ public class MageServerImpl implements MageServer {
logger.debug("Tournament table " + table.getTableId() + " created");
LogServiceImpl.instance.log(LogKeys.KEY_TOURNAMENT_TABLE_CREATED, sessionId, userId.toString(), table.getTableId().toString());
return table;
} catch (NumberFormatException ex) {
handleException(ex);
} catch (MageException ex) {
} catch (Exception ex) {
handleException(ex);
}
return null;

View file

@ -284,11 +284,7 @@ public class Main {
return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance();
} catch (ClassNotFoundException ex) {
logger.warn("Game type not found:" + plugin.getJar() + " - check plugin folder", ex);
} catch (IllegalAccessException ex) {
logger.fatal("Error loading game type " + plugin.getJar(), ex);
} catch (InstantiationException ex) {
logger.fatal("Error loading game type " + plugin.getJar(), ex);
} catch (MalformedURLException ex) {
} catch (Exception ex) {
logger.fatal("Error loading game type " + plugin.getJar(), ex);
}
return null;
@ -301,11 +297,7 @@ public class Main {
return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance();
} catch (ClassNotFoundException ex) {
logger.warn("Tournament type not found:" + plugin.getName() + " / "+ plugin.getJar() + " - check plugin folder", ex);
} catch (IllegalAccessException ex) {
logger.fatal("Error loading game type " + plugin.getJar(), ex);
} catch (InstantiationException ex) {
logger.fatal("Error loading game type " + plugin.getJar(), ex);
} catch (MalformedURLException ex) {
} catch (Exception ex) {
logger.fatal("Error loading game type " + plugin.getJar(), ex);
}
return null;

View file

@ -593,7 +593,6 @@ public class TableController {
* @return true if table can be closed
*/
public boolean endGameAndStartNextGame() {
boolean matchIsOver = false;
// get player that chooses who goes first
UUID choosingPlayerId = match.getChooser();
match.endGame();
@ -604,27 +603,24 @@ public class TableController {
}
GameManager.getInstance().removeGame(match.getGame().getId());
try {
if (!match.isMatchOver()) {
if (!match.hasEnded()) {
table.sideboard();
setupTimeout(Match.SIDEBOARD_TIME);
match.sideboard();
cancelTimeout();
if (!match.isMatchOver()) {
if (!match.hasEnded()) {
startGame(choosingPlayerId);
} else {
matchIsOver = true;
closeTable();
}
}
else {
// if match has only one game
matchIsOver = true;
closeTable();
}
} catch (GameException ex) {
logger.fatal(null, ex);
}
return matchIsOver;
return match.hasEnded();
}
/**

View file

@ -412,7 +412,7 @@ public class GameController implements GameCallback {
.append(ConfigSettings.getInstance().getMaxSecondsIdle())
.append(" seconds ) - Auto concede.");
ChatManager.getInstance().broadcast(chatId, "", sb.toString() , MessageColor.BLACK, true, MessageType.STATUS);
concede(userId);
game.idleTimeout(getPlayerId(userId));
}
}