Added check to limit the number of waiting tables a player can create at the same time.

This commit is contained in:
LevelX2 2016-03-26 10:42:02 +01:00
parent 04c8351712
commit fa5dd387b4
4 changed files with 124 additions and 45 deletions

View file

@ -900,6 +900,22 @@ public class TableController {
return null;
}
public boolean isUserStillActive(UUID userId) {
UUID playerId = userPlayerMap.get(userId);
if (playerId != null) {
if (tournament != null) {
TournamentPlayer tournamentPlayer = tournament.getPlayer(playerId);
if (tournamentPlayer != null) {
return tournamentPlayer.isInTournament();
}
} else if (match != null) {
MatchPlayer matchPlayer = match.getPlayer(playerId);
return matchPlayer != null && !matchPlayer.hasQuit();
}
}
return false;
}
public boolean isMatchTableStillValid() {
// check only normal match table with state != Finished
if (!table.isTournament()) {