* Server - Some changes to user / match / table handling.

This commit is contained in:
LevelX2 2014-09-07 02:28:47 +02:00
parent 5b34b46eac
commit c3c77e3974
13 changed files with 164 additions and 70 deletions

View file

@ -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.READY_TO_START) || one.getState().equals(TableState.WAITING)) {
if (two.getState().equals(TableState.READY_TO_START) || two.getState().equals(TableState.WAITING)) {
if (one.getState().equals(TableState.READY_TO_START) || one.getState().equals(TableState.WAITING) || one.getState().equals(TableState.STARTING)) {
if (two.getState().equals(TableState.READY_TO_START) || two.getState().equals(TableState.WAITING) || two.getState().equals(TableState.STARTING)) {
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.READY_TO_START) || two.getState().equals(TableState.WAITING)) {
if (two.getState().equals(TableState.READY_TO_START) || two.getState().equals(TableState.WAITING) || two.getState().equals(TableState.STARTING)) {
return 1; // two has higher priority
} else if (one.getEndTime() == null) {
if (two.getEndTime() == null) {