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.
19 lines
609 B
19 lines
609 B
package org.openrs2.protocol
|
|
|
|
import io.netty.buffer.ByteBuf
|
|
import org.openrs2.crypto.StreamCipher
|
|
|
|
internal object TestVariableBytePacketCodec : VariableBytePacketCodec<VariableBytePacket>(
|
|
type = VariableBytePacket::class.java,
|
|
opcode = 1
|
|
) {
|
|
override fun decode(input: ByteBuf, cipher: StreamCipher): VariableBytePacket {
|
|
val value = ByteArray(input.readableBytes())
|
|
input.readBytes(value)
|
|
return VariableBytePacket(value)
|
|
}
|
|
|
|
override fun encode(input: VariableBytePacket, output: ByteBuf, cipher: StreamCipher) {
|
|
output.writeBytes(input.value)
|
|
}
|
|
}
|
|
|