make writePacketToSocket() clear data automatically

This commit is contained in:
iTrooz
2024-11-29 00:43:42 +01:00
parent ae7d3379e4
commit 09782745c6

View File

@ -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();
}