|
|
|
@ -35,7 +35,7 @@ public class Js5ChannelHandler( |
|
|
|
|
private val hostname: String, |
|
|
|
|
private val port: Int, |
|
|
|
|
private var build: Int, |
|
|
|
|
private val previousMasterIndexId: Int?, |
|
|
|
|
private val lastMasterIndexId: Int?, |
|
|
|
|
private val continuation: Continuation<Unit>, |
|
|
|
|
private val importer: CacheImporter, |
|
|
|
|
private val masterIndexFormat: MasterIndexFormat = MasterIndexFormat.VERSIONED, |
|
|
|
@ -45,7 +45,7 @@ public class Js5ChannelHandler( |
|
|
|
|
private val maxBuild = build + maxBuildAttempts |
|
|
|
|
private val inFlightRequests = mutableSetOf<Js5Request.Group>() |
|
|
|
|
private val pendingRequests = ArrayDeque<Js5Request.Group>() |
|
|
|
|
private var currentMasterIndexId: Int = 0 |
|
|
|
|
private var masterIndexId: Int = 0 |
|
|
|
|
private var masterIndex: Js5MasterIndex? = null |
|
|
|
|
private lateinit var indexes: Array<Js5Index?> |
|
|
|
|
private val groups = mutableListOf<CacheImporter.Group>() |
|
|
|
@ -144,7 +144,7 @@ public class Js5ChannelHandler( |
|
|
|
|
|
|
|
|
|
if (complete) { |
|
|
|
|
runBlocking { |
|
|
|
|
importer.setMasterIndexId(gameId, currentMasterIndexId) |
|
|
|
|
importer.setLastMasterIndexId(gameId, masterIndexId) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ctx.close() |
|
|
|
@ -164,7 +164,7 @@ public class Js5ChannelHandler( |
|
|
|
|
uncompressed, |
|
|
|
|
gameId, |
|
|
|
|
build, |
|
|
|
|
previousMasterIndexId, |
|
|
|
|
lastMasterIndexId, |
|
|
|
|
timestamp = Instant.now(), |
|
|
|
|
name |
|
|
|
|
) |
|
|
|
@ -183,7 +183,7 @@ public class Js5ChannelHandler( |
|
|
|
|
rawIndexes.filterNotNull().forEach(ByteBuf::release) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
currentMasterIndexId = id |
|
|
|
|
masterIndexId = id |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -202,7 +202,7 @@ public class Js5ChannelHandler( |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val groups = runBlocking { |
|
|
|
|
importer.importIndexAndGetMissingGroups(archive, index, buf, uncompressed, previousMasterIndexId) |
|
|
|
|
importer.importIndexAndGetMissingGroups(archive, index, buf, uncompressed, lastMasterIndexId) |
|
|
|
|
} |
|
|
|
|
for (group in groups) { |
|
|
|
|
request(archive, group) |
|
|
|
|