Fix for kick messages : now decoded from Json

This commit is contained in:
ORelio 2014-01-10 13:18:29 +01:00
parent 30cbc85850
commit d012905b65
2 changed files with 4 additions and 13 deletions

View file

@ -156,7 +156,7 @@ namespace MinecraftClient
if (tab_list.Length > 0) if (tab_list.Length > 0)
printstring("§8" + tab_list, false); printstring("§8" + tab_list, false);
break; break;
case 0x40: string reason = readNextString(); case 0x40: string reason = ChatParser.ParseText(readNextString());
ConsoleIO.WriteLine("Disconnected by Server :"); ConsoleIO.WriteLine("Disconnected by Server :");
printstring(reason, true); printstring(reason, true);
connectionlost = true; connectionlost = true;
@ -455,21 +455,12 @@ namespace MinecraftClient
Send(login_packet_tosend); Send(login_packet_tosend);
int size = readNextVarInt(); //Packet size readNextVarInt(); //Packet size
int pid = readNextVarInt(); //Packet ID int pid = readNextVarInt(); //Packet ID
size -= getVarInt(pid).Length;
/*
while (pid == 0x3F) //Skip some early plugin messages
{
readData(size);
size = readNextVarInt();
pid = readNextVarInt();
size -= getVarInt(pid).Length;
}*/
if (pid == 0x00) //Login rejected if (pid == 0x00) //Login rejected
{ {
Console.WriteLine("Login rejected by Server :"); Console.WriteLine("Login rejected by Server :");
printstring(readNextString().Replace('"', ' '), true); printstring(ChatParser.ParseText(readNextString()), true);
return false; return false;
} }
else if (pid == 0x01) //Encryption request else if (pid == 0x01) //Encryption request

View file

@ -23,7 +23,7 @@ namespace MinecraftClient
static void Main(string[] args) static void Main(string[] args)
{ {
Console.WriteLine("Console Client for MC 1.7.2 - v" + Version + " - By ORelio & Contributors"); Console.WriteLine("Console Client for MC 1.7.2 to 1.7.4 - v" + Version + " - By ORelio & Contributors");
//Basic Input/Output ? //Basic Input/Output ?
if (args.Length >= 1 && args[args.Length - 1] == "BasicIO") if (args.Length >= 1 && args[args.Length - 1] == "BasicIO")