bugfix: versions

* refactoring call update after update from client
* refactoring common client deAuth
* add packet for notify hash calculate start
* bugfix update static data
This commit is contained in:
semenov
2025-07-23 12:32:38 +03:00
parent 82b605ae50
commit 71215cf5ec
18 changed files with 297 additions and 171 deletions

View File

@@ -29,7 +29,7 @@ void UpdateController::initialize(CommonClientHandler *commonClientHandler,DataP
connect(this,&UpdateController::sigLogMessage,logger,&Logger::addTextToLogger,Qt::AutoConnection);
calculateFullHash();
currentStreamingPath = assetManager->setVersion("base");
currentStreamingPath = assetManager->setVersion("base"); //TODO: сохрнаять предыдущую версию и загружать ее при включении
setUpCurrentServerHash();
mutex = new QMutex;
@@ -82,18 +82,28 @@ void UpdateController::showHash()
void UpdateController::calculateFullHash()
{
qDebug() << "Calculate hash...";
commonClientHandler->slot_sendPacketToAllClients(PacketType::BUSY);
auto *list = calculateHash(buildPath);
saveHash(buildHashName,list);
calculateSharedHash();
emit sigLogMessage("Calculate hash complete");
commonClientHandler->slot_sendPacketToAllClients(PacketType::FREE);
qDebug() << "Calculate complete...";
}
void UpdateController::calculateFullHashWithSetup()
{
commonClientHandler->slot_sendPacketToAllClients(PacketType::HASH_CALCULATE_START);
calculateFullHash();
setUpCurrentServerHash();
commonClientHandler->slot_sendPacketToAllClients(PacketType::HASH_READY);
}
void UpdateController::saveHash(QString fileName,QList<FileData> *fileList)
{
QFile hashFile(fileName);
hashFile.open(QIODevice::WriteOnly);
hashFile.open(QIODevice::WriteOnly | QIODevice::Truncate);
QXmlStreamWriter xmlWriter(&hashFile);
QListIterator<FileData> fileDataIterator(*fileList);