Skip to content

Commit dc71332

Browse files
committed
fix mcc not showing the disconnect message
The fix is to remove the ParseText call from the OnConnectionLost call, as the ReadNextChat function already calls ParseText. Calling ParseText on an unparsable string returns an empty string, therefore the disconnect message never gets propagated to the user.
1 parent 706a41e commit dc71332

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

MinecraftClient/McClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ public void OnConnectionLost(ChatBot.DisconnectReason reason, string message)
593593
ConsoleInteractive.ConsoleReader.StopReadThread();
594594
ConsoleInteractive.ConsoleReader.MessageReceived -= ConsoleReaderOnMessageReceived;
595595
ConsoleInteractive.ConsoleReader.OnInputChange -= ConsoleIO.AutocompleteHandler;
596-
Program.HandleFailure(message, false, reason);
596+
Program.HandleFailure(null, false, reason);
597597
}
598598
}
599599

MinecraftClient/Protocol/Handlers/Protocol18.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,8 +2044,8 @@ private bool HandlePlayPackets(int packetId, Queue<byte> packetData)
20442044
handler.OnPluginChannelMessage(channel, packetData.ToArray());
20452045
return pForge.HandlePluginMessage(channel, packetData, ref currentDimension);
20462046
case PacketTypesIn.Disconnect:
2047-
handler.OnConnectionLost(ChatBot.DisconnectReason.InGameKick,
2048-
ChatParser.ParseText(dataTypes.ReadNextChat(packetData)));
2047+
handler.OnConnectionLost(ChatBot.DisconnectReason.InGameKick,
2048+
dataTypes.ReadNextChat(packetData));
20492049
return false;
20502050
case PacketTypesIn.SetCompression:
20512051
if (protocolVersion is >= MC_1_8_Version and < MC_1_9_Version)

0 commit comments

Comments
 (0)