diff --git a/Core/FileData.h b/Core/FileData.h index e586069..6cfa0a5 100644 --- a/Core/FileData.h +++ b/Core/FileData.h @@ -9,11 +9,17 @@ struct FileData QString path; QString hash; - bool operator==(const FileData& other)const{ + bool operator==(const FileData& other)const + { if(this->path==(other.path)) return true; return false; } + bool operator<(const FileData& data2) const + { + return this->hash == "FOLDER" && data2.hash !="FOLDER"; + } + }; //путь struct SAttribute diff --git a/Core/UpdateController.cpp b/Core/UpdateController.cpp index 4889690..efdfa31 100644 --- a/Core/UpdateController.cpp +++ b/Core/UpdateController.cpp @@ -12,8 +12,9 @@ UpdateController::UpdateController(DataParser *parser,SendSystem *sendSystem, QO void UpdateController::calculateCommonHash() { appDataList.clear(); - appDataList = calculateHash(applicationFolderPath); + appDataList = calculateHash(applicationFolderPath,"StreamingAssets"); calculateStreamingHash(); + appDataList.append(streamingDataList); dataParser->createFileDataList(appDataList,hashFilename); qDebug() << "UpdateController threadID " << QThread::currentThreadId(); } @@ -21,8 +22,9 @@ void UpdateController::calculateCommonHash() void UpdateController::calculateStreamingHash() { streamingDataList.clear(); - streamingDataList = calculateHash(QDir::currentPath() + streamingAssetsPath); - dataParser->createFileDataList(appDataList,streamingHashFilename); + streamingDataList = calculateHash(QDir::currentPath() + streamingAssetsPath,""); + std::sort(streamingDataList.begin(),streamingDataList.end()); + dataParser->createFileDataList(streamingDataList,streamingHashFilename); } void UpdateController::setServerVersion(StreamingVersionData *version) @@ -30,7 +32,7 @@ void UpdateController::setServerVersion(StreamingVersionData *version) serverVersion = version; } -QList UpdateController::calculateHash(QString path) +QList UpdateController::calculateHash(QString path,QString ignoreName) { qDebug() << "Try calculate"; @@ -56,6 +58,7 @@ QList UpdateController::calculateHash(QString path) const quint64 bufferSize = 10240; if(fileInfo.isHidden()) continue; + if(ignoreName != "" && fileInfo.path().contains(ignoreName)) continue; if(fileInfo.isFile() && file.open(QIODevice::ReadOnly)) { @@ -90,6 +93,8 @@ QList UpdateController::calculateHash(QString path) } + std::sort(hashes->begin(),hashes->end()); + return *hashes; } diff --git a/Core/UpdateController.h b/Core/UpdateController.h index eebd753..c04b8fb 100644 --- a/Core/UpdateController.h +++ b/Core/UpdateController.h @@ -47,7 +47,7 @@ private: QList streamingDataList; StreamingVersionData *serverVersion; - QList calculateHash(QString path); + QList calculateHash(QString path,QString ignoreName); }; diff --git a/RRJClient.pro.user b/RRJClient.pro.user index cd7eb80..d0b04da 100644 --- a/RRJClient.pro.user +++ b/RRJClient.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -299,7 +299,7 @@ false true - D:/QT/Projects/RRJClient + 1 diff --git a/StaticData/clientHash.xml b/StaticData/clientHash.xml index 8d58926..841dfde 100644 --- a/StaticData/clientHash.xml +++ b/StaticData/clientHash.xml @@ -1,107 +1,49 @@ - + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -110,7 +52,7 @@ - + @@ -120,26 +62,27 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -149,7 +92,7 @@ - + @@ -158,35 +101,94 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -194,8 +196,4 @@ - - - - diff --git a/StaticData/streamingHash.xml b/StaticData/streamingHash.xml index 8d58926..808f6e3 100644 --- a/StaticData/streamingHash.xml +++ b/StaticData/streamingHash.xml @@ -1,192 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -194,8 +14,4 @@ - - - - diff --git a/debug/RRJClient.exe b/debug/RRJClient.exe index ba19eb5..58d3f21 100644 Binary files a/debug/RRJClient.exe and b/debug/RRJClient.exe differ diff --git a/debug/dataparser.o b/debug/dataparser.o index 6f804b9..80635cc 100644 Binary files a/debug/dataparser.o and b/debug/dataparser.o differ diff --git a/debug/hashcomparer.o b/debug/hashcomparer.o index 5762ad9..4c0db47 100644 Binary files a/debug/hashcomparer.o and b/debug/hashcomparer.o differ diff --git a/debug/mainwindow.o b/debug/mainwindow.o index 9dc775c..49c68e6 100644 Binary files a/debug/mainwindow.o and b/debug/mainwindow.o differ diff --git a/debug/moc_hashcomparer.o b/debug/moc_hashcomparer.o index 33707b8..5d565b4 100644 Binary files a/debug/moc_hashcomparer.o and b/debug/moc_hashcomparer.o differ diff --git a/debug/moc_mainwindow.o b/debug/moc_mainwindow.o index 9572fa2..e8f0056 100644 Binary files a/debug/moc_mainwindow.o and b/debug/moc_mainwindow.o differ diff --git a/debug/moc_updatecontroller.o b/debug/moc_updatecontroller.o index bfb9af0..1cffe97 100644 Binary files a/debug/moc_updatecontroller.o and b/debug/moc_updatecontroller.o differ diff --git a/debug/moc_updatenotifywidget.o b/debug/moc_updatenotifywidget.o index c580d7f..715ac91 100644 Binary files a/debug/moc_updatenotifywidget.o and b/debug/moc_updatenotifywidget.o differ diff --git a/debug/updatecontroller.o b/debug/updatecontroller.o index 3343770..e507dfa 100644 Binary files a/debug/updatecontroller.o and b/debug/updatecontroller.o differ diff --git a/debug/updatenotifywidget.o b/debug/updatenotifywidget.o index 894a0bd..8323bb4 100644 Binary files a/debug/updatenotifywidget.o and b/debug/updatenotifywidget.o differ