Merge pull request #9152 from sprangg/LimitedFix

Improvements to constructed matches with limited decks
This commit is contained in:
Oleg Agafonov 2022-06-24 17:25:37 +04:00 committed by GitHub
commit 72ec981508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -604,7 +604,7 @@ public class NewTableDialog extends MageDialog {
options.getPlayerTypes().add(player.getPlayerType());
}
options.setDeckType((String) this.cbDeckType.getSelectedItem());
options.setLimited(false);
options.setLimited(options.getDeckType().startsWith("Limited"));
options.setMatchTimeLimit((MatchTimeLimit) this.cbTimeLimit.getSelectedItem());
options.setAttackOption((MultiplayerAttackOption) this.cbAttackOption.getSelectedItem());
options.setSkillLevel((SkillLevel) this.cbSkillLevel.getSelectedItem());

View file

@ -1314,7 +1314,7 @@ public class NewTournamentDialog extends MageDialog {
tOptions.getLimitedOptions().setDraftCubeName("");
tOptions.getMatchOptions().setDeckType((String) this.cbDeckType.getSelectedItem());
tOptions.getMatchOptions().setGameType(((GameTypeView) this.cbGameType.getSelectedItem()).getName());
tOptions.getMatchOptions().setLimited(false);
tOptions.getMatchOptions().setLimited(tOptions.getMatchOptions().getDeckType().startsWith("Limited"));
}
String serverAddress = SessionHandler.getSession().getServerHostname().orElse("");

View file

@ -425,7 +425,7 @@ public class TablesPanel extends javax.swing.JPanel {
UUID tableId = (UUID) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN + 3);
UUID gameId = (UUID) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN + 2);
String action = (String) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN);
String deckType = (String) tableModel.getValueAt(modelRow, TablesTableModel.COLUMN_DECK_TYPE);
String gameType = (String) tableModel.getValueAt(modelRow, TablesTableModel.COLUMN_GAME_TYPE);
boolean isTournament = (Boolean) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN + 1);
String owner = (String) tableModel.getValueAt(modelRow, TablesTableModel.COLUMN_OWNER);
String pwdColumn = (String) tableModel.getValueAt(modelRow, TablesTableModel.COLUMN_PASSWORD);
@ -454,14 +454,14 @@ public class TablesPanel extends javax.swing.JPanel {
}
if (isTournament) {
LOGGER.info("Joining tournament " + tableId);
if (deckType.startsWith("Limited")) {
if (!gameType.startsWith("Constructed")) {
if (TablesTableModel.PASSWORD_VALUE_YES.equals(pwdColumn)) {
joinTableDialog.showDialog(roomId, tableId, true, deckType.startsWith("Limited"));
joinTableDialog.showDialog(roomId, tableId, true, !gameType.startsWith("Constructed"));
} else {
SessionHandler.joinTournamentTable(roomId, tableId, SessionHandler.getUserName(), PlayerType.HUMAN, 1, null, "");
}
} else {
joinTableDialog.showDialog(roomId, tableId, true, deckType.startsWith("Limited"));
joinTableDialog.showDialog(roomId, tableId, true, !gameType.startsWith("Constructed"));
}
} else {
LOGGER.info("Joining table " + tableId);