Add support for fetching master index from the API

Signed-off-by: Graham <gpe@openrs2.org>
master
Graham 2 years ago
parent 9d3282ca3a
commit ea9ec62e6e
  1. 20
      archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt

@ -588,6 +588,26 @@ public class CacheExporter @Inject constructor(
public suspend fun exportGroup(scope: String, id: Int, archive: Int, group: Int): ByteBuf? {
return database.execute { connection ->
if (archive == Store.ARCHIVESET && group == Store.ARCHIVESET) {
connection.prepareStatement(
"""
SELECT c.data
FROM master_indexes m
JOIN containers c ON c.id = m.container_id
WHERE m.id = ?
""".trimIndent()
).use { stmt ->
stmt.setInt(1, id)
stmt.executeQuery().use { rows ->
if (rows.next()) {
val data = rows.getBytes(1)
return@execute Unpooled.wrappedBuffer(data)
}
}
}
}
connection.prepareStatement(
"""
SELECT g.data

Loading…
Cancel
Save