mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Send MC|Brand information upon joining the game
This commit is contained in:
parent
344749ead2
commit
9fefcb40ef
1 changed files with 17 additions and 0 deletions
|
|
@ -139,6 +139,9 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
case 0x00: //Keep-Alive
|
case 0x00: //Keep-Alive
|
||||||
SendPacket(0x00, packetData);
|
SendPacket(0x00, packetData);
|
||||||
break;
|
break;
|
||||||
|
case 0x01: //Join game
|
||||||
|
SendBrandInfo();
|
||||||
|
break;
|
||||||
case 0x02: //Chat message
|
case 0x02: //Chat message
|
||||||
handler.OnTextReceived(ChatParser.ParseText(readNextString(ref packetData)));
|
handler.OnTextReceived(ChatParser.ParseText(readNextString(ref packetData)));
|
||||||
break;
|
break;
|
||||||
|
|
@ -607,6 +610,20 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sends information about the client version.
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Send a chat message to the server
|
/// Send a chat message to the server
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue