mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
104 lines
2.8 KiB
C++
104 lines
2.8 KiB
C++
#ifndef UPDATECONTROLLER_H
|
|
#define UPDATECONTROLLER_H
|
|
|
|
#include <QString>
|
|
#include <QObject>
|
|
#include <QCryptographicHash>
|
|
#include <QDirIterator>
|
|
#include <QDebug>
|
|
#include <QDataStream>
|
|
#include <QMutex>
|
|
#include <QApplication>
|
|
#include <QMessageBox>
|
|
#include <Systems/Parsers/dataparser.h>
|
|
#include <Data/typesDataServerClient.h>
|
|
#include <Data/StreamingVersionData.h>
|
|
#include "fasthashcalculator.h"
|
|
|
|
class TCPServer;
|
|
class SendSystem;
|
|
class DataParser;
|
|
class ClientHandler;
|
|
class AssetsManager;
|
|
class ServerLMSWidget;
|
|
class CommonClientHandler;
|
|
class Logger;
|
|
class UpdateController : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit UpdateController(QObject *parent = 0);
|
|
void initialize(CommonClientHandler* commonClientHandler,DataParser *dataParser,AssetsManager *assetManager);
|
|
void compareFiles(ClientHandler* handler, QByteArray array);
|
|
void showHash();
|
|
void calculateFullHash();
|
|
void calculateFullHashWithSetup();
|
|
void calculateSharedHash();
|
|
void sendNewVersionList();
|
|
void setCurrentStreamingPath(QString path);
|
|
bool checkDuplicate(QString versionName);
|
|
QList<FileData>* calculateHash(QString path);
|
|
QByteArray getLocalHash();
|
|
|
|
QString getCurrentVersionName();
|
|
QList<FileData> getFileSendList();
|
|
QList<FileData> getClientDataList() const;
|
|
QList<FileData> getFileDeleteList() const;
|
|
QString getCurrentStreamingPath() const;
|
|
|
|
~UpdateController();
|
|
|
|
DataInfo *getCurrentDataInfo();
|
|
void clearCurrentDataInfo();
|
|
void xmlFileDataParse(QByteArray array);
|
|
|
|
QString getPathAdditionalFile(QString name);
|
|
|
|
StreamingVersionData *getCurrentVersion();
|
|
void setDataInfo(DataInfo *value);
|
|
|
|
public slots:
|
|
void changeAssetVersion(QString versionName);
|
|
void createCopyVersion(QString versionName,QString newVersionName,QString author);
|
|
void deleteAssetVersion(QString versionName);
|
|
void setUpCurrentServerHash();
|
|
|
|
signals:
|
|
void sigErrorRequired(int code);
|
|
|
|
private:
|
|
QList<FileData> clientDataList;
|
|
QList<FileData> serverDataList;
|
|
|
|
QList<FileData> fileSendList;
|
|
QList<FileData> fileDeleteList;
|
|
|
|
DataInfo *dataInfo;
|
|
|
|
QString buildPath;
|
|
QString currentStreamingPath;
|
|
QString sharedDataPath;
|
|
CommonClientHandler *commonClientHandler;
|
|
FastHashCalculator *hashCalculator;
|
|
DataParser *dataParser;
|
|
AssetsManager *assetManager;
|
|
quint64 sizeToSend;
|
|
QMutex *mutex;
|
|
|
|
QString getCommands();
|
|
void printFileList(QList<FileData> fileData);
|
|
|
|
bool checkNeedUpdate(ClientHandler* handler);
|
|
void setLocalFileData(QList<FileData> dataList);
|
|
void calculateSize();
|
|
void saveHash(QString fileName,QList<FileData> *fileList);
|
|
QList<FileData>* loadHash(QString fileName);
|
|
void CalculateSizeToSend(QList<FileData> diffList);
|
|
bool checkRequiredFolder();
|
|
void calculateCurrentSharedHash();
|
|
};
|
|
|
|
#endif // UPDATECONTROLLER_H
|