From d0a46dc5e52bdd9a85f35f4094f0104987f13069 Mon Sep 17 00:00:00 2001 From: Graham Date: Tue, 30 Aug 2022 17:57:17 +0100 Subject: [PATCH] Removing loading requirements from the NXT downloader Signed-off-by: Graham --- .../openrs2/archive/cache/nxt/Js5OkCodec.kt | 25 +++---------------- .../archive/cache/nxt/LoginResponse.kt | 7 +----- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/nxt/Js5OkCodec.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/nxt/Js5OkCodec.kt index bd26525bf9..0d4334310d 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/nxt/Js5OkCodec.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/nxt/Js5OkCodec.kt @@ -1,25 +1,8 @@ package org.openrs2.archive.cache.nxt -import io.netty.buffer.ByteBuf -import org.openrs2.crypto.StreamCipher -import org.openrs2.protocol.FixedPacketCodec +import org.openrs2.protocol.EmptyPacketCodec -public object Js5OkCodec : FixedPacketCodec( - type = LoginResponse.Js5Ok::class.java, +public object Js5OkCodec : EmptyPacketCodec( opcode = 0, - length = LoginResponse.Js5Ok.LOADING_REQUIREMENTS * 4 -) { - override fun decode(input: ByteBuf, cipher: StreamCipher): LoginResponse.Js5Ok { - val loadingRequirements = mutableListOf() - for (i in 0 until LoginResponse.Js5Ok.LOADING_REQUIREMENTS) { - loadingRequirements += input.readInt() - } - return LoginResponse.Js5Ok(loadingRequirements) - } - - override fun encode(input: LoginResponse.Js5Ok, output: ByteBuf, cipher: StreamCipher) { - for (requirement in input.loadingRequirements) { - output.writeInt(requirement) - } - } -} + packet = LoginResponse.Js5Ok +) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/nxt/LoginResponse.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/nxt/LoginResponse.kt index 84ec8c08c5..7bdaa98485 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/nxt/LoginResponse.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/nxt/LoginResponse.kt @@ -3,11 +3,6 @@ package org.openrs2.archive.cache.nxt import org.openrs2.protocol.Packet public sealed class LoginResponse : Packet { - public data class Js5Ok(val loadingRequirements: List) : LoginResponse() { - public companion object { - public const val LOADING_REQUIREMENTS: Int = 32 - } - } - + public object Js5Ok : LoginResponse() public object ClientOutOfDate : LoginResponse() }