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.
24 lines
609 B
24 lines
609 B
package org.openrs2.cache.config.varp
|
|
|
|
import io.netty.buffer.ByteBuf
|
|
import org.openrs2.cache.config.ConfigType
|
|
|
|
public class VarpType(id: Int) : ConfigType(id) {
|
|
public var clientCode: Int = 0
|
|
|
|
override fun read(buf: ByteBuf, code: Int) {
|
|
when (code) {
|
|
5 -> clientCode = buf.readUnsignedShort()
|
|
else -> throw IllegalArgumentException("Unsupported config code: $code")
|
|
}
|
|
}
|
|
|
|
override fun write(buf: ByteBuf) {
|
|
if (clientCode != 0) {
|
|
buf.writeByte(5)
|
|
buf.writeShort(clientCode)
|
|
}
|
|
|
|
buf.writeByte(0)
|
|
}
|
|
}
|
|
|