mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user