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.
31 lines
877 B
31 lines
877 B
package org.openrs2.archive.world
|
|
|
|
import io.netty.buffer.ByteBuf
|
|
import org.openrs2.buffer.readString
|
|
|
|
public data class World(
|
|
public val id: Int,
|
|
public val flags: Int,
|
|
public val hostname: String,
|
|
public val activity: String,
|
|
public val country: Int,
|
|
public val players: Int
|
|
) {
|
|
public val isBeta: Boolean
|
|
get() = (flags and FLAG_BETA) != 0
|
|
|
|
public companion object {
|
|
private const val FLAG_BETA = 0x10000
|
|
|
|
public fun read(buf: ByteBuf): World {
|
|
val id = buf.readUnsignedShort()
|
|
val flags = buf.readInt()
|
|
val hostname = buf.readString()
|
|
val activity = buf.readString()
|
|
val country = buf.readUnsignedByte().toInt()
|
|
val players = buf.readShort().toInt()
|
|
|
|
return World(id, flags, hostname, activity, country, players)
|
|
}
|
|
}
|
|
}
|
|
|