Fixed a bug of handling of tournament sub tables if a user left. Some changes to match view.

This commit is contained in:
LevelX2 2014-09-04 19:03:48 +02:00
parent 3699b7ca3d
commit d051aef63f
3 changed files with 9 additions and 4 deletions

View file

@ -698,7 +698,7 @@ class TableTableModel extends AbstractTableModel {
public static final int ACTION_COLUMN = 9; // column the action is located (starting with 0)
private final String[] columnNames = new String[]{"Match Name", "Owner / Players", "Game Type", "Wins", "Free Mulligans", "Deck Type", "Info", "Status", "Created", "Action"};
private final String[] columnNames = new String[]{"Match Name", "Owner / Players", "Game Type", "Wins", "Free Mulligans", "Deck Type", "Info", "Status", "Created / Started", "Action"};
private TableView[] tables = new TableView[0];
private static final DateFormat timeFormatter = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);

View file

@ -67,7 +67,9 @@ public class TableView implements Serializable {
this.tableName = table.getName();
this.controllerName = table.getControllerName();
this.tableState = table.getState();
if (table.getState().equals(TableState.WAITING) || table.getState().equals(TableState.WAITING)) {
if (table.getState().equals(TableState.WAITING) ||
table.getState().equals(TableState.READY_TO_START) ||
table.getState().equals(TableState.STARTING) ) {
this.createTime = table.getCreateTime();
} else {
if (table.isTournament()) {

View file

@ -350,10 +350,13 @@ public abstract class MatchImpl implements Match {
sb.append("\nGame has started\n");
return sb.toString();
}
@Override
public Date getStartTime() {
return new Date(startTime.getTime());
if (startTime != null) {
return new Date(startTime.getTime());
}
return null;
}
@Override