added method for updating expansions database

This commit is contained in:
North 2013-07-02 00:32:25 +03:00
parent d541779d66
commit e4ea8adf94
2 changed files with 17 additions and 3 deletions

View file

@ -30,6 +30,7 @@ package mage.interfaces;
import mage.MageException;
import mage.cards.decks.DeckCardLists;
import mage.cards.repository.ExpansionInfo;
import mage.game.GameException;
import mage.game.match.MatchOptions;
import mage.game.tournament.TournamentOptions;
@ -50,6 +51,9 @@ public interface MageServer {
boolean registerAdmin(String password, String sessionId, MageVersion version) throws MageException;
void deregisterClient(String sessionId) throws MageException;
// update methods
List<ExpansionInfo> getMissingExpansionData(List<String> codes);
// user methods
boolean setUserData(String userName, String sessionId, UserDataView userDataView) throws MageException;
void sendFeedbackMessage(String sessionId, String username, String title, String type, String message, String email) throws MageException;

View file

@ -30,6 +30,8 @@ package mage.server;
import mage.MageException;
import mage.cards.decks.DeckCardLists;
import mage.cards.repository.ExpansionInfo;
import mage.cards.repository.ExpansionRepository;
import mage.game.GameException;
import mage.game.match.MatchOptions;
import mage.game.tournament.TournamentOptions;
@ -59,9 +61,6 @@ import java.util.Locale;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
//import mage.interfaces.Server;
/**
*
* @author BetaSteward_at_googlemail.com, noxx
@ -914,4 +913,15 @@ public class MageServerImpl implements MageServer {
}
return action.negativeResult();
}
@Override
public List<ExpansionInfo> getMissingExpansionData(List<String> codes) {
List<ExpansionInfo> result = new ArrayList<ExpansionInfo>();
for (ExpansionInfo expansionInfo : ExpansionRepository.instance.getAll()) {
if (!codes.contains(expansionInfo.getCode())) {
result .add(expansionInfo);
}
}
return result;
}
}