A cache library written in Kotlin.
- RS2 (414-772)
- RS3 (773-~788)
- OSRS (1-current)
- Cache Reading
- Definitions/Providers Loading
- Very Fast (Limited by I/O)
- Cache Writing
- Flat File System
- Ondemand Data Caching
- 317 and older support
- Tests
Just use cache if you do not require any of the revision specific loaders.
cache = { module = "com.runetopic.cache:cache", version.ref "2.0.0-SNAPSHOT" }
//SNAPSHOTS
maven {
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
Index -> Group -> File
val store = Js5Store(path = Path.of("/path/"), parallel = true)
val index = store.index(indexId = 5)
val index = store.index(indexId = 5)
val group = index.group(groupId = 360)
val index = store.index(indexId = 5)
val group = index.group(groupName = "m50_50")
val index = store.index(indexId = 2)
val group = index.group(groupId = 26)
val file = group.file(fileId = 1000)
store.index(indexId = 19).use { index ->
(0 until index.expand()).forEach {
val data = index.group(it ushr 8).file(it and 0xFF).data
}
}
store.index(indexId = 2).group(groupId = 26).files().forEach {
val id = it.id
val data = it.data
}
val size = store.groupReferenceTable(indexId = 255, groupId = 255)
val size = store.indexReferenceTableSize(indexId = 28)
val size = store.groupReferenceTableSize(indexId = 30, groupName = "windows/x86/jaclib.dll")
val size = store.groupReferenceTableSize(indexId = 30, groupId = 6)
val checksums = store.checksumsWithRSA(exponent = BigInteger(""), modulus = BigInteger(""))
val checksums = store.checksumsWithoutRSA()
val objProvider = objs().load(store)
val npcProvider = npcs().load(store)
val locProvider = locs().load(store)
val particleProvider = particles().load(store)
val pool = Executors.newFixedThreadPool(4)
val providers = listOf(
objs(),
npcs(),
locs(),
particles()
)
val latch = CountDownLatch(providers.size)
providers.forEach {
pool.execute {
it.load(store)
latch.countDown()
}
}
latch.await()
pool.shutdown()
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to write unit test and or update any test that might have been impacted.