mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
Added a check to TableController.
This commit is contained in:
parent
7b260c960b
commit
05b221fbbf
1 changed files with 15 additions and 11 deletions
|
|
@ -145,6 +145,7 @@ public class TableController {
|
||||||
throw new GameException("No available seats.");
|
throw new GameException("No available seats.");
|
||||||
}
|
}
|
||||||
Player player = createPlayer(name, seat.getPlayerType(), skill);
|
Player player = createPlayer(name, seat.getPlayerType(), skill);
|
||||||
|
if (player != null) {
|
||||||
tournament.addPlayer(player, seat.getPlayerType());
|
tournament.addPlayer(player, seat.getPlayerType());
|
||||||
table.joinTable(player, seat);
|
table.joinTable(player, seat);
|
||||||
User user = UserManager.getInstance().getUser(userId);
|
User user = UserManager.getInstance().getUser(userId);
|
||||||
|
|
@ -157,6 +158,9 @@ public class TableController {
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
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 {
|
public synchronized boolean joinTable(UUID userId, String name, String playerType, int skill, DeckCardLists deckList) throws MageException {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue