From c957ed0efd09cf27a69445a7baa92e7434021a3e Mon Sep 17 00:00:00 2001 From: ORelio Date: Tue, 16 Jun 2015 10:59:18 +0200 Subject: [PATCH] Remove invalid disconnect packet (2) Forgot to apply the same change to Protocol17, see #45 --- MinecraftClient/Protocol/Handlers/Protocol17.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/MinecraftClient/Protocol/Handlers/Protocol17.cs b/MinecraftClient/Protocol/Handlers/Protocol17.cs index a514ffc5..b8950cc7 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol17.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol17.cs @@ -508,18 +508,12 @@ namespace MinecraftClient.Protocol.Handlers /// /// Disconnect from the server /// - /// Optional disconnect reason public void Disconnect() { try { - byte[] packet_id = getVarInt(0x40); - byte[] message_val = Encoding.UTF8.GetBytes("\"disconnect.quitting\""); - byte[] message_len = getVarInt(message_val.Length); - byte[] disconnect_packet = concatBytes(packet_id, message_len, message_val); - byte[] disconnect_packet_tosend = concatBytes(getVarInt(disconnect_packet.Length), disconnect_packet); - Send(disconnect_packet_tosend); + c.Close(); } catch (SocketException) { } catch (System.IO.IOException) { }