mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Remove invalid disconnect packet
... use TCP connection closing instead. See #45
This commit is contained in:
parent
0029561135
commit
365af032ad
1 changed files with 1 additions and 5 deletions
|
|
@ -615,16 +615,12 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Disconnect from the server
|
/// Disconnect from the server
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">Optional disconnect reason</param>
|
|
||||||
|
|
||||||
public void Disconnect()
|
public void Disconnect()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
byte[] message_val = Encoding.UTF8.GetBytes("\"disconnect.quitting\"");
|
c.Close();
|
||||||
byte[] message_len = getVarInt(message_val.Length);
|
|
||||||
byte[] disconnect_packet = concatBytes(message_len, message_val);
|
|
||||||
SendPacket(0x40, disconnect_packet);
|
|
||||||
}
|
}
|
||||||
catch (SocketException) { }
|
catch (SocketException) { }
|
||||||
catch (System.IO.IOException) { }
|
catch (System.IO.IOException) { }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue