From f3ea8e71fef1d30b131867a1ed4960f8c23157b6 Mon Sep 17 00:00:00 2001 From: Graham Date: Wed, 13 Jan 2021 19:02:29 +0000 Subject: [PATCH] Rename version to build Signed-off-by: Graham --- .../org/openrs2/archive/cache/Js5ChannelHandler.kt | 12 ++++++------ .../protocol/login/InitJs5RemoteConnectionCodec.kt | 6 +++--- .../org/openrs2/protocol/login/LoginRequest.kt | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) 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 27f2284e2e..5b46faf1c3 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 7aec2c7196..24da7fb572 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