Add RequestWorldList packet

Signed-off-by: Graham <gpe@openrs2.org>
Graham 4 years ago
parent 235ee41e32
commit 7692862c7c
  1. 4
      protocol/src/main/kotlin/org/openrs2/protocol/Protocol.kt
  2. 1
      protocol/src/main/kotlin/org/openrs2/protocol/login/LoginRequest.kt
  3. 19
      protocol/src/main/kotlin/org/openrs2/protocol/login/RequestWorldListCodec.kt

@ -5,6 +5,7 @@ import org.openrs2.protocol.login.InitJaggrabConnectionCodec
import org.openrs2.protocol.login.InitJs5RemoteConnectionCodec import org.openrs2.protocol.login.InitJs5RemoteConnectionCodec
import org.openrs2.protocol.login.IpLimitCodec import org.openrs2.protocol.login.IpLimitCodec
import org.openrs2.protocol.login.Js5OkCodec import org.openrs2.protocol.login.Js5OkCodec
import org.openrs2.protocol.login.RequestWorldListCodec
import org.openrs2.protocol.login.ServerFullCodec import org.openrs2.protocol.login.ServerFullCodec
public class Protocol(vararg codecs: PacketCodec<*>) { public class Protocol(vararg codecs: PacketCodec<*>) {
@ -30,7 +31,8 @@ public class Protocol(vararg codecs: PacketCodec<*>) {
public companion object { public companion object {
public val LOGIN_UPSTREAM: Protocol = Protocol( public val LOGIN_UPSTREAM: Protocol = Protocol(
InitJs5RemoteConnectionCodec, InitJs5RemoteConnectionCodec,
InitJaggrabConnectionCodec InitJaggrabConnectionCodec,
RequestWorldListCodec
) )
public val LOGIN_DOWNSTREAM: Protocol = Protocol( public val LOGIN_DOWNSTREAM: Protocol = Protocol(
Js5OkCodec, Js5OkCodec,

@ -5,4 +5,5 @@ import org.openrs2.protocol.Packet
public sealed class LoginRequest : Packet { public sealed class LoginRequest : Packet {
public data class InitJs5RemoteConnection(public val build: Int) : LoginRequest() public data class InitJs5RemoteConnection(public val build: Int) : LoginRequest()
public object InitJaggrabConnection : LoginRequest() public object InitJaggrabConnection : LoginRequest()
public data class RequestWorldList(public val checksum: Int) : LoginRequest()
} }

@ -0,0 +1,19 @@
package org.openrs2.protocol.login
import io.netty.buffer.ByteBuf
import org.openrs2.protocol.PacketCodec
public object RequestWorldListCodec : PacketCodec<LoginRequest.RequestWorldList>(
type = LoginRequest.RequestWorldList::class.java,
opcode = 23,
length = 4
) {
override fun decode(input: ByteBuf): LoginRequest.RequestWorldList {
val checksum = input.readInt()
return LoginRequest.RequestWorldList(checksum)
}
override fun encode(input: LoginRequest.RequestWorldList, output: ByteBuf) {
output.writeInt(input.checksum)
}
}
Loading…
Cancel
Save