mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Переделано под один мега-проект LMS с общим CMakeLists.txt
This commit is contained in:
97
ServerLMS/Systems/updatecontroller.h
Normal file
97
ServerLMS/Systems/updatecontroller.h
Normal file
@@ -0,0 +1,97 @@
|
||||
#ifndef UPDATECONTROLLER_H
|
||||
#define UPDATECONTROLLER_H
|
||||
|
||||
|
||||
#include <QString>
|
||||
#include <QObject>
|
||||
#include <QCryptographicHash>
|
||||
#include <QDirIterator>
|
||||
#include <QDebug>
|
||||
#include <QDataStream>
|
||||
#include <QMutex>
|
||||
|
||||
#include <Systems/Parsers/dataparser.h>
|
||||
#include <Data/typesDataServerClient.h>
|
||||
#include <Data/StreamingVersionData.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,Logger *logger);
|
||||
void compareFiles(ClientHandler* handler, QByteArray array);
|
||||
void showHash();
|
||||
void calculateFullHash();
|
||||
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();
|
||||
QList<FileData> *getDatas() const;
|
||||
void createVersionListXmlAnswer(QList<StreamingVersionData *> version);
|
||||
void saveVersionToFile(StreamingVersionData *streamingVersion);
|
||||
void xmlFileDataParse(QByteArray array);
|
||||
public slots:
|
||||
void changeAssetVersion(QString versionName);
|
||||
void createCopyVersion(QString versionName,QString newVersionName);
|
||||
void deleteAssetVersion(QString versionName);
|
||||
void setUpCurrentServerHash();
|
||||
|
||||
signals:
|
||||
void sigLogMessage(QString message);
|
||||
|
||||
private:
|
||||
QList<FileData> clientDataList;
|
||||
QList<FileData> serverDataList;
|
||||
|
||||
QList<FileData> fileSendList;
|
||||
QList<FileData> fileDeleteList;
|
||||
|
||||
QList<FileData> *datas;
|
||||
DataInfo *dataInfo;
|
||||
|
||||
QString buildPath;
|
||||
QString currentStreamingPath;
|
||||
QString sharedDataPath;
|
||||
CommonClientHandler *commonClientHandler;
|
||||
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);
|
||||
void loadHash();
|
||||
void CalculateSizeToSend(QList<FileData> diffList);
|
||||
};
|
||||
|
||||
#endif // UPDATECONTROLLER_H
|
||||
Reference in New Issue
Block a user