forked from External/mage
Fixed a bug of handling of tournament sub tables if a user left. Some chnages to match view.
This commit is contained in:
parent
8dbd996646
commit
3699b7ca3d
11 changed files with 57 additions and 32 deletions
|
|
@ -181,10 +181,12 @@ public class TableManager {
|
|||
public void userQuitTournamentSubTables(UUID tournamentId, UUID userId) {
|
||||
for (TableController controller: controllers.values()) {
|
||||
if (controller.getTable().isTournamentSubTable() && controller.getTable().getTournament().getId().equals(tournamentId)) {
|
||||
Match match = controller.getTable().getMatch();
|
||||
if (match != null) {
|
||||
if (match.getGame() != null) {
|
||||
GameManager.getInstance().quitMatch(match.getGame().getId(), userId);
|
||||
if (controller.isPlayer(userId)) {
|
||||
Match match = controller.getTable().getMatch();
|
||||
if (match != null) {
|
||||
if (!match.hasEnded() && match.getGame() != null) {
|
||||
GameManager.getInstance().quitMatch(match.getGame().getId(), userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue