Fixed cards db updates on auto-connection enabled;

This commit is contained in:
Oleg Agafonov 2019-01-12 23:41:12 +04:00
parent d98a3eb30a
commit 152c354ec3
2 changed files with 114 additions and 129 deletions

View file

@ -3,6 +3,7 @@ package mage.client;
import mage.cards.action.ActionCallback;
import mage.cards.decks.Deck;
import mage.cards.repository.CardRepository;
import mage.cards.repository.ExpansionRepository;
import mage.cards.repository.RepositoryUtil;
import mage.client.cards.BigCard;
import mage.client.chat.ChatPanelBasic;
@ -719,6 +720,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
boolean autoConnectParamValue = startUser != null || Boolean.parseBoolean(PREFS.get("autoConnect", "false"));
boolean status = false;
if (autoConnectParamValue) {
LOGGER.info("Auto-connecting to " + MagePreferences.getServerAddress());
status = performConnect(false);
}
return status;
@ -741,6 +743,9 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
currentConnection.setPassword(password);
currentConnection.setHost(server);
currentConnection.setPort(port);
// force to redownload db on updates
boolean redownloadDatabase = (ExpansionRepository.instance.getSetByCode("GRN") == null || CardRepository.instance.findCard("Island") == null);
currentConnection.setForceDBComparison(redownloadDatabase);
String allMAC = "";
try {
allMAC = Connection.getMAC();