mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Started fixing that match does not end, if player left mage during sideboarding (not finished yet).
This commit is contained in:
parent
94109b5e2e
commit
1016decf07
2 changed files with 12 additions and 4 deletions
|
@ -186,9 +186,13 @@ public class Table implements Serializable {
|
|||
for (int i = 0; i < numSeats; i++ ) {
|
||||
Player player = seats[i].getPlayer();
|
||||
if (player != null && player.getId().equals(playerId)) {
|
||||
seats[i].setPlayer(null);
|
||||
if (state == TableState.STARTING) {
|
||||
state = TableState.WAITING;
|
||||
if (match != null) {
|
||||
match.leave(playerId);
|
||||
} else {
|
||||
seats[i].setPlayer(null);
|
||||
if (state == TableState.STARTING) {
|
||||
state = TableState.WAITING;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,11 @@ public abstract class MatchImpl implements Match {
|
|||
public boolean leave(UUID playerId) {
|
||||
MatchPlayer mPlayer = getPlayer(playerId);
|
||||
if (mPlayer != null) {
|
||||
return players.remove(mPlayer);
|
||||
boolean result = players.remove(mPlayer);
|
||||
synchronized (this) {
|
||||
this.notifyAll();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue