Further check on joining multiple league games at the same times.

This commit is contained in:
marcins78
2013-12-19 10:29:58 +00:00
parent a905edf05f
commit 9012bbe072

View File

@@ -279,10 +279,15 @@ public class HallServer extends AbstractServer {
if (awaitingTable.hasPlayer(player.getName())) if (awaitingTable.hasPlayer(player.getName()))
throw new HallException("You can't play against yourself"); throw new HallException("You can't play against yourself");
if (awaitingTable.getLeague() != null && !_leagueService.isPlayerInLeague(awaitingTable.getLeague(), player)) final League league = awaitingTable.getLeague();
throw new HallException("You're not in that league"); if (league != null) {
if (!_leagueService.isPlayerInLeague(league, player))
throw new HallException("You're not in that league");
LotroDeck lotroDeck = validateUserAndDeck(awaitingTable.getLotroFormat(), player, deckName, awaitingTable.getCollectionType(), awaitingTable.getLeague() != null); verifyNotPlayingLeagueGame(player, league);
}
LotroDeck lotroDeck = validateUserAndDeck(awaitingTable.getLotroFormat(), player, deckName, awaitingTable.getCollectionType(), league != null);
joinTableInternal(tableId, player.getName(), awaitingTable, lotroDeck); joinTableInternal(tableId, player.getName(), awaitingTable, lotroDeck);