forked from External/mage
Fixed a bug that while a match or tournament was just starting a player could still leave the table, setting the table / tournament / match to an undefined state. Now the player can only leave the Match / Tournament if it has started properly.
This commit is contained in:
parent
3f5f6a6166
commit
fec0744315
10 changed files with 159 additions and 100 deletions
|
|
@ -219,15 +219,15 @@ class TableListSorter implements Comparator<Table> {
|
|||
@Override
|
||||
public int compare(Table one, Table two) {
|
||||
// priority 1 - Not started yet
|
||||
if (one.getState().equals(TableState.STARTING) || one.getState().equals(TableState.WAITING)) {
|
||||
if (two.getState().equals(TableState.STARTING) || two.getState().equals(TableState.WAITING)) {
|
||||
if (one.getState().equals(TableState.READY_TO_START) || one.getState().equals(TableState.WAITING)) {
|
||||
if (two.getState().equals(TableState.READY_TO_START) || two.getState().equals(TableState.WAITING)) {
|
||||
return two.getCreateTime().compareTo(one.getCreateTime());
|
||||
} else {
|
||||
return -1; // one has higher priority
|
||||
}
|
||||
}
|
||||
// priority 2 - Not finished yet -> Sorted by time started
|
||||
if (two.getState().equals(TableState.STARTING) || two.getState().equals(TableState.WAITING)) {
|
||||
if (two.getState().equals(TableState.READY_TO_START) || two.getState().equals(TableState.WAITING)) {
|
||||
return 1; // two has higher priority
|
||||
} else if (one.getEndTime() == null) {
|
||||
if (two.getEndTime() == null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue