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

Commit 287d693

Browse files
committed
still aint working
1 parent 1e6dc84 commit 287d693

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/jvmMain/kotlin/experimental/network/connection/BedrockPeer.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class BedrockPeer(val rakSession: RakSession) {
4848
fun close() {
4949
for (session in sessions.values) {
5050
session.close(null)
51+
session.onClose()
5152
}
5253
}
5354

src/jvmMain/kotlin/network/connection/BedrockSession.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import org.chorus_oss.chorus.registry.CreativeItemRegistry
2828
import org.chorus_oss.chorus.registry.Registries
2929
import org.chorus_oss.chorus.utils.Loggable
3030
import org.chorus_oss.protocol.core.Packet
31+
import org.chorus_oss.protocol.core.ProtoVAR
32+
import org.chorus_oss.protocol.core.types.UInt
3133
import org.chorus_oss.protocol.packets.CraftingDataPacket
3234
import org.chorus_oss.protocol.packets.NetworkSettingsPacket
3335
import org.chorus_oss.protocol.types.DisconnectFailReason
@@ -168,11 +170,16 @@ class BedrockSession(val peer: BedrockPeer, val subClientId: Int) : Loggable {
168170
targetSubClientID = 0u,
169171
)
170172

171-
val raw = Buffer().also {
173+
val wrapper = Buffer().also {
172174
PacketHeader.serialize(header, it)
173175
it.write(buf.readByteArray())
174176
}
175177

178+
val raw = Buffer().apply {
179+
ProtoVAR.UInt.serialize(wrapper.size.toUInt(), this)
180+
write(wrapper, wrapper.size)
181+
}
182+
176183
peer.sendRaw(RakPriority.Normal, raw)
177184
}
178185

src/jvmMain/kotlin/network/process/handler/SpawnResponseHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class SpawnResponseHandler(session: BedrockSession) : BedrockSessionPacketHandle
232232
serverAuthoritativeSound = false,
233233
tickDeathSystemsEnabled = false,
234234
)
235-
player.sendPacket(packet)
235+
player.sendPacketImmediately(packet)
236236
}
237237

238238
override fun handle(packet: Packet) {

0 commit comments

Comments
 (0)