diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelHandler.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelHandler.kt index 27f2284e..5b46faf1 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelHandler.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelHandler.kt @@ -32,13 +32,13 @@ public class Js5ChannelHandler( private val gameId: Int, private val hostname: String, private val port: Int, - private var version: Int, + private var build: Int, private val continuation: Continuation, private val importer: CacheImporter, private val maxInFlightRequests: Int = 200, - maxVersionAttempts: Int = 10 + maxBuildAttempts: Int = 10 ) : SimpleChannelInboundHandler(Object::class.java) { - private val maxVersion = version + maxVersionAttempts + private val maxBuild = build + maxBuildAttempts private val inFlightRequests = mutableSetOf() private val pendingRequests = ArrayDeque() private var masterIndex: Js5MasterIndex? = null @@ -46,7 +46,7 @@ public class Js5ChannelHandler( private val groups = mutableListOf() override fun channelActive(ctx: ChannelHandlerContext) { - ctx.writeAndFlush(LoginRequest.InitJs5RemoteConnection(version), ctx.voidPromise()) + ctx.writeAndFlush(LoginRequest.InitJs5RemoteConnection(build), ctx.voidPromise()) ctx.read() } @@ -103,7 +103,7 @@ public class Js5ChannelHandler( } private fun handleClientOutOfDate(ctx: ChannelHandlerContext) { - if (++version > maxVersion) { + if (++build > maxBuild) { throw Exception("Failed to identify current version") } @@ -156,7 +156,7 @@ public class Js5ChannelHandler( Js5MasterIndex.read(uncompressed) } - val rawIndexes = runBlocking { importer.importMasterIndexAndGetIndexes(masterIndex!!, buf, gameId, version) } + val rawIndexes = runBlocking { importer.importMasterIndexAndGetIndexes(masterIndex!!, buf, gameId, build) } try { indexes = arrayOfNulls(rawIndexes.size) diff --git a/protocol/src/main/kotlin/org/openrs2/protocol/login/InitJs5RemoteConnectionCodec.kt b/protocol/src/main/kotlin/org/openrs2/protocol/login/InitJs5RemoteConnectionCodec.kt index 7aec2c71..24da7fb5 100644 --- a/protocol/src/main/kotlin/org/openrs2/protocol/login/InitJs5RemoteConnectionCodec.kt +++ b/protocol/src/main/kotlin/org/openrs2/protocol/login/InitJs5RemoteConnectionCodec.kt @@ -9,11 +9,11 @@ public object InitJs5RemoteConnectionCodec : PacketCodec