Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
886 B
25 lines
886 B
package org.openrs2.archive.cache.nxt
|
|
|
|
import io.netty.buffer.ByteBuf
|
|
import org.openrs2.crypto.StreamCipher
|
|
import org.openrs2.protocol.FixedPacketCodec
|
|
|
|
public object Js5OkCodec : FixedPacketCodec<LoginResponse.Js5Ok>(
|
|
type = LoginResponse.Js5Ok::class.java,
|
|
opcode = 0,
|
|
length = LoginResponse.Js5Ok.LOADING_REQUIREMENTS * 4
|
|
) {
|
|
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)
|
|
}
|
|
}
|
|
}
|
|
|