Skip to content

Commit

Permalink
Do not compress ServerLoginSuccessPacket then FastPrepareAPI was requ…
Browse files Browse the repository at this point in the history
…ested to send uncompressed packets
  • Loading branch information
UserNugget committed Jul 9, 2024
1 parent 4bc9de6 commit 531c632
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import java.util.Objects;
import java.util.UUID;
import net.elytrium.commons.utils.reflection.ReflectionException;
import net.elytrium.fastprepare.handler.PreparedPacketEncoder;
import net.elytrium.limboapi.LimboAPI;
import net.elytrium.limboapi.api.event.LoginLimboRegisterEvent;
import net.elytrium.limboapi.injection.dummy.ClosedChannel;
Expand Down Expand Up @@ -219,11 +220,11 @@ public void hookLoginSession(GameProfileRequestEvent event) throws Throwable {
success.setUuid(playerUniqueID);

ChannelHandler compressionHandler = pipeline.get(Connections.COMPRESSION_ENCODER);
if (compressionHandler != null) {
if (compressionHandler != null && !pipeline.get(PreparedPacketEncoder.class).isSendUncompressed()) {
connection.write(this.plugin.encodeSingleLogin(success, connection.getProtocolVersion()));
} else {
ChannelHandler frameHandler = pipeline.get(Connections.FRAME_ENCODER);
if (frameHandler != null) {
if (compressionHandler == null && frameHandler != null) {
pipeline.remove(frameHandler);
}

Expand Down

0 comments on commit 531c632

Please sign in to comment.