Fixed some bugs in table handling. Fixed that matches were not set to finished yet, if players left match during sideboarding phase.

This commit is contained in:
LevelX2 2014-02-07 02:04:14 +01:00
parent df9c200753
commit 40c25fae34
25 changed files with 274 additions and 140 deletions

View file

@ -87,9 +87,10 @@ public class SessionImpl implements Session {
private static final Logger logger = Logger.getLogger(SessionImpl.class);
private final MageClient client;
private String sessionId;
private MageServer server;
private MageClient client;
private Client callbackClient;
private CallbackHandler callbackHandler;
private ServerState serverState;
@ -828,6 +829,7 @@ public class SessionImpl implements Session {
try {
if (isConnected()) {
server.removeTable(sessionId, roomId, tableId);
return true;
}
} catch (MageException ex) {
@ -1275,8 +1277,8 @@ public class SessionImpl implements Session {
}
class MageAuthenticator extends Authenticator {
private String username;
private String password;
private final String username;
private final String password;
public MageAuthenticator(String username, String password) {
this.username = username;

View file

@ -44,17 +44,18 @@ import mage.game.tournament.TournamentPlayer;
*/
public class MatchView implements Serializable {
private UUID matchId;
private String matchName;
private final UUID matchId;
private final String matchName;
private String gameType;
private String deckType;
private final String deckType;
private List<UUID> games = new ArrayList<UUID>();
private String result;
private String players;
private final List<UUID> games = new ArrayList<UUID>();
private final String result;
private final String players;
private Date startTime;
private Date endTime;
private final Date startTime;
private final Date endTime;
private final Boolean replayAvailable;
public MatchView(Match match) {
this.matchId = match.getId();
@ -79,6 +80,7 @@ public class MatchView implements Serializable {
result = sb2.substring(0, sb2.length() - 2);
this.startTime = match.getStartTime();
this.endTime = match.getEndTime();
this.replayAvailable = match.isReplayAvailable();
}
// used for tournaments
@ -107,6 +109,7 @@ public class MatchView implements Serializable {
this.result = sb2.toString();
this.startTime = table.getTournament().getStartTime();
this.endTime = table.getTournament().getEndTime();
this.replayAvailable = false;
}
public UUID getMatchId() {
@ -144,4 +147,13 @@ public class MatchView implements Serializable {
public Date getEndTime() {
return endTime;
}
public String getMatchName() {
return matchName;
}
public Boolean isReplayAvailable() {
return replayAvailable;
}
}