}
Seat seat = table.getNextAvailableSeat();
if (seat == null) {
throw new GameException("No available seats.");
}
Deck deck = Deck.load(deckList);
if (!Main.server.isTestMode() && !validDeck(deck)) {
throw new GameException(name + " has an invalid deck for this format");
}
Player player = createPlayer(name, deck, seat.getPlayerType());
game.loadCards(deck.getCards(), player.getId());
game.loadCards(deck.getSideboard(), player.getId());
table.joinTable(player, seat);
logger.info("player joined " + player.getId());
//only add human players to sessionPlayerMap
if (seat.getPlayer().isHuman()) {
sessionPlayerMap.put(sessionId, player.getId());