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
531 B
19 lines
531 B
package org.openrs2.protocol
|
|
|
|
import io.netty.buffer.ByteBuf
|
|
import org.openrs2.crypto.StreamCipher
|
|
|
|
internal object LengthMismatchPacketCodec : FixedPacketCodec<FixedPacket>(
|
|
type = FixedPacket::class.java,
|
|
opcode = 0,
|
|
length = 5
|
|
) {
|
|
override fun decode(input: ByteBuf, cipher: StreamCipher): FixedPacket {
|
|
val value = input.readInt()
|
|
return FixedPacket(value)
|
|
}
|
|
|
|
override fun encode(input: FixedPacket, output: ByteBuf, cipher: StreamCipher) {
|
|
output.writeInt(input.value)
|
|
}
|
|
}
|
|
|