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.
20 lines
708 B
20 lines
708 B
package org.openrs2.protocol.login
|
|
|
|
import io.netty.buffer.ByteBuf
|
|
import org.openrs2.crypto.StreamCipher
|
|
import org.openrs2.protocol.PacketCodec
|
|
|
|
public object InitGameConnectionCodec : PacketCodec<LoginRequest.InitGameConnection>(
|
|
opcode = 14,
|
|
length = 1,
|
|
type = LoginRequest.InitGameConnection::class.java
|
|
) {
|
|
override fun decode(input: ByteBuf, cipher: StreamCipher): LoginRequest.InitGameConnection {
|
|
val usernameHash = input.readUnsignedByte().toInt()
|
|
return LoginRequest.InitGameConnection(usernameHash)
|
|
}
|
|
|
|
override fun encode(input: LoginRequest.InitGameConnection, output: ByteBuf, cipher: StreamCipher) {
|
|
output.writeByte(input.usernameHash)
|
|
}
|
|
}
|
|
|