bugfix: update without hot update

This commit is contained in:
semenov
2025-11-20 12:14:34 +03:00
parent 4829647e98
commit a2e64ecb68
14 changed files with 13161 additions and 13125 deletions

View File

@@ -165,12 +165,47 @@ void SendSystem::sendPacketType(PacketType packetType)
stream << packetType;
}
void SendSystem::sendPacketTypeWithDelay(PacketType packetType,int delay)
{
QDataStream stream(socket);
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
socket->waitForReadyRead(delay);
stream << packetType;
}
void SendSystem::sendCheckHash()
{
QDataStream stream(socket);
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
QString fullPath = Tools::createSendFullPath(staticDataFolderName + hashFilename);
sendFileBlock(staticDataFolderName + hashFilename);
quint64 fileSize = 0;
int countSend = 0;
QFile file(fullPath); //Открываем файл для чтения
QFileInfo fileInfo(file);
fileSize = fileInfo.size();
stream << PacketType::SEND_HASH; //Отправляем тип блока
stream << fileSize;
socket->waitForReadyRead(20);
//socket->waitForBytesWritten();
if(file.open(QFile::ReadOnly)){
while(!file.atEnd()){
QByteArray data = file.read(readSize);
stream << data;
socket->waitForBytesWritten(20);
countSend++;
}
qDebug() << Tools::getTime() << "count end Final: " << countSend;
}
file.close();
countSend = 0;
socket->waitForReadyRead(2000);
stream << PacketType::TYPE_CHECK_VERSION;