writeStringUTF8WithoutLengthHeaderBecause @Dinnerbone StuffedUpTheMCBrandPacket

This commit is contained in:
md_5 2013-07-10 23:42:50 +10:00
parent 55a6cc56ef
commit 47839cb11c
2 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package net.md_5.bungee.protocol;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import java.nio.charset.Charset;
import java.util.Arrays; import java.util.Arrays;
public class MinecraftOutput public class MinecraftOutput
@ -47,4 +48,9 @@ public class MinecraftOutput
buf.writeChar( c ); buf.writeChar( c );
} }
} }
public void writeStringUTF8WithoutLengthHeaderBecauseDinnerboneStuffedUpTheMCBrandPacket(String s)
{
buf.writeBytes( s.getBytes( Charset.forName( "UTF-8" ) ) );
}
} }

View File

@ -156,7 +156,7 @@ public class ServerConnector extends PacketHandler
user.unsafe().sendPacket( modLogin ); user.unsafe().sendPacket( modLogin );
MinecraftOutput out = new MinecraftOutput(); MinecraftOutput out = new MinecraftOutput();
out.writeString( ProxyServer.getInstance().getName() + " (" + ProxyServer.getInstance().getVersion() + ")" ); out.writeStringUTF8WithoutLengthHeaderBecauseDinnerboneStuffedUpTheMCBrandPacket(ProxyServer.getInstance().getName() + " (" + ProxyServer.getInstance().getVersion() + ")" );
user.unsafe().sendPacket( new PacketFAPluginMessage( "MC|Brand", out.toArray() ) ); user.unsafe().sendPacket( new PacketFAPluginMessage( "MC|Brand", out.toArray() ) );
} else } else
{ {