Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit 055792e

Browse files
committed
refactor: add ServerboundRequestOfflinePlayerData and ResponseRequestOfflinePlayerData packets to the protocol
1 parent fc3c784 commit 055792e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

surf-cloud-core/surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/netty/network/protocol/running/RunningProtocols.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ object RunningProtocols {
5050
.addPacket(ClientboundTriggerShutdownPacket.STREAM_CODEC)
5151
.addPacket(RequestOfflineDisplayNamePacket.STREAM_CODEC)
5252
.addPacket(ClientboundBatchUpdateServer.STREAM_CODEC)
53+
.addPacket(ResponseRequestOfflinePlayerData.STREAM_CODEC)
5354
}
5455

5556
val CLIENTBOUND by lazy { CLIENTBOUND_TEMPLATE.freeze().bind(::SurfByteBuf) }
@@ -93,6 +94,7 @@ object RunningProtocols {
9394
.addPacket(TeleportPlayerResultPacket.STREAM_CODEC)
9495
.addPacket(ServerboundShutdownServerPacket.STREAM_CODEC)
9596
.addPacket(RequestOfflineDisplayNamePacket.STREAM_CODEC)
97+
.addPacket(ServerboundRequestOfflinePlayerData.STREAM_CODEC)
9698
}
9799

98100
val SERVERBOUND by lazy { SERVERBOUND_TEMPLATE.freeze().bind(::SurfByteBuf) }

surf-cloud-core/surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/netty/network/protocol/running/ServerboundRequestOfflinePlayerData.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dev.slne.surf.cloud.core.common.netty.network.protocol.running
22

3+
import dev.slne.surf.cloud.api.common.meta.SurfNettyPacket
4+
import dev.slne.surf.cloud.api.common.netty.network.protocol.PacketFlow
35
import dev.slne.surf.cloud.api.common.netty.packet.RespondingNettyPacket
46
import dev.slne.surf.cloud.api.common.netty.packet.ResponseNettyPacket
57
import dev.slne.surf.cloud.api.common.netty.packet.packetCodec
@@ -10,6 +12,7 @@ import java.net.Inet4Address
1012
import java.time.ZonedDateTime
1113
import java.util.*
1214

15+
@SurfNettyPacket("cloud:serverbound:request_offline_player_data", PacketFlow.SERVERBOUND)
1316
class ServerboundRequestOfflinePlayerData<T>(
1417
val uuid: UUID,
1518
val requestType: RequestType<T>
@@ -38,6 +41,7 @@ class ServerboundRequestOfflinePlayerData<T>(
3841
}
3942
}
4043

44+
@SurfNettyPacket("cloud:response:request_offline_player_data_response", PacketFlow.CLIENTBOUND)
4145
sealed class ResponseRequestOfflinePlayerData<T>(val value: T) : ResponseNettyPacket() {
4246
companion object {
4347
val STREAM_CODEC = packetCodec(

0 commit comments

Comments
 (0)