Fix 1.4-1.6 SLP, use text from maven central.

This commit is contained in:
Andrew Steinborn
2018-07-24 14:34:59 -04:00
parent 354d60b036
commit 1ab926b572
2 changed files with 3 additions and 5 deletions

View File

@@ -16,9 +16,8 @@ public class LegacyPingEncoder extends MessageToByteEncoder<LegacyPingResponse>
protected void encode(ChannelHandlerContext ctx, LegacyPingResponse msg, ByteBuf out) throws Exception {
out.writeByte(0xff);
String serializedResponse = serialize(msg);
byte[] serializedBytes = serializedResponse.getBytes(StandardCharsets.UTF_16BE);
out.writeShort(serializedBytes.length);
out.writeBytes(serializedBytes);
out.writeShort(serializedResponse.length());
out.writeBytes(serializedResponse.getBytes(StandardCharsets.UTF_16BE));
System.out.println(ByteBufUtil.prettyHexDump(out));
}