Added a check to TableController.

This commit is contained in:
LevelX2 2013-07-02 23:42:33 +02:00
parent 7b260c960b
commit 05b221fbbf

View file

@ -145,6 +145,7 @@ public class TableController {
throw new GameException("No available seats.");
}
Player player = createPlayer(name, seat.getPlayerType(), skill);
if (player != null) {
tournament.addPlayer(player, seat.getPlayerType());
table.joinTable(player, seat);
User user = UserManager.getInstance().getUser(userId);
@ -157,6 +158,9 @@ public class TableController {
}
return true;
} else {
throw new GameException("Playertype " + seat.getPlayerType().toString() + " could not be created.");
}
}
public synchronized boolean joinTable(UUID userId, String name, String playerType, int skill, DeckCardLists deckList) throws MageException {