use of net.runelite.http.service.cache.beans.ArchiveEntry in project runelite by runelite.
the class XteaService method checkKeys.
private boolean checkKeys(CacheEntry cache, int regionId, int[] keys) {
int x = regionId >>> 8;
int y = regionId & 0xFF;
String archiveName = new StringBuilder().append('l').append(x).append('_').append(y).toString();
int archiveNameHash = Djb2.hash(archiveName);
ArchiveEntry archiveEntry = cacheService.findArchiveForTypeAndName(cache, IndexType.MAPS, archiveNameHash);
if (archiveEntry == null) {
throw new InternalServerErrorException("Unable to find archive for region");
}
byte[] data = cacheService.getArchive(archiveEntry);
if (data == null) {
throw new InternalServerErrorException("Unable to get archive data");
}
try {
Container.decompress(data, keys);
return true;
} catch (IOException ex) {
return false;
}
}
Aggregations