3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-16 21:10:30 +01:00

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

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-07-24 14:34:59 -04:00
Ursprung 354d60b036
Commit 1ab926b572
2 geänderte Dateien mit 3 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -9,13 +9,12 @@ sourceCompatibility = 1.8
repositories { repositories {
mavenCentral() mavenCentral()
maven { url 'https://jitpack.io' }
} }
dependencies { dependencies {
compile 'io.netty:netty-all:4.1.27.Final' compile 'io.netty:netty-all:4.1.27.Final'
compile 'com.google.guava:guava:25.1-jre' compile 'com.google.guava:guava:25.1-jre'
compile 'com.google.code.gson:gson:2.8.5' compile 'com.google.code.gson:gson:2.8.5'
compile 'com.github.KyoriPowered:text:v1.12-1.5.0' compile 'net.kyori:text:1.12-1.5.0'
testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'junit', name: 'junit', version: '4.12'
} }

Datei anzeigen

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