ConnectorServerEventHandler: set default packet handler (#1148)

This allows disconnect packets to be sent and kick unsupported versions of the game.
This commit is contained in:
Camotoy 2020-08-13 10:56:03 -04:00 committed by GitHub
parent bf238f52c7
commit 4bcf44638e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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