diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index 398d8c58..c6357f73 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -139,6 +139,9 @@ namespace MinecraftClient.Protocol.Handlers case 0x00: //Keep-Alive SendPacket(0x00, packetData); break; + case 0x01: //Join game + SendBrandInfo(); + break; case 0x02: //Chat message handler.OnTextReceived(ChatParser.ParseText(readNextString(ref packetData))); break; @@ -607,6 +610,20 @@ namespace MinecraftClient.Protocol.Handlers } } + /// + /// Sends information about the client version. + /// + + private void SendBrandInfo() + { + byte[] channel = Encoding.UTF8.GetBytes("MC|Brand"); + byte[] channelLen = getVarInt(channel.Length); + byte[] brand = Encoding.UTF8.GetBytes("Minecraft Console Client v" + Program.Version); + byte[] brandLen = getVarInt(brand.Length); + + SendPacket(0x17, concatBytes(channelLen, channel, brandLen, brand)); + } + /// /// Send a chat message to the server ///