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.
27 lines
1023 B
27 lines
1023 B
package org.openrs2.archive.cache.nxt
|
|
|
|
import io.netty.buffer.ByteBuf
|
|
import org.openrs2.buffer.readString
|
|
import org.openrs2.buffer.writeString
|
|
import org.openrs2.crypto.StreamCipher
|
|
import org.openrs2.protocol.VariableBytePacketCodec
|
|
|
|
public object InitJs5RemoteConnectionCodec : VariableBytePacketCodec<InitJs5RemoteConnection>(
|
|
type = InitJs5RemoteConnection::class.java,
|
|
opcode = 15
|
|
) {
|
|
override fun decode(input: ByteBuf, cipher: StreamCipher): InitJs5RemoteConnection {
|
|
val buildMajor = input.readInt()
|
|
val buildMinor = input.readInt()
|
|
val token = input.readString()
|
|
val language = input.readUnsignedByte().toInt()
|
|
return InitJs5RemoteConnection(buildMajor, buildMinor, token, language)
|
|
}
|
|
|
|
override fun encode(input: InitJs5RemoteConnection, output: ByteBuf, cipher: StreamCipher) {
|
|
output.writeInt(input.buildMajor)
|
|
output.writeInt(input.buildMinor)
|
|
output.writeString(input.token)
|
|
output.writeByte(input.language)
|
|
}
|
|
}
|
|
|