From 09782745c6f1e1ad0edfd4222f432d679d10c17b Mon Sep 17 00:00:00 2001 From: iTrooz Date: Fri, 29 Nov 2024 00:43:42 +0100 Subject: [PATCH] make writePacketToSocket() clear data automatically --- launcher/ui/pages/instance/McClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/ui/pages/instance/McClient.cpp b/launcher/ui/pages/instance/McClient.cpp index 65225f077..92db3ba34 100644 --- a/launcher/ui/pages/instance/McClient.cpp +++ b/launcher/ui/pages/instance/McClient.cpp @@ -53,8 +53,6 @@ void McClient::sendRequest() { writeVarInt(data, 0x01); // next state writePacketToSocket(data); // send handshake packet - data.clear(); - writeVarInt(data, 0x00); // packet ID writePacketToSocket(data); // send status packet } @@ -162,4 +160,6 @@ void McClient::writePacketToSocket(QByteArray &data) { // write it to the socket socket.write(dataWithSize); socket.flush(); + + data.clear(); }