|
|
@ -3,6 +3,7 @@ package org.openrs2.archive.key |
|
|
|
import com.github.michaelbull.logging.InlineLogger |
|
|
|
import com.github.michaelbull.logging.InlineLogger |
|
|
|
import org.openrs2.crypto.XteaKey |
|
|
|
import org.openrs2.crypto.XteaKey |
|
|
|
import org.openrs2.db.Database |
|
|
|
import org.openrs2.db.Database |
|
|
|
|
|
|
|
import java.io.IOException |
|
|
|
import java.nio.file.Files |
|
|
|
import java.nio.file.Files |
|
|
|
import java.nio.file.Path |
|
|
|
import java.nio.file.Path |
|
|
|
import java.sql.Connection |
|
|
|
import java.sql.Connection |
|
|
@ -75,10 +76,15 @@ public class KeyImporter @Inject constructor( |
|
|
|
|
|
|
|
|
|
|
|
for (downloader in downloaders) { |
|
|
|
for (downloader in downloaders) { |
|
|
|
for (url in downloader.getMissingUrls(seenUrls)) { |
|
|
|
for (url in downloader.getMissingUrls(seenUrls)) { |
|
|
|
|
|
|
|
try { |
|
|
|
keys += downloader.download(url).map { key -> |
|
|
|
keys += downloader.download(url).map { key -> |
|
|
|
Key(key, downloader.source) |
|
|
|
Key(key, downloader.source) |
|
|
|
} |
|
|
|
} |
|
|
|
urls += url |
|
|
|
urls += url |
|
|
|
|
|
|
|
} catch (ex: IOException) { |
|
|
|
|
|
|
|
logger.warn(ex) { "Failed to download keys from ${downloader.source.name}" } |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|