* Improved connection performance on new release, no more empty cards on startup;

This commit is contained in:
Oleg Agafonov 2019-03-01 18:55:20 +04:00
parent 6846db75f4
commit f788af1f6a
4 changed files with 20 additions and 10 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.CardScanner;
import mage.cards.repository.ExpansionRepository;
import mage.cards.repository.RepositoryUtil;
import mage.client.cards.BigCard;
@ -215,7 +216,15 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
LOGGER.fatal(null, ex);
}
// DATA PREPARE
RepositoryUtil.bootstrapLocalDb();
// re-create database on empty (e.g. after new build cleaned db on startup)
if (RepositoryUtil.CARD_DB_RECREATE_BY_CLIENT_SIDE && RepositoryUtil.isDatabaseEmpty()) {
LOGGER.info("DB: creating cards database");
CardScanner.scan();
LOGGER.info("Done.");
}
if (RateCard.PRELOAD_CARD_RATINGS_ON_STARTUP) {
RateCard.bootstrapCardsAndRatings();
}