Removing loading requirements from the NXT downloader

Signed-off-by: Graham <gpe@openrs2.org>
master
Graham 2 years ago
parent 4cc83e6316
commit d0a46dc5e5
  1. 25
      archive/src/main/kotlin/org/openrs2/archive/cache/nxt/Js5OkCodec.kt
  2. 7
      archive/src/main/kotlin/org/openrs2/archive/cache/nxt/LoginResponse.kt

@ -1,25 +1,8 @@
package org.openrs2.archive.cache.nxt package org.openrs2.archive.cache.nxt
import io.netty.buffer.ByteBuf import org.openrs2.protocol.EmptyPacketCodec
import org.openrs2.crypto.StreamCipher
import org.openrs2.protocol.FixedPacketCodec
public object Js5OkCodec : FixedPacketCodec<LoginResponse.Js5Ok>( public object Js5OkCodec : EmptyPacketCodec<LoginResponse.Js5Ok>(
type = LoginResponse.Js5Ok::class.java,
opcode = 0, opcode = 0,
length = LoginResponse.Js5Ok.LOADING_REQUIREMENTS * 4 packet = LoginResponse.Js5Ok
) { )
override fun decode(input: ByteBuf, cipher: StreamCipher): LoginResponse.Js5Ok {
val loadingRequirements = mutableListOf<Int>()
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)
}
}
}

@ -3,11 +3,6 @@ package org.openrs2.archive.cache.nxt
import org.openrs2.protocol.Packet import org.openrs2.protocol.Packet
public sealed class LoginResponse : Packet { public sealed class LoginResponse : Packet {
public data class Js5Ok(val loadingRequirements: List<Int>) : LoginResponse() { public object Js5Ok : LoginResponse()
public companion object {
public const val LOADING_REQUIREMENTS: Int = 32
}
}
public object ClientOutOfDate : LoginResponse() public object ClientOutOfDate : LoginResponse()
} }

Loading…
Cancel
Save