update deck every 5 seconds while constructing or sideboarding

This commit is contained in:
BetaSteward 2011-09-04 13:23:16 -04:00
parent beb2eb8e27
commit fe79ee97a9
15 changed files with 161 additions and 16 deletions

View file

@ -217,6 +217,22 @@ public class MageServerImpl implements MageServer {
}
@Override
public void updateDeck(String sessionId, UUID tableId, DeckCardLists deckList) throws MageException, GameException {
try {
if (SessionManager.getInstance().isValidSession(sessionId)) {
UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
TableManager.getInstance().updateDeck(userId, tableId, deckList);
logger.debug("Session " + sessionId + " updated deck");
}
}
catch (Exception ex) {
if (ex instanceof GameException)
throw (GameException)ex;
handleException(ex);
}
}
@Override
public List<TableView> getTables(UUID roomId) throws MageException {
try {
return GamesRoomManager.getInstance().getRoom(roomId).getTables();