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.
 
 
 
 
openrs2/protocol/src/main/kotlin/org/openrs2/protocol/EmptyPacketCodec.kt

17 lines
456 B

package org.openrs2.protocol
import io.netty.buffer.ByteBuf
import org.openrs2.crypto.StreamCipher
public abstract class EmptyPacketCodec<T : Packet>(
private val packet: T,
opcode: Int
) : FixedPacketCodec<T>(packet.javaClass, opcode, length = 0) {
override fun decode(input: ByteBuf, cipher: StreamCipher): T {
return packet
}
override fun encode(input: T, output: ByteBuf, cipher: StreamCipher) {
// empty
}
}