mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
bugfix: update without hot update
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user