Fixed a bug of handling of tournament sub tables if a user left. Some chnages to match view.

This commit is contained in:
LevelX2 2014-09-04 18:20:40 +02:00
parent 8dbd996646
commit 3699b7ca3d
11 changed files with 57 additions and 32 deletions

View file

@ -181,10 +181,12 @@ public class TableManager {
public void userQuitTournamentSubTables(UUID tournamentId, UUID userId) {
for (TableController controller: controllers.values()) {
if (controller.getTable().isTournamentSubTable() && controller.getTable().getTournament().getId().equals(tournamentId)) {
Match match = controller.getTable().getMatch();
if (match != null) {
if (match.getGame() != null) {
GameManager.getInstance().quitMatch(match.getGame().getId(), userId);
if (controller.isPlayer(userId)) {
Match match = controller.getTable().getMatch();
if (match != null) {
if (!match.hasEnded() && match.getGame() != null) {
GameManager.getInstance().quitMatch(match.getGame().getId(), userId);
}
}
}
}