From 4bcf44638e69b8ba268a968709aae88de6e79bda Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+DoctorMacc@users.noreply.github.com> Date: Thu, 13 Aug 2020 10:56:03 -0400 Subject: [PATCH] ConnectorServerEventHandler: set default packet handler (#1148) This allows disconnect packets to be sent and kick unsupported versions of the game. --- .../geysermc/connector/network/ConnectorServerEventHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/connector/src/main/java/org/geysermc/connector/network/ConnectorServerEventHandler.java b/connector/src/main/java/org/geysermc/connector/network/ConnectorServerEventHandler.java index c850fc4ab..9fb4ad9e1 100644 --- a/connector/src/main/java/org/geysermc/connector/network/ConnectorServerEventHandler.java +++ b/connector/src/main/java/org/geysermc/connector/network/ConnectorServerEventHandler.java @@ -108,6 +108,8 @@ public class ConnectorServerEventHandler implements BedrockServerEventHandler { public void onSessionCreation(BedrockServerSession bedrockServerSession) { bedrockServerSession.setLogging(true); bedrockServerSession.setPacketHandler(new UpstreamPacketHandler(connector, new GeyserSession(connector, bedrockServerSession))); + // Set the packet codec to default just in case we need to send disconnect packets. + bedrockServerSession.setPacketCodec(BedrockProtocol.DEFAULT_BEDROCK_CODEC); } @Override