Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/crustmc/Crust
Browse files Browse the repository at this point in the history
  • Loading branch information
Outfluencer committed Dec 20, 2024
2 parents 8a3d7f7 + 2a3ddac commit 6a46881
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/server/initial_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,12 @@ async fn finish_login(stream: &mut TcpStream, profile: GameProfile, version: i32
buffers.write_buf.clear();
buffers.protocol_buf.clear();
*compression = ProxyServer::instance().config().compression_threshold;
packets::get_full_server_packet_buf_write_buffer(buffers.write_buf, &SetCompression {
compression: *compression
}, version, ProtocolState::Login)?;
encode_and_send_packet(stream, buffers.write_buf, buffers.protocol_buf, -1, encryption).await?;
if *compression >= 0 {
packets::get_full_server_packet_buf_write_buffer(buffers.write_buf, &SetCompression {
compression: *compression
}, version, ProtocolState::Login)?;
encode_and_send_packet(stream, buffers.write_buf, buffers.protocol_buf, -1, encryption).await?;
}

buffers.write_buf.clear();
buffers.protocol_buf.clear();
Expand Down

0 comments on commit 6a46881

Please sign in to comment.