mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
feat: add update system
This commit is contained in:
62
DOCS/.obsidian/workspace.json
vendored
62
DOCS/.obsidian/workspace.json
vendored
@@ -11,15 +11,58 @@
|
|||||||
"id": "24c44b1390af655a",
|
"id": "24c44b1390af655a",
|
||||||
"type": "leaf",
|
"type": "leaf",
|
||||||
"state": {
|
"state": {
|
||||||
"type": "excalidraw",
|
"type": "kanban",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Алексей/AssetManagerScheme.md"
|
"file": "Алексей/Board.md",
|
||||||
|
"kanbanViewState": {
|
||||||
|
"kanban-plugin": "board",
|
||||||
|
"list-collapse": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"icon": "excalidraw-icon",
|
"icon": "lucide-trello",
|
||||||
"title": "AssetManagerScheme"
|
"title": "Board"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1aa07d1707bb3761",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "markdown",
|
||||||
|
"state": {
|
||||||
|
"file": "Что умеем отправлять Server - Client QT.md",
|
||||||
|
"mode": "source",
|
||||||
|
"source": false
|
||||||
|
},
|
||||||
|
"icon": "lucide-file",
|
||||||
|
"title": "Что умеем отправлять Server - Client QT"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "77886c7575d9bc97",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "markdown",
|
||||||
|
"state": {
|
||||||
|
"file": "Что умеем отправлять Server - Client QT.md",
|
||||||
|
"mode": "source",
|
||||||
|
"source": false
|
||||||
|
},
|
||||||
|
"icon": "lucide-file",
|
||||||
|
"title": "Что умеем отправлять Server - Client QT"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"currentTab": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "vertical"
|
"direction": "vertical"
|
||||||
@@ -162,9 +205,15 @@
|
|||||||
"obsidian-kanban:Создать новую доску": false
|
"obsidian-kanban:Создать новую доску": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"active": "24c44b1390af655a",
|
"active": "77886c7575d9bc97",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Алексей/Board.md",
|
"Алексей/Board.md",
|
||||||
|
"Алексей/Чек лист по переносу.md",
|
||||||
|
"Алексей/ТЕСТ-КЕЙСЫ.md",
|
||||||
|
"Алексей/Рефакторинг.md",
|
||||||
|
"Без названия.md",
|
||||||
|
"Как умеем принимать на Server.md",
|
||||||
|
"Что умеем отправлять Server - Client QT.md",
|
||||||
"Алексей/AssetManagerScheme.md",
|
"Алексей/AssetManagerScheme.md",
|
||||||
"Desk.md",
|
"Desk.md",
|
||||||
"CLIENT SERVER.canvas",
|
"CLIENT SERVER.canvas",
|
||||||
@@ -172,7 +221,6 @@
|
|||||||
"Андрей/ВАЖНАЯ ЗАМЕТКА.md",
|
"Андрей/ВАЖНАЯ ЗАМЕТКА.md",
|
||||||
"Образец отправки сообщения с маркером.md",
|
"Образец отправки сообщения с маркером.md",
|
||||||
"Порядок сборки Unity билда под сервер.md",
|
"Порядок сборки Unity билда под сервер.md",
|
||||||
"Алексей/ТЕСТ-КЕЙСЫ.md",
|
|
||||||
"Алексей",
|
"Алексей",
|
||||||
"AssetManagerScheme.md",
|
"AssetManagerScheme.md",
|
||||||
"SERVER/UpdateController.md",
|
"SERVER/UpdateController.md",
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ kanban-plugin: board
|
|||||||
|
|
||||||
## backLog
|
## backLog
|
||||||
|
|
||||||
|
- [ ] выписать все варианты взаимодействия между всеми клиентами и сервером
|
||||||
|
- [ ] sendSystem::sendXmlAnswer новый вариант отпарвки XML пакетов
|
||||||
|
|
||||||
|
|
||||||
## bugs
|
## bugs
|
||||||
@@ -29,6 +31,7 @@ kanban-plugin: board
|
|||||||
|
|
||||||
- [ ] Прибраться в Server
|
- [ ] Прибраться в Server
|
||||||
- [ ] рефакторинг
|
- [ ] рефакторинг
|
||||||
|
- [ ] добавить генерацию пустых файлов, если shared не найден
|
||||||
|
|
||||||
|
|
||||||
## NOW
|
## NOW
|
||||||
|
|||||||
2
DOCS/Алексей/Рефакторинг.md
Normal file
2
DOCS/Алексей/Рефакторинг.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1. DataParser разделить на подклассы, придумать как скомпоновать. Возможно разделить на формирование ответов и парсинг входящих данных.
|
||||||
|
2.
|
||||||
11
DOCS/Алексей/Чек лист по переносу.md
Normal file
11
DOCS/Алексей/Чек лист по переносу.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
- [x] AssetManager
|
||||||
|
- [x] DataParser
|
||||||
|
- [x] Logger
|
||||||
|
- [x] ProcessingSystem
|
||||||
|
- [x] RecognizeSystem
|
||||||
|
- [x] SendSystem
|
||||||
|
- [x] Tools
|
||||||
|
- [x] UpdateController
|
||||||
|
- [x] ClientHandler
|
||||||
|
- [x] MultiThreadServer
|
||||||
|
- [x] ServerLMSWidget
|
||||||
1
DOCS/Как умеем принимать на Server.md
Normal file
1
DOCS/Как умеем принимать на Server.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
- XML файлы с поиском по тегу (DataParser::xmlParser)
|
||||||
0
DOCS/Что умеем отправлять Server - Client QT.md
Normal file
0
DOCS/Что умеем отправлять Server - Client QT.md
Normal file
@@ -33,12 +33,16 @@ add_library(ServerLMS SHARED
|
|||||||
serverlmswidget.cpp
|
serverlmswidget.cpp
|
||||||
serverlmswidget.h
|
serverlmswidget.h
|
||||||
serverlmswidget.ui
|
serverlmswidget.ui
|
||||||
typesDataServerClient.h
|
|
||||||
Client.h
|
|
||||||
clienthandler.cpp
|
clienthandler.cpp
|
||||||
clienthandler.h
|
clienthandler.h
|
||||||
multithreadserver.cpp
|
multithreadserver.cpp
|
||||||
multithreadserver.h
|
multithreadserver.h
|
||||||
|
Data/typesDataServerClient.h
|
||||||
|
Data/Client.h
|
||||||
|
Data/PacketType.h
|
||||||
|
Data/StreamingVersionData.h
|
||||||
|
Systems/assetsmanager.cpp
|
||||||
|
Systems/assetsmanager.h
|
||||||
Systems/recognizesystem.cpp
|
Systems/recognizesystem.cpp
|
||||||
Systems/recognizesystem.h
|
Systems/recognizesystem.h
|
||||||
Systems/updatecontroller.cpp
|
Systems/updatecontroller.cpp
|
||||||
|
|||||||
@@ -50,13 +50,17 @@ public:
|
|||||||
{
|
{
|
||||||
return ready;
|
return ready;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setReady(bool ready)
|
void setReady(bool ready)
|
||||||
{
|
{
|
||||||
this->ready = ready;
|
this->ready = ready;
|
||||||
}
|
}
|
||||||
void setUnity(bool flag){
|
|
||||||
|
void setUnity(bool flag)
|
||||||
|
{
|
||||||
isUnity = flag;
|
isUnity = flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool getIsUnity()
|
bool getIsUnity()
|
||||||
{
|
{
|
||||||
return isUnity;
|
return isUnity;
|
||||||
@@ -75,10 +79,22 @@ public:
|
|||||||
{
|
{
|
||||||
isUnity = !isUnity;
|
isUnity = !isUnity;
|
||||||
}
|
}
|
||||||
bool operator == (Client* right){
|
|
||||||
|
bool operator == (Client* right)
|
||||||
|
{
|
||||||
return this->address == right->address;
|
return this->address == right->address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool getIsLoggedIn()
|
||||||
|
{
|
||||||
|
return isLoggedIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setIsLoggedIn(bool value)
|
||||||
|
{
|
||||||
|
isLoggedIn = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString name;
|
QString name;
|
||||||
@@ -88,6 +104,7 @@ private:
|
|||||||
|
|
||||||
QString login;
|
QString login;
|
||||||
bool ready;
|
bool ready;
|
||||||
|
bool isLoggedIn;
|
||||||
bool isUnity = false;
|
bool isUnity = false;
|
||||||
|
|
||||||
TypeClientAutorization TypeClient;
|
TypeClientAutorization TypeClient;
|
||||||
39
ServerLMS/ServerLMS/Data/PacketType.h
Normal file
39
ServerLMS/ServerLMS/Data/PacketType.h
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
#ifndef PACKETTYPE_H
|
||||||
|
#define PACKETTYPE_H
|
||||||
|
|
||||||
|
enum PacketType
|
||||||
|
{
|
||||||
|
TYPE_NONE = 0,
|
||||||
|
TYPE_UNITY = 1,
|
||||||
|
TYPE_FILE = 2,
|
||||||
|
TYPE_COMMAND =3,
|
||||||
|
TYPE_FOLDER = 4,
|
||||||
|
TYPE_DELETE = 5,
|
||||||
|
TYPE_FINISH = 6,
|
||||||
|
TYPE_NEEDUPDATE = 7,
|
||||||
|
TYPE_XMLANSWER = 8,
|
||||||
|
TYPE_QT = 9,
|
||||||
|
TYPE_DISABLE = 11,
|
||||||
|
TYPE_FILESIZE = 20,
|
||||||
|
|
||||||
|
TYPE_XMLANSWER_MESSAGE_FOR_GUI = 90,
|
||||||
|
|
||||||
|
//xml-ответы на запросы к БД
|
||||||
|
TYPE_XMLANSWER_QUERY_DB__LIST_INSTRUCTORS = 100,
|
||||||
|
TYPE_XMLANSWER_QUERY_DB__LIST_GROUPS = 101,
|
||||||
|
TYPE_XMLANSWER_QUERY_DB__LIST_TRAINEES = 102,
|
||||||
|
TYPE_XMLANSWER_QUERY_DB__LIST_COMPUTERS = 103,
|
||||||
|
TYPE_XMLANSWER_QUERY_DB__LIST_CLASSROOMS = 104,
|
||||||
|
TYPE_XMLANSWER_QUERY_DB__LIST_TASKS = 105,
|
||||||
|
|
||||||
|
//ответы по обновлениям
|
||||||
|
HASH_READY = 150,
|
||||||
|
CHANGE_DATA_VERSION = 151,
|
||||||
|
COPY_VERSION = 152,
|
||||||
|
DELETE_DATA_VERSION = 153,
|
||||||
|
BUSY = 154,
|
||||||
|
FREE = 155
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // PACKETTYPE_H
|
||||||
46
ServerLMS/ServerLMS/Data/StreamingVersionData.h
Normal file
46
ServerLMS/ServerLMS/Data/StreamingVersionData.h
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
#ifndef STREAMINGVERSIONDATA_H
|
||||||
|
#define STREAMINGVERSIONDATA_H
|
||||||
|
|
||||||
|
#include <QTime>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
class StreamingVersionData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
StreamingVersionData(QString absoltePath,QString viewName,QDateTime data,qint32 size)
|
||||||
|
{
|
||||||
|
this->absolutePath = absoltePath;
|
||||||
|
this->viewName = viewName;
|
||||||
|
this->createData = data;
|
||||||
|
this->size = size;
|
||||||
|
}
|
||||||
|
~StreamingVersionData();
|
||||||
|
|
||||||
|
QString getAbsolutPath() const
|
||||||
|
{
|
||||||
|
return absolutePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString getViewName() const
|
||||||
|
{
|
||||||
|
return viewName;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDateTime getCreateData() const
|
||||||
|
{
|
||||||
|
return createData;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32 getSize() const
|
||||||
|
{
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString absolutePath;
|
||||||
|
QString viewName;
|
||||||
|
QDateTime createData;
|
||||||
|
qint32 size;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // STREAMINGVERSIONDATA_H
|
||||||
@@ -22,6 +22,11 @@ struct FileData
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator<(const FileData& data2) const
|
||||||
|
{
|
||||||
|
return this->hash == "FOLDER" && data2.hash !="FOLDER";
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SAttribute
|
struct SAttribute
|
||||||
220
ServerLMS/ServerLMS/Systems/assetsmanager.cpp
Normal file
220
ServerLMS/ServerLMS/Systems/assetsmanager.cpp
Normal file
@@ -0,0 +1,220 @@
|
|||||||
|
#include "assetsmanager.h"
|
||||||
|
|
||||||
|
AssetsManager::AssetsManager(QObject *parent) : QObject(parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AssetsManager::initialize(UpdateController* updateContoller,DataParser *dataParser)
|
||||||
|
{
|
||||||
|
this->updateController = updateContoller;
|
||||||
|
connect(this,&AssetsManager::sigSaveVersion,dataParser,&DataParser::saveVersionToFile);
|
||||||
|
datas = new QList<StreamingVersionData*>;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AssetsManager::setVersionList(QList<StreamingVersionData*> *streamingVersion)
|
||||||
|
{
|
||||||
|
datas->clear();
|
||||||
|
datas = streamingVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AssetsManager::findDuplicate(QString name)
|
||||||
|
{
|
||||||
|
QListIterator<StreamingVersionData*> iterator(*datas);
|
||||||
|
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
if (iterator.next()->getViewName() == name) return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AssetsManager::setVersion(QString versionName)
|
||||||
|
{
|
||||||
|
QListIterator<StreamingVersionData*> iterator(*datas);
|
||||||
|
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
StreamingVersionData *version = iterator.next();
|
||||||
|
|
||||||
|
if (version->getViewName() == versionName)
|
||||||
|
{
|
||||||
|
currentVersionData = version;
|
||||||
|
emit sigSaveVersion(currentVersionData);
|
||||||
|
|
||||||
|
return version->getAbsolutPath();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<FileData> *AssetsManager::prepareLocalPathList(QList<FileData> *fileData)
|
||||||
|
{
|
||||||
|
QList<FileData> *completeList = fileData;
|
||||||
|
|
||||||
|
for(int i = 0; i < completeList->count();i++)
|
||||||
|
{
|
||||||
|
FileData fileData = completeList->at(i);
|
||||||
|
|
||||||
|
int index = fileData.path.indexOf(currentVersionData->getViewName());
|
||||||
|
if(index != -1)
|
||||||
|
{
|
||||||
|
fileData.path = Tools::createRealPath(fileData.path,currentVersionData); //делаем в полный путь
|
||||||
|
completeList->replace(i,fileData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fileData.path = Tools::createRootPath(fileData.path);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return completeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<FileData> *AssetsManager::prepareRealPathList(QList<FileData> *fileData)
|
||||||
|
{
|
||||||
|
QList<FileData> *completeList = fileData;
|
||||||
|
|
||||||
|
for(int i = 0; i < completeList->count();i++)
|
||||||
|
{
|
||||||
|
FileData fileData = completeList->at(i);
|
||||||
|
if(fileData.path.contains(streamingAssetsFolderName))
|
||||||
|
{
|
||||||
|
fileData.path = Tools::createStreamingToRealPath(fileData.path,currentVersionData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fileData.path = Tools::createRealPath(fileData.path,currentVersionData); //делаем в полный путь
|
||||||
|
}
|
||||||
|
|
||||||
|
completeList->replace(i,fileData);
|
||||||
|
}
|
||||||
|
|
||||||
|
return completeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AssetsManager::addVersion(StreamingVersionData *data)
|
||||||
|
{
|
||||||
|
datas->push_back(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AssetsManager::createCopyVersion(QString versionName,QString newVersionName)
|
||||||
|
{
|
||||||
|
qDebug() << "assetManager thread ID " << QThread::currentThreadId();
|
||||||
|
QListIterator<StreamingVersionData*> iterator(*datas);
|
||||||
|
StreamingVersionData* data;
|
||||||
|
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
StreamingVersionData *version = iterator.next();
|
||||||
|
|
||||||
|
if (version->getViewName() == versionName)
|
||||||
|
{
|
||||||
|
data = version;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug() << "Version for copy " << versionName;
|
||||||
|
qDebug() << "New version name " << newVersionName;
|
||||||
|
|
||||||
|
//берем путь до копии
|
||||||
|
//преобразуем в реальный путь
|
||||||
|
QString sourcePath = QDir::currentPath() + "/" + sharedDataFolderName + "/" + versionName;
|
||||||
|
QString destinationPath = QDir::currentPath() + "/" + sharedDataFolderName + "/" + newVersionName;
|
||||||
|
|
||||||
|
QDir sourceDir(sourcePath);
|
||||||
|
|
||||||
|
if(!sourceDir.exists())
|
||||||
|
{
|
||||||
|
qDebug() << "Версии нет в SharedData";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDir destinationDir(destinationPath);
|
||||||
|
if(destinationDir.exists())
|
||||||
|
{
|
||||||
|
qDebug() << "Папка уже существует";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Создаем папку в Shared с новым именем
|
||||||
|
QDir().mkdir(destinationPath);
|
||||||
|
copyAllRecurse(sourcePath,destinationPath);
|
||||||
|
//добавляем в список текущих ассетов
|
||||||
|
updateController->calculateFullHash();
|
||||||
|
updateController->changeAssetVersion(newVersionName);
|
||||||
|
updateController->sendNewVersionList();
|
||||||
|
//повторно отправляем список версий из папки shared
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AssetsManager::deleteVersion(QString versionName)
|
||||||
|
{
|
||||||
|
QMutableListIterator<StreamingVersionData*> iterator(*datas);
|
||||||
|
|
||||||
|
//если версия равна текущей - игнор
|
||||||
|
if (currentVersionData->getViewName() == versionName)
|
||||||
|
return;
|
||||||
|
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
StreamingVersionData *version = iterator.next();
|
||||||
|
|
||||||
|
//проверка на наличие указанной версии
|
||||||
|
if (version->getViewName() == versionName)
|
||||||
|
{
|
||||||
|
//удаление папки
|
||||||
|
QString verFolderPath = QDir::currentPath() + "/" + sharedDataFolderName + "/" + versionName;
|
||||||
|
QDir dir(verFolderPath);
|
||||||
|
dir.removeRecursively();
|
||||||
|
|
||||||
|
//удаление хэша
|
||||||
|
QString hashPath = QDir::currentPath() + "/" + staticDataFolderName + "/" + versionName + "Hash.xml";
|
||||||
|
QFile file(hashPath);
|
||||||
|
|
||||||
|
if(file.exists()){
|
||||||
|
file.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
//удаление
|
||||||
|
datas->removeOne(version);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateController->calculateSharedHash();
|
||||||
|
updateController->sendNewVersionList();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AssetsManager::copyAllRecurse(QString source,QString destination)
|
||||||
|
{
|
||||||
|
|
||||||
|
//Копируем все объекты туда
|
||||||
|
QDir sourceDir(source);
|
||||||
|
|
||||||
|
foreach(QString folder,sourceDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
|
||||||
|
{
|
||||||
|
QString destPath = destination + QDir::separator() + folder;
|
||||||
|
sourceDir.mkpath(destPath);
|
||||||
|
copyAllRecurse(source + QDir::separator() + folder,destPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(QString file,sourceDir.entryList(QDir::Files))
|
||||||
|
{
|
||||||
|
QFile::copy(source + QDir::separator() + file,destination + QDir::separator() + file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AssetsManager::~AssetsManager()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
StreamingVersionData *AssetsManager::getCurrentVersionData() const
|
||||||
|
{
|
||||||
|
return currentVersionData;
|
||||||
|
}
|
||||||
|
|
||||||
41
ServerLMS/ServerLMS/Systems/assetsmanager.h
Normal file
41
ServerLMS/ServerLMS/Systems/assetsmanager.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#ifndef ASSETSMANAGER_H
|
||||||
|
#define ASSETSMANAGER_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <Systems/updatecontroller.h>
|
||||||
|
#include <Data/StreamingVersionData.h>
|
||||||
|
|
||||||
|
|
||||||
|
class AssetsManager : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit AssetsManager(QObject *parent = nullptr);
|
||||||
|
void initialize(UpdateController* updateContoller,DataParser *dataParser);
|
||||||
|
void addVersion(StreamingVersionData *data);
|
||||||
|
void createCopyVersion(QString versionName,QString newName);
|
||||||
|
void deleteVersion(QString version);
|
||||||
|
void setVersionList(QList<StreamingVersionData *> *streamingVersion);
|
||||||
|
bool findDuplicate(QString name);
|
||||||
|
QString setVersion(QString versionName);
|
||||||
|
|
||||||
|
QList<FileData> *prepareLocalPathList(QList<FileData>*fileData);
|
||||||
|
QList<FileData> *prepareRealPathList(QList<FileData> *fileData);
|
||||||
|
QList<FileData> *getRealPathList();
|
||||||
|
|
||||||
|
~AssetsManager();
|
||||||
|
|
||||||
|
StreamingVersionData *getCurrentVersionData() const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void sigSaveVersion(StreamingVersionData *versionData);
|
||||||
|
|
||||||
|
private:
|
||||||
|
UpdateController *updateController;
|
||||||
|
QList<StreamingVersionData*> *datas;
|
||||||
|
StreamingVersionData* currentVersionData;
|
||||||
|
|
||||||
|
void copyAllRecurse(QString source, QString destination);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ASSETSMANAGER_H
|
||||||
@@ -3,10 +3,11 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
|
|
||||||
DataParser::DataParser(ProcessingSystem *processingSystem,QObject *parent) :
|
DataParser::DataParser(AssetsManager *assetManager,ProcessingSystem *processingSystem,QObject *parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
this->processingSystem = processingSystem;
|
this->processingSystem = processingSystem;
|
||||||
|
this->assetsManager = assetManager;
|
||||||
mutex = new QMutex;
|
mutex = new QMutex;
|
||||||
|
|
||||||
if (!QDir(staticDataFolderName).exists()){
|
if (!QDir(staticDataFolderName).exists()){
|
||||||
@@ -285,7 +286,6 @@ void DataParser::xmlFileDataParse(QByteArray array)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QByteArray DataParser::xmlAnswer(QList<SXmlAnswerTag> listTag, QString elemUp1, QString elemUp2)
|
QByteArray DataParser::xmlAnswer(QList<SXmlAnswerTag> listTag, QString elemUp1, QString elemUp2)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@@ -333,18 +333,7 @@ QByteArray DataParser::xmlAnswer(QList<SXmlAnswerTag> listTag, QString elemUp1,
|
|||||||
|
|
||||||
QByteArray array;
|
QByteArray array;
|
||||||
|
|
||||||
/* Открываем файл для Чтения*/
|
array = readTempFile();
|
||||||
QFile fileR(tempFile);
|
|
||||||
if (!fileR.open(QFile::ReadOnly | QFile::Text))
|
|
||||||
{
|
|
||||||
QString str = "Не удалось открыть файл";
|
|
||||||
qDebug() << "xmlAnswer: " << str;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
array = fileR.readAll();
|
|
||||||
fileR.close(); // Закрываем файл
|
|
||||||
}
|
|
||||||
mutex->unlock();
|
mutex->unlock();
|
||||||
|
|
||||||
return array;
|
return array;
|
||||||
@@ -584,6 +573,102 @@ QByteArray DataParser::xmlAnswer_tasks(QStringList listTasks)
|
|||||||
return xmlAnswer(listTag, "TaskArray", "Tasks");
|
return xmlAnswer(listTag, "TaskArray", "Tasks");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QByteArray DataParser::xmlAnswer_currentVersion()
|
||||||
|
{
|
||||||
|
QByteArray array;
|
||||||
|
QFile fileR(version);
|
||||||
|
if (!fileR.open(QFile::ReadOnly | QFile::Text))
|
||||||
|
{
|
||||||
|
QString str = "Не удалось открыть файл";
|
||||||
|
qDebug() << "xmlAnswer: " << str;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
array = fileR.readAll();
|
||||||
|
fileR.close(); // Закрываем файл
|
||||||
|
}
|
||||||
|
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DataParser::createVersionListXmlAnswer(QList<StreamingVersionData *> version)
|
||||||
|
{
|
||||||
|
QList<SXmlAnswerTag> listTag;
|
||||||
|
|
||||||
|
foreach(StreamingVersionData* ver,version)
|
||||||
|
{
|
||||||
|
SAttribute attribute1 = {"Version", ver->getViewName()};
|
||||||
|
SAttribute attribute2 = {"Created", ver->getCreateData().toString()};
|
||||||
|
|
||||||
|
QList<SAttribute> listAttr = {attribute1, attribute2};
|
||||||
|
SXmlAnswerTag tag = {"VersionData", listAttr};
|
||||||
|
|
||||||
|
listTag.append(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QFile file(versionListFile);
|
||||||
|
file.open(QIODevice::WriteOnly);
|
||||||
|
|
||||||
|
QXmlStreamWriter xmlWriter(&file);
|
||||||
|
xmlWriter.setAutoFormatting(true);
|
||||||
|
xmlWriter.writeStartDocument();
|
||||||
|
xmlWriter.writeStartElement("VersionList");
|
||||||
|
|
||||||
|
foreach(SXmlAnswerTag tag,listTag)
|
||||||
|
{
|
||||||
|
xmlWriter.writeStartElement(tag.elementName);
|
||||||
|
|
||||||
|
foreach(SAttribute attribute,tag.attr)
|
||||||
|
{
|
||||||
|
xmlWriter.writeAttribute(attribute.name,attribute.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
xmlWriter.writeEndElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
xmlWriter.writeEndElement();
|
||||||
|
xmlWriter.writeEndDocument();
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
QByteArray DataParser::readTempFile()
|
||||||
|
{
|
||||||
|
QByteArray array;
|
||||||
|
QFile fileR(tempFile);
|
||||||
|
if (!fileR.open(QFile::ReadOnly | QFile::Text))
|
||||||
|
{
|
||||||
|
QString str = "Не удалось открыть файл";
|
||||||
|
qDebug() << "xmlAnswer: " << str;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
array = fileR.readAll();
|
||||||
|
fileR.close(); // Закрываем файл
|
||||||
|
}
|
||||||
|
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DataParser::saveVersionToFile(StreamingVersionData *streamingVersion)
|
||||||
|
{
|
||||||
|
QFile file(version);
|
||||||
|
file.open(QFile::WriteOnly);
|
||||||
|
|
||||||
|
QXmlStreamWriter xmlWriter(&file);
|
||||||
|
xmlWriter.setAutoFormatting(true);
|
||||||
|
xmlWriter.writeStartDocument();
|
||||||
|
|
||||||
|
xmlWriter.writeStartElement("VersionData");
|
||||||
|
xmlWriter.writeAttribute("Version",streamingVersion->getViewName());
|
||||||
|
xmlWriter.writeAttribute("Created",streamingVersion->getCreateData().toString());
|
||||||
|
|
||||||
|
xmlWriter.writeEndElement();
|
||||||
|
xmlWriter.writeEndDocument();
|
||||||
|
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
|
||||||
DataInfo *DataParser::getCurrentDataInfo()
|
DataInfo *DataParser::getCurrentDataInfo()
|
||||||
{
|
{
|
||||||
return dataInfo;
|
return dataInfo;
|
||||||
|
|||||||
@@ -1,27 +1,30 @@
|
|||||||
#ifndef DATAPARSER_H
|
#ifndef DATAPARSER_H
|
||||||
#define DATAPARSER_H
|
#define DATAPARSER_H
|
||||||
|
|
||||||
|
|
||||||
#include "Systems/processingsystem.h"
|
#include "Systems/processingsystem.h"
|
||||||
#include "Systems/tools.h"
|
#include "Systems/tools.h"
|
||||||
|
#include "Systems/assetsmanager.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "serverlmswidget.h"
|
#include "serverlmswidget.h"
|
||||||
#include "typesDataServerClient.h"
|
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
|
|
||||||
|
#include <Data/typesDataServerClient.h>
|
||||||
|
#include <Data/StreamingVersionData.h>
|
||||||
|
|
||||||
class ProcessingSystem;
|
class ProcessingSystem;
|
||||||
class ClientHandler;
|
class ClientHandler;
|
||||||
|
class AssetsManager;
|
||||||
|
|
||||||
class DataParser : public QObject
|
class DataParser : public QObject
|
||||||
{
|
{
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
DataParser(ProcessingSystem *processingSystem,QObject* parent = nullptr);
|
DataParser(AssetsManager *assetManager,ProcessingSystem *processingSystem,QObject* parent = nullptr);
|
||||||
void xmlParser(ClientHandler *client, QByteArray array);
|
void xmlParser(ClientHandler *client, QByteArray array);
|
||||||
void xmlFileDataParse(QByteArray array);
|
void xmlFileDataParse(QByteArray array);
|
||||||
|
|
||||||
@@ -42,6 +45,9 @@ public:
|
|||||||
QByteArray xmlAnswer_task(QString text);
|
QByteArray xmlAnswer_task(QString text);
|
||||||
QByteArray xmlAnswer_notify(QString code);
|
QByteArray xmlAnswer_notify(QString code);
|
||||||
QByteArray xmlAnswer_tasks(QStringList listTasks);
|
QByteArray xmlAnswer_tasks(QStringList listTasks);
|
||||||
|
|
||||||
|
QByteArray xmlAnswer_currentVersion();
|
||||||
|
void createVersionListXmlAnswer(QList<StreamingVersionData*> version);
|
||||||
DataInfo *getCurrentDataInfo();
|
DataInfo *getCurrentDataInfo();
|
||||||
void clearCurrentDataInfo();
|
void clearCurrentDataInfo();
|
||||||
~DataParser();
|
~DataParser();
|
||||||
@@ -52,11 +58,17 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void sigLogMessage(QString log);
|
void sigLogMessage(QString log);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void saveVersionToFile(StreamingVersionData *streamingVersion);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMutex *mutex;
|
QMutex *mutex;
|
||||||
QList<FileData> *datas;
|
QList<FileData> *datas;
|
||||||
ProcessingSystem *processingSystem;
|
ProcessingSystem *processingSystem;
|
||||||
|
AssetsManager *assetsManager;
|
||||||
DataInfo *dataInfo;
|
DataInfo *dataInfo;
|
||||||
|
|
||||||
|
QByteArray readTempFile();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DATAPARSER_H
|
#endif // DATAPARSER_H
|
||||||
|
|||||||
@@ -12,6 +12,12 @@ void ProcessingSystem::initialize(DataParser *dataParser, ServerLMSWidget *serve
|
|||||||
{
|
{
|
||||||
this->server = server;
|
this->server = server;
|
||||||
this->dataParser = dataParser;
|
this->dataParser = dataParser;
|
||||||
|
|
||||||
|
connect(this,&ProcessingSystem::sigAuthChanged,server, &ServerLMSWidget::slot_AuthChanged,Qt::AutoConnection);
|
||||||
|
connect(this,&ProcessingSystem::sigUpdateListClients,server, &ServerLMSWidget::slotUpdateListClients,Qt::AutoConnection);
|
||||||
|
connect(this,&ProcessingSystem::sigLogMessage,server->getLogger(),&Logger::addTextToLogger,Qt::QueuedConnection);
|
||||||
|
connect(this,&ProcessingSystem::signal_msgToClientReady,server, &ServerLMSWidget::slot_msgToClientFromGUI);
|
||||||
|
connect(this,&ProcessingSystem::signal_msgFromClientReady,server, &ServerLMSWidget::slot_msgToGUIfromClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessingSystem::processingClientAutorization(ClientHandler *client, ClientAutorization clientAutorization)
|
void ProcessingSystem::processingClientAutorization(ClientHandler *client, ClientAutorization clientAutorization)
|
||||||
@@ -60,6 +66,7 @@ void ProcessingSystem::processingClientAutorization(ClientHandler *client, Clien
|
|||||||
arrayAnswer = dataParser->xmlAnswer_authorization(false, "", "", "", "");
|
arrayAnswer = dataParser->xmlAnswer_authorization(false, "", "", "", "");
|
||||||
}
|
}
|
||||||
client->sendXmlAnswer(arrayAnswer);
|
client->sendXmlAnswer(arrayAnswer);
|
||||||
|
client->sendVersion();
|
||||||
|
|
||||||
QString str = QString(arrayAnswer);
|
QString str = QString(arrayAnswer);
|
||||||
//logger->addTextToLogger("To Client: " + str);
|
//logger->addTextToLogger("To Client: " + str);
|
||||||
@@ -238,7 +245,7 @@ void ProcessingSystem::processingFromClientMessage(ClientHandler *client, Client
|
|||||||
|
|
||||||
void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotify clientNotify)
|
void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotify clientNotify)
|
||||||
{
|
{
|
||||||
if(clientNotify.Code == "READY")
|
if(clientNotify.Code == commandReadyClient)
|
||||||
{//Клиент готов принять задания
|
{//Клиент готов принять задания
|
||||||
client->getClient()->setReady(true); //скорее всего функции будут внутри хэндлера
|
client->getClient()->setReady(true); //скорее всего функции будут внутри хэндлера
|
||||||
|
|
||||||
@@ -256,15 +263,19 @@ void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotif
|
|||||||
QString str = QString(arrayAnswer);
|
QString str = QString(arrayAnswer);
|
||||||
emit sigLogMessage("To Client: " + str);
|
emit sigLogMessage("To Client: " + str);
|
||||||
}
|
}
|
||||||
else if(clientNotify.Code == "DISABLE")
|
else if(clientNotify.Code == commandDisableClient)
|
||||||
{
|
{
|
||||||
|
qDebug() << "processing thread: " << QThread::currentThreadId();
|
||||||
client->sendDisable();
|
client->sendDisable();
|
||||||
//server->slotDisconnectClient(client->getClient()->getAddress(),client->getClient()->getPort());
|
|
||||||
}
|
}
|
||||||
else if(clientNotify.Code == "GETSERVERDATALIST")
|
else if(clientNotify.Code == commandGetServerDataList)
|
||||||
{
|
{
|
||||||
client->sendHash();
|
client->sendHash();
|
||||||
}
|
}
|
||||||
|
else if(clientNotify.Code == commandCheckVersionList)
|
||||||
|
{
|
||||||
|
client->sendVersionList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#ifndef PROCESSINGSYSTEM_H
|
#ifndef PROCESSINGSYSTEM_H
|
||||||
#define PROCESSINGSYSTEM_H
|
#define PROCESSINGSYSTEM_H
|
||||||
|
|
||||||
#include "sendsystem.h"
|
#include <Systems/sendsystem.h>
|
||||||
#include "typesDataServerClient.h"
|
#include <Data/typesDataServerClient.h>
|
||||||
|
|
||||||
#include <clienthandler.h>
|
#include <clienthandler.h>
|
||||||
#include <serverlmswidget.h>
|
#include <serverlmswidget.h>
|
||||||
@@ -22,7 +22,7 @@ class ProcessingSystem : public QObject
|
|||||||
public:
|
public:
|
||||||
explicit ProcessingSystem(ProviderDBLMS* providerDBLMS, QObject *parent = nullptr);
|
explicit ProcessingSystem(ProviderDBLMS* providerDBLMS, QObject *parent = nullptr);
|
||||||
|
|
||||||
void initialize(DataParser* dataParser,ServerLMSWidget *server);
|
void initialize(DataParser* dataParser,ServerLMSWidget *server); //TODO: проверить необходимость зависимости на ServerLMS
|
||||||
void processingClientAutorization(ClientHandler *client, ClientAutorization clientAutorization);
|
void processingClientAutorization(ClientHandler *client, ClientAutorization clientAutorization);
|
||||||
void processingClientDeAutorization(ClientHandler *client, ClientDeAutorization clientDeAutorization);
|
void processingClientDeAutorization(ClientHandler *client, ClientDeAutorization clientDeAutorization);
|
||||||
void processingClientQueryToDB(ClientHandler *client, ClientQueryToDB clientQueryToDB, int id = 0, void* data = nullptr);
|
void processingClientQueryToDB(ClientHandler *client, ClientQueryToDB clientQueryToDB, int id = 0, void* data = nullptr);
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#include "Client.h"
|
|
||||||
#include "recognizesystem.h"
|
#include "recognizesystem.h"
|
||||||
|
|
||||||
RecognizeSystem::RecognizeSystem(QObject *parent):
|
RecognizeSystem::RecognizeSystem(QObject *parent):
|
||||||
@@ -24,8 +23,13 @@ void RecognizeSystem::initialize(UpdateController *updateController,DataParser*
|
|||||||
this->sendSystem = sendSystem;
|
this->sendSystem = sendSystem;
|
||||||
socket = handler->getSocket();
|
socket = handler->getSocket();
|
||||||
|
|
||||||
connect(this,&RecognizeSystem::sigCalculateHash,updateController,&UpdateController::calculateHash,Qt::DirectConnection);
|
connect(this,&RecognizeSystem::sigCalculateHash,updateController,&UpdateController::calculateFullHash,Qt::AutoConnection);
|
||||||
|
connect(this,&RecognizeSystem::sigCalculateHash,updateController,&UpdateController::setUpCurrentServerHash,Qt::AutoConnection);
|
||||||
|
connect(this,&RecognizeSystem::sigChangeVersion,updateController,&UpdateController::changeAssetVersion,Qt::AutoConnection);
|
||||||
|
connect(this,&RecognizeSystem::sigDeleteVersion,updateController,&UpdateController::deleteAssetVersion,Qt::AutoConnection);
|
||||||
|
connect(this,&RecognizeSystem::sigCopyVersion,updateController,&UpdateController::createCopyVersion,Qt::AutoConnection);
|
||||||
connect(this,&RecognizeSystem::sigXmlParser,dataParser,&DataParser::xmlParser,Qt::DirectConnection);
|
connect(this,&RecognizeSystem::sigXmlParser,dataParser,&DataParser::xmlParser,Qt::DirectConnection);
|
||||||
|
|
||||||
qDebug() << "Recognize init thread ID " << QThread::currentThreadId();
|
qDebug() << "Recognize init thread ID " << QThread::currentThreadId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +79,7 @@ void RecognizeSystem::recognize()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packetType == PacketType::TYPE_COMMAND)
|
if (packetType == PacketType::TYPE_COMMAND) //TODO: надо переделать под какой то нормальный тип, который уже существует
|
||||||
{
|
{
|
||||||
stream.startTransaction();
|
stream.startTransaction();
|
||||||
stream >> command;
|
stream >> command;
|
||||||
@@ -83,7 +87,7 @@ void RecognizeSystem::recognize()
|
|||||||
if (!stream.commitTransaction()) continue;
|
if (!stream.commitTransaction()) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command == "update") //запускает процесс оновления
|
if (command == commandUpdateFilesClient) //запускает процесс оновления
|
||||||
{
|
{
|
||||||
sendSystem->updateFiles(updateController->getFileSendList(),
|
sendSystem->updateFiles(updateController->getFileSendList(),
|
||||||
updateController->getClientDataList());
|
updateController->getClientDataList());
|
||||||
@@ -110,18 +114,16 @@ void RecognizeSystem::recognize()
|
|||||||
|
|
||||||
qDebug() << data;
|
qDebug() << data;
|
||||||
emit sigXmlParser(clientHandler,data);
|
emit sigXmlParser(clientHandler,data);
|
||||||
//dataParser->xmlParser(clientHandler,data);
|
|
||||||
packetType = PacketType::TYPE_NONE;
|
packetType = PacketType::TYPE_NONE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(packetType == PacketType::TYPE_FOLDER) //создание папок
|
if(packetType == PacketType::TYPE_FOLDER) //создание папок
|
||||||
|
|
||||||
{
|
{
|
||||||
if(client->getIsUnity())
|
if(client->getIsUnity())
|
||||||
{
|
{
|
||||||
filePath = socket->readAll();
|
filePath = socket->readAll();
|
||||||
filePath = Tools::createRootScenario(filePath);
|
filePath = Tools::createSharedPath(filePath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -154,12 +156,7 @@ void RecognizeSystem::recognize()
|
|||||||
{
|
{
|
||||||
DataInfo *currentFileData = dataParser->getCurrentDataInfo();
|
DataInfo *currentFileData = dataParser->getCurrentDataInfo();
|
||||||
filePath = currentFileData->path;
|
filePath = currentFileData->path;
|
||||||
|
filePath = Tools::createSharedPath(filePath);
|
||||||
filePath = Tools::createLocalPath(filePath);
|
|
||||||
|
|
||||||
filePath = Tools::createUpdateFilePath(filePath);
|
|
||||||
|
|
||||||
filePath = Tools::createRootScenario(filePath);
|
|
||||||
|
|
||||||
QFile file(filePath);
|
QFile file(filePath);
|
||||||
|
|
||||||
@@ -315,6 +312,69 @@ void RecognizeSystem::recognize()
|
|||||||
packetType = PacketType::TYPE_NONE;
|
packetType = PacketType::TYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(packetType == PacketType::CHANGE_DATA_VERSION)
|
||||||
|
{
|
||||||
|
stream.startTransaction();
|
||||||
|
QString versionName;
|
||||||
|
stream >> versionName;
|
||||||
|
|
||||||
|
if(!stream.commitTransaction()) continue;
|
||||||
|
|
||||||
|
qDebug() << "For change " + versionName;
|
||||||
|
|
||||||
|
emit sigChangeVersion(versionName);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(packetType == PacketType::COPY_VERSION)
|
||||||
|
{
|
||||||
|
QString source;
|
||||||
|
QStringList result;
|
||||||
|
|
||||||
|
stream.startTransaction();
|
||||||
|
stream >> source;
|
||||||
|
|
||||||
|
if(!stream.commitTransaction()) continue;
|
||||||
|
|
||||||
|
result = source.split(";");
|
||||||
|
|
||||||
|
if (updateController->checkDuplicate(result[1]))
|
||||||
|
{
|
||||||
|
sendSystem->sendNotify(commandDuplicateVerName);
|
||||||
|
packetType = PacketType::TYPE_NONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
emit sigCopyVersion(result[0],result[1]);
|
||||||
|
sendSystem->sendPacketType(PacketType::BUSY);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(packetType == PacketType::DELETE_DATA_VERSION)
|
||||||
|
{
|
||||||
|
stream.startTransaction();
|
||||||
|
QString versionName;
|
||||||
|
stream >> versionName;
|
||||||
|
|
||||||
|
if(!stream.commitTransaction()) continue;
|
||||||
|
|
||||||
|
qDebug() << "For delete " + versionName;
|
||||||
|
|
||||||
|
|
||||||
|
if (versionName == baseNameVersion)
|
||||||
|
{
|
||||||
|
sendSystem->sendNotify(commandTryBaseDelete);
|
||||||
|
}
|
||||||
|
else if (versionName == updateController->getCurrentVersionName())
|
||||||
|
{
|
||||||
|
sendSystem->sendNotify(commandTryActiveDelete);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
emit sigDeleteVersion(versionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
packetType = PacketType::TYPE_NONE;
|
packetType = PacketType::TYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
#ifndef RECOGNIZESYSTEM_H
|
#ifndef RECOGNIZESYSTEM_H
|
||||||
#define RECOGNIZESYSTEM_H
|
#define RECOGNIZESYSTEM_H
|
||||||
|
|
||||||
#include "client.h"
|
|
||||||
#include "updatecontroller.h"
|
|
||||||
|
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QTcpSocket>
|
#include <QTcpSocket>
|
||||||
#include "Systems/tools.h"
|
|
||||||
#include "Systems/dataparser.h"
|
|
||||||
#include "serverlmswidget.h"
|
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
|
|
||||||
|
#include <Systems/updatecontroller.h>
|
||||||
|
#include <Systems/tools.h>
|
||||||
|
#include <Systems/dataparser.h>
|
||||||
|
|
||||||
|
#include <Data/Client.h>
|
||||||
|
#include <Data/PacketType.h>
|
||||||
|
|
||||||
|
#include "serverlmswidget.h"
|
||||||
|
|
||||||
class UpdateController;
|
class UpdateController;
|
||||||
class ServerLMSWidget;
|
class ServerLMSWidget;
|
||||||
class ClientHandler;
|
class ClientHandler;
|
||||||
@@ -31,6 +34,9 @@ signals:
|
|||||||
void sigCalculateHash();
|
void sigCalculateHash();
|
||||||
void sigSendToLogger(QString string);
|
void sigSendToLogger(QString string);
|
||||||
void sigXmlParser(ClientHandler *clientHandler,QByteArray data);
|
void sigXmlParser(ClientHandler *clientHandler,QByteArray data);
|
||||||
|
void sigChangeVersion(QString versionName);
|
||||||
|
void sigDeleteVersion(QString versionName);
|
||||||
|
void sigCopyVersion(QString versionName,QString newVersionName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UpdateController *updateController;
|
UpdateController *updateController;
|
||||||
|
|||||||
@@ -11,9 +11,10 @@ void SendSystem::initialize(DataParser *dataParser,Logger *logger)
|
|||||||
this->dataParser = dataParser;
|
this->dataParser = dataParser;
|
||||||
this->logger = logger;
|
this->logger = logger;
|
||||||
|
|
||||||
connect(this,&SendSystem::sigSendToLogger,logger,&Logger::addTextToLogger);
|
connect(this,&SendSystem::sigSendToLogger,logger,&Logger::addTextToLogger,Qt::AutoConnection);
|
||||||
connect(this,&SendSystem::sigSendXMLmessage,dataParser,&DataParser::xmlAnswer_message,Qt::BlockingQueuedConnection);
|
connect(this,&SendSystem::sigSendXMLmessage,dataParser,&DataParser::xmlAnswer_message,Qt::AutoConnection);
|
||||||
connect(this,&SendSystem::sigSendNotify,dataParser,&DataParser::xmlAnswer_notify,Qt::BlockingQueuedConnection);
|
connect(this,&SendSystem::sigSendNotify,dataParser,&DataParser::xmlAnswer_notify,Qt::DirectConnection); //потому что возвращает значение
|
||||||
|
connect(this,&SendSystem::sigSendVersion,dataParser,&DataParser::xmlAnswer_currentVersion,Qt::AutoConnection);
|
||||||
|
|
||||||
qDebug() << "SendSystem thread: " << QThread::currentThreadId();
|
qDebug() << "SendSystem thread: " << QThread::currentThreadId();
|
||||||
}
|
}
|
||||||
@@ -41,7 +42,7 @@ void SendSystem::sendFileBlock(QString path)
|
|||||||
QDataStream stream(socket);
|
QDataStream stream(socket);
|
||||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||||
|
|
||||||
QFile file(Tools::createRootPath(path));
|
QFile file(path);
|
||||||
QFileInfo fileInfo(file);
|
QFileInfo fileInfo(file);
|
||||||
fileSize = fileInfo.size();
|
fileSize = fileInfo.size();
|
||||||
|
|
||||||
@@ -81,15 +82,10 @@ void SendSystem::sendFileBlock(QString path)
|
|||||||
socket->waitForReadyRead(100);
|
socket->waitForReadyRead(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSystem::socketWrite(QByteArray array)
|
void SendSystem::sendVersion()
|
||||||
{
|
{
|
||||||
socket->write(array);
|
QByteArray data = dataParser->xmlAnswer_currentVersion();
|
||||||
socket->waitForBytesWritten(100);
|
sendXmlAnswer(data);
|
||||||
}
|
|
||||||
|
|
||||||
void SendSystem::socketClose()
|
|
||||||
{
|
|
||||||
socket->close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSystem::sendFileBlockWithRename(QString path, QString newName)
|
void SendSystem::sendFileBlockWithRename(QString path, QString newName)
|
||||||
@@ -139,7 +135,7 @@ void SendSystem::sendFileBlockWithRename(QString path, QString newName)
|
|||||||
socket->waitForBytesWritten();
|
socket->waitForBytesWritten();
|
||||||
socket->waitForReadyRead(100);
|
socket->waitForReadyRead(100);
|
||||||
|
|
||||||
sendNotify("HASHSENDCOMPLETE");
|
sendNotify(commandHashCompleteClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSystem::sendFolderBlock(QString path)
|
void SendSystem::sendFolderBlock(QString path)
|
||||||
@@ -162,19 +158,19 @@ void SendSystem::sendDeleteBlock(QString path)
|
|||||||
socket->waitForReadyRead(100);
|
socket->waitForReadyRead(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSystem::sendHello()
|
void SendSystem::sendPacketType(PacketType packetType)
|
||||||
{
|
|
||||||
socket->write(SERVER_HELLO);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SendSystem::sendFinish()
|
|
||||||
{
|
{
|
||||||
QDataStream stream(socket);
|
QDataStream stream(socket);
|
||||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||||
stream << PacketType::TYPE_FINISH;
|
stream << packetType;
|
||||||
socket->waitForReadyRead(100);
|
socket->waitForReadyRead(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SendSystem::sendHello()
|
||||||
|
{
|
||||||
|
socket->write(SERVER_HELLO);
|
||||||
|
}
|
||||||
|
|
||||||
void SendSystem::sendNotify(QString notify)
|
void SendSystem::sendNotify(QString notify)
|
||||||
{
|
{
|
||||||
qDebug() << "SendNotify thread: " << QThread::currentThreadId();
|
qDebug() << "SendNotify thread: " << QThread::currentThreadId();
|
||||||
@@ -202,7 +198,7 @@ void SendSystem::sendXmlAnswer(QByteArray array, PacketType packetType)
|
|||||||
socket->waitForReadyRead(1000);
|
socket->waitForReadyRead(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSystem::sendNeedUpdate(bool flag,quint64 size,quint64 fileCount)
|
void SendSystem::sendNeedUpdate(bool flag,quint64 size,quint64 fileCount,quint64 deleteCount)
|
||||||
{
|
{
|
||||||
QDataStream stream(socket);
|
QDataStream stream(socket);
|
||||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||||
@@ -210,9 +206,20 @@ void SendSystem::sendNeedUpdate(bool flag,quint64 size,quint64 fileCount)
|
|||||||
stream << flag;
|
stream << flag;
|
||||||
stream << size;
|
stream << size;
|
||||||
stream << fileCount;
|
stream << fileCount;
|
||||||
|
stream << deleteCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSystem::updateFiles(QList<FileData> fileSendList, QList<FileData> clientDataList){
|
void SendSystem::updateFiles(QList<FileData> fileSendList, QList<FileData> deleteList){
|
||||||
|
|
||||||
|
QListIterator<FileData> clientIterator(deleteList);
|
||||||
|
|
||||||
|
while(clientIterator.hasNext())
|
||||||
|
{
|
||||||
|
FileData data = clientIterator.next();
|
||||||
|
|
||||||
|
sendDeleteBlock(data.path);
|
||||||
|
if(getIsSendStopped()) return;
|
||||||
|
}
|
||||||
|
|
||||||
QListIterator<FileData> serverIterator(fileSendList);
|
QListIterator<FileData> serverIterator(fileSendList);
|
||||||
|
|
||||||
@@ -234,21 +241,28 @@ void SendSystem::updateFiles(QList<FileData> fileSendList, QList<FileData> clien
|
|||||||
if(getIsSendStopped()) return;
|
if(getIsSendStopped()) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QListIterator<FileData> clientIterator(clientDataList);
|
|
||||||
|
|
||||||
while(clientIterator.hasNext()){
|
|
||||||
FileData data = clientIterator.next();
|
|
||||||
|
|
||||||
sendDeleteBlock(data.path);
|
|
||||||
if(getIsSendStopped()) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
emit sigLoadHash();
|
emit sigLoadHash();
|
||||||
|
|
||||||
sendFinish();
|
sendPacketType(PacketType::TYPE_FINISH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SendSystem::socketWrite(QByteArray array)
|
||||||
|
{
|
||||||
|
socket->write(array);
|
||||||
|
socket->waitForBytesWritten(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendSystem::socketClose()
|
||||||
|
{
|
||||||
|
socket->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SendSystem::socketFlush() //TODO: проверить использование
|
||||||
|
{
|
||||||
|
return socket->flush();
|
||||||
|
}
|
||||||
|
|
||||||
void SendSystem::sendStop()
|
void SendSystem::sendStop()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
#ifndef SENDSYSTEM_H
|
#ifndef SENDSYSTEM_H
|
||||||
#define SENDSYSTEM_H
|
#define SENDSYSTEM_H
|
||||||
|
|
||||||
#include "dataparser.h"
|
|
||||||
#include "Systems/Tools.h"
|
|
||||||
#include "Client.h"
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtNetwork>
|
#include <QtNetwork>
|
||||||
|
|
||||||
|
#include <Systems/dataparser.h>
|
||||||
|
#include <Systems/tools.h>
|
||||||
|
#include <Data/Client.h>
|
||||||
|
#include <Data/PacketType.h>
|
||||||
|
|
||||||
class DataParser;
|
class DataParser;
|
||||||
class FileData;
|
class FileData;
|
||||||
class SendSystem : public QObject
|
class SendSystem : public QObject
|
||||||
@@ -24,13 +26,15 @@ public:
|
|||||||
void sendFileBlockWithRename(QString path,QString newName);
|
void sendFileBlockWithRename(QString path,QString newName);
|
||||||
void sendFolderBlock(QString path);
|
void sendFolderBlock(QString path);
|
||||||
void sendDeleteBlock(QString path);
|
void sendDeleteBlock(QString path);
|
||||||
|
void sendPacketType(PacketType packet);
|
||||||
void sendHello();
|
void sendHello();
|
||||||
void sendFinish();
|
|
||||||
void sendNotify(QString notify);
|
void sendNotify(QString notify);
|
||||||
void sendStop();
|
void sendStop();
|
||||||
void sendXmlAnswer(QByteArray array, PacketType packetType = PacketType::TYPE_XMLANSWER);
|
void sendXmlAnswer(QByteArray array, PacketType packetType = PacketType::TYPE_XMLANSWER);
|
||||||
void sendNeedUpdate(bool flag,quint64 size,quint64 fileCount);
|
void sendNeedUpdate(bool flag,quint64 size,quint64 fileCount,quint64 deleteCount);
|
||||||
void updateFiles(QList<FileData> fileSendList, QList<FileData> clientDataList);
|
void updateFiles(QList<FileData> fileSendList, QList<FileData> deleteList);
|
||||||
|
bool socketFlush();
|
||||||
|
|
||||||
bool getIsSendStopped() const;
|
bool getIsSendStopped() const;
|
||||||
|
|
||||||
~SendSystem();
|
~SendSystem();
|
||||||
@@ -39,11 +43,14 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void socketWrite(QByteArray array);
|
void socketWrite(QByteArray array);
|
||||||
void socketClose();
|
void socketClose();
|
||||||
|
void sendVersion();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void sigLoadHash();
|
void sigLoadHash();
|
||||||
void sigSendToLogger(QString message);
|
void sigSendToLogger(QString message);
|
||||||
QByteArray sigSendXMLmessage(QString message, QString login = "");
|
QByteArray sigSendXMLmessage(QString message, QString login = "");
|
||||||
QByteArray sigSendNotify(QString message);
|
QByteArray sigSendNotify(QString message);
|
||||||
|
QByteArray sigSendVersion();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Client *client;
|
Client *client;
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ QString Tools::getTime()
|
|||||||
|
|
||||||
QString Tools::createLocalPath(QString path)
|
QString Tools::createLocalPath(QString path)
|
||||||
{
|
{
|
||||||
//qDebug() << "Full path: " << path;
|
|
||||||
qint8 pos = path.indexOf(applicationFolderName);
|
qint8 pos = path.indexOf(applicationFolderName);
|
||||||
|
|
||||||
QString localPath = path.remove(0,--pos);
|
QString localPath = path.remove(0,--pos);
|
||||||
@@ -29,10 +28,43 @@ QString Tools::createRootPath(QString path)
|
|||||||
return QDir::currentPath() + path;
|
return QDir::currentPath() + path;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Tools::createRootScenario(QString path){
|
QString Tools::createSharedPath(QString path){
|
||||||
return QDir::currentPath() + scenarioRootPath + path;
|
return QDir::currentPath()+ "/" + sharedDataFolderName + path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Tools::createRealPath(QString path,StreamingVersionData* currentVersionData)
|
||||||
|
{
|
||||||
|
QString resultPath;
|
||||||
|
int index = path.indexOf(currentVersionData->getViewName());
|
||||||
|
|
||||||
|
if(index != -1)
|
||||||
|
{
|
||||||
|
resultPath = path.remove(0,index + currentVersionData->getViewName().length());
|
||||||
|
resultPath.prepend(buildDataPath + streamingAssetsFolderName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
resultPath = Tools::createRootPath(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Tools::createStreamingToRealPath(QString path,StreamingVersionData* streamingVersionData)
|
||||||
|
{
|
||||||
|
QString resultPath = path;
|
||||||
|
int index = path.indexOf(streamingAssetsFolderName);
|
||||||
|
|
||||||
|
if(index != -1)
|
||||||
|
{
|
||||||
|
resultPath = path.remove(0,index + streamingAssetsFolderName.length());
|
||||||
|
resultPath.prepend(QDir::currentPath() + "/" + sharedDataFolderName + "/" + streamingVersionData->getViewName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultPath;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
QString Tools::createUpdateFilePath(QString path)
|
QString Tools::createUpdateFilePath(QString path)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,42 +8,33 @@
|
|||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
|
#include <Data/StreamingVersionData.h>
|
||||||
|
|
||||||
#define TCP_READ_TIMEOUT 5000
|
#define TCP_READ_TIMEOUT 5000
|
||||||
|
|
||||||
static QString staticDataFolderName = "StaticData";
|
static QString staticDataFolderName = "StaticData";
|
||||||
static QString applicationFolderName = "Application";
|
static QString applicationFolderName = "Application";
|
||||||
|
static QString sharedDataFolderName = "SharedData";
|
||||||
static QString streamingAssetsFolderName = "StreamingAssets";
|
static QString streamingAssetsFolderName = "StreamingAssets";
|
||||||
static QString tempFile = staticDataFolderName + "/save.xml";
|
static QString tempFile = staticDataFolderName + "/save.xml";
|
||||||
|
static QString version = staticDataFolderName + "/version.xml";
|
||||||
|
static QString versionListFile = staticDataFolderName + "/versionList.xml";
|
||||||
static QString hashFileName = staticDataFolderName + "/serverHash.xml";
|
static QString hashFileName = staticDataFolderName + "/serverHash.xml";
|
||||||
static QString scenarioRootPath = "\\Application\\RRJLoader\\RRJ_Data";
|
static QString buildHashName = staticDataFolderName + "/buildHash.xml";
|
||||||
|
static QString buildDataPath = "/Application/RRJLoader/RRJ_Data/";
|
||||||
|
|
||||||
enum PacketType
|
static QString baseNameVersion = "base";//может вынести комманды куда нибудь?
|
||||||
{
|
|
||||||
TYPE_NONE = 0,
|
|
||||||
TYPE_UNITY = 1,
|
|
||||||
TYPE_FILE = 2,
|
|
||||||
TYPE_COMMAND =3,
|
|
||||||
TYPE_FOLDER = 4,
|
|
||||||
TYPE_DELETE = 5,
|
|
||||||
TYPE_FINISH = 6,
|
|
||||||
TYPE_NEEDUPDATE = 7,
|
|
||||||
TYPE_XMLANSWER = 8,
|
|
||||||
TYPE_QT = 9,
|
|
||||||
TYPE_DISABLE = 11,
|
|
||||||
TYPE_FILESIZE = 20,
|
|
||||||
|
|
||||||
TYPE_XMLANSWER_MESSAGE_FOR_GUI = 90,
|
static QString commandTryBaseDelete = "BASEDELETETRY";
|
||||||
|
static QString commandTryActiveDelete = "TRYACTIVEDELETE";
|
||||||
//xml-ответы на запросы к БД
|
static QString commandTryCopyWithSameNames = "SAMENAMES";
|
||||||
TYPE_XMLANSWER_QUERY_DB__LIST_INSTRUCTORS = 100,
|
static QString commandGetServerDataList = "GETSERVERDATALIST";
|
||||||
TYPE_XMLANSWER_QUERY_DB__LIST_GROUPS = 101,
|
static QString commandCheckVersionList = "CHECKVERSIONLIST";
|
||||||
TYPE_XMLANSWER_QUERY_DB__LIST_TRAINEES = 102,
|
static QString commandReadyClient = "READY";
|
||||||
TYPE_XMLANSWER_QUERY_DB__LIST_COMPUTERS = 103,
|
static QString commandDisableClient = "DISABLE";
|
||||||
TYPE_XMLANSWER_QUERY_DB__LIST_CLASSROOMS = 104,
|
static QString commandDuplicateVerName = "DUPLICATEVERNAME";
|
||||||
TYPE_XMLANSWER_QUERY_DB__LIST_TASKS = 105
|
static QString commandHashCompleteClient = "HASHSENDCOMPLETE";
|
||||||
};
|
static QString commandUpdateFilesClient = "update";
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(PacketType)
|
|
||||||
|
|
||||||
class Tools {
|
class Tools {
|
||||||
public:
|
public:
|
||||||
@@ -53,7 +44,9 @@ public:
|
|||||||
static QString createRootPath(QString path);
|
static QString createRootPath(QString path);
|
||||||
static QString createUpdateFilePath(QString path);
|
static QString createUpdateFilePath(QString path);
|
||||||
static QString createFolderPath(QString path);
|
static QString createFolderPath(QString path);
|
||||||
static QString createRootScenario(QString path);
|
static QString createSharedPath(QString path);
|
||||||
|
static QString createRealPath(QString path,StreamingVersionData* currentVersionData);
|
||||||
|
static QString createStreamingToRealPath(QString path, StreamingVersionData *streamingVersionData);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,54 @@
|
|||||||
#include "updatecontroller.h"
|
#include "updatecontroller.h"
|
||||||
|
|
||||||
void UpdateController::initialize(TCPServer *server,DataParser *dataParser)
|
UpdateController::UpdateController(QObject *parent) :
|
||||||
|
QObject(parent),
|
||||||
|
server(nullptr)
|
||||||
|
{
|
||||||
|
buildPath = QDir::currentPath() + "/" + applicationFolderName;
|
||||||
|
sharedDataPath = QDir::currentPath() + "/" + sharedDataFolderName;
|
||||||
|
emit sigLogMessage(buildPath);
|
||||||
|
qDebug() << hashFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateController::initialize(ServerLMSWidget *server,DataParser *dataParser,AssetsManager *assetManager)
|
||||||
{
|
{
|
||||||
this->server = server;
|
this->server = server;
|
||||||
this->dataParser = dataParser;
|
this->dataParser = dataParser;
|
||||||
|
this->assetManager = assetManager;
|
||||||
|
|
||||||
sizeToSend = 0;
|
sizeToSend = 0;
|
||||||
|
assetManager->initialize(this,dataParser);
|
||||||
|
|
||||||
|
calculateFullHash();
|
||||||
|
currentStreamingPath = assetManager->setVersion("base");
|
||||||
|
setUpCurrentServerHash();
|
||||||
|
|
||||||
mutex = new QMutex;
|
mutex = new QMutex;
|
||||||
|
qDebug() << "UpdateController init thread ID " << QThread::currentThreadId();
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateController::UpdateController(QObject *parent) : QObject(parent)
|
void UpdateController::changeAssetVersion(QString versionName)
|
||||||
{
|
{
|
||||||
sourcePath = QDir::currentPath() + "/" + applicationFolderName;
|
server->slot_sendPacketToAllClients(PacketType::BUSY);
|
||||||
emit sigLogMessage(sourcePath);
|
qDebug() << "UpdateController thread ID " << QThread::currentThreadId();
|
||||||
qDebug() << hashFileName;
|
currentStreamingPath = assetManager->setVersion(versionName);
|
||||||
|
setUpCurrentServerHash();
|
||||||
|
server->slot_sendPacketToAllClients(PacketType::HASH_READY);
|
||||||
|
server->sendCurrentVersionToAllClient();
|
||||||
|
|
||||||
if(!QFile::exists(hashFileName)){
|
server->slot_sendPacketToAllClients(PacketType::FREE);
|
||||||
calculateHash();
|
}
|
||||||
}else{
|
|
||||||
loadHash();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
void UpdateController::createCopyVersion(QString versionName,QString newVersionName)
|
||||||
|
{
|
||||||
|
server->slot_sendPacketToAllClients(PacketType::BUSY);
|
||||||
|
assetManager->createCopyVersion(versionName,newVersionName);
|
||||||
|
server->slot_sendPacketToAllClients(PacketType::FREE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateController::deleteAssetVersion(QString versionName)
|
||||||
|
{
|
||||||
|
assetManager->deleteVersion(versionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateController::compareFiles(ClientHandler* handler, QByteArray array)
|
void UpdateController::compareFiles(ClientHandler* handler, QByteArray array)
|
||||||
@@ -29,16 +58,6 @@ void UpdateController::compareFiles(ClientHandler* handler, QByteArray array)
|
|||||||
clientDataList.clear();
|
clientDataList.clear();
|
||||||
dataParser->xmlFileDataParse(array);
|
dataParser->xmlFileDataParse(array);
|
||||||
clientDataList.append(*dataParser->getDatas());
|
clientDataList.append(*dataParser->getDatas());
|
||||||
|
|
||||||
//Вывод информации о доступных файлов/*
|
|
||||||
// QListIterator<FileData> iterator(clientDataList);
|
|
||||||
// while(iterator.hasNext()){
|
|
||||||
// auto data = iterator.next();
|
|
||||||
// emit sigLogMessage(data.path);
|
|
||||||
// emit sigLogMessage(data.hash);
|
|
||||||
// emit sigLogMessage("____________");
|
|
||||||
// }*/
|
|
||||||
|
|
||||||
checkNeedUpdate(handler);
|
checkNeedUpdate(handler);
|
||||||
mutex->unlock();
|
mutex->unlock();
|
||||||
}
|
}
|
||||||
@@ -51,18 +70,30 @@ void UpdateController::showHash()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateController::saveHash()
|
void UpdateController::calculateFullHash()
|
||||||
{
|
{
|
||||||
QFile hashFile(hashFileName);
|
server->slot_sendPacketToAllClients(PacketType::BUSY);
|
||||||
|
auto *list = calculateHash(buildPath);
|
||||||
|
saveHash(buildHashName,list);
|
||||||
|
calculateSharedHash();
|
||||||
|
emit sigLogMessage("Calculate hash complete");
|
||||||
|
server->slot_sendPacketToAllClients(PacketType::FREE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateController::saveHash(QString fileName,QList<FileData> *fileList)
|
||||||
|
{
|
||||||
|
QFile hashFile(fileName);
|
||||||
hashFile.open(QIODevice::WriteOnly);
|
hashFile.open(QIODevice::WriteOnly);
|
||||||
QXmlStreamWriter xmlWriter(&hashFile);
|
QXmlStreamWriter xmlWriter(&hashFile);
|
||||||
|
QListIterator<FileData> fileDataIterator(*fileList);
|
||||||
|
|
||||||
xmlWriter.setAutoFormatting(true);
|
xmlWriter.setAutoFormatting(true);
|
||||||
xmlWriter.writeStartDocument();
|
xmlWriter.writeStartDocument();
|
||||||
xmlWriter.writeStartElement("FileDataList");
|
xmlWriter.writeStartElement("FileDataList");
|
||||||
|
|
||||||
foreach (FileData data,serverDataList)
|
while (fileDataIterator.hasNext())
|
||||||
{
|
{
|
||||||
|
FileData data = fileDataIterator.next();
|
||||||
xmlWriter.writeStartElement("FileData");
|
xmlWriter.writeStartElement("FileData");
|
||||||
|
|
||||||
xmlWriter.writeAttribute("Path",data.path);
|
xmlWriter.writeAttribute("Path",data.path);
|
||||||
@@ -124,7 +155,7 @@ void UpdateController::loadHash()
|
|||||||
|
|
||||||
void UpdateController::calculateSize()
|
void UpdateController::calculateSize()
|
||||||
{
|
{
|
||||||
QDirIterator iterator(sourcePath);
|
QDirIterator iterator(buildPath);
|
||||||
quint64 total = 0;
|
quint64 total = 0;
|
||||||
|
|
||||||
while(iterator.hasNext()){
|
while(iterator.hasNext()){
|
||||||
@@ -149,6 +180,23 @@ QString UpdateController::getCommands()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void UpdateController::setUpCurrentServerHash()
|
||||||
|
{
|
||||||
|
QList<FileData> *fileList = new QList<FileData>;
|
||||||
|
fileList->append(*calculateHash(buildPath));
|
||||||
|
fileList->append(*calculateHash(currentStreamingPath));
|
||||||
|
assetManager->prepareLocalPathList(fileList);
|
||||||
|
|
||||||
|
saveHash(hashFileName,fileList);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString UpdateController::getCurrentStreamingPath() const
|
||||||
|
{
|
||||||
|
return currentStreamingPath;
|
||||||
|
}
|
||||||
|
|
||||||
void UpdateController::setLocalFileData(QList<FileData> dataList)
|
void UpdateController::setLocalFileData(QList<FileData> dataList)
|
||||||
{
|
{
|
||||||
serverDataList.append(dataList);
|
serverDataList.append(dataList);
|
||||||
@@ -184,32 +232,6 @@ bool UpdateController::checkNeedUpdate(ClientHandler *handler)
|
|||||||
forSend->append(item);
|
forSend->append(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// for (auto &item:clientDataList) //проверка на недостающие файлы по адресам
|
|
||||||
// {
|
|
||||||
// if (!serverDataList.contains(item))
|
|
||||||
// {
|
|
||||||
// serverDataList.removeOne(item);
|
|
||||||
// clientDataList.removeOne(item);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// for (auto &item:clientDataList) //проверка на недостающие файлы по адресам
|
|
||||||
// {
|
|
||||||
// if(item.path.contains("Temp")){
|
|
||||||
// clientDataList.removeOne(item);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// QListIterator<FileData> serverDiffIterator(serverDataList);
|
|
||||||
|
|
||||||
// while (serverDiffIterator.hasNext()) //добавление недостающих файлов в список для отправки
|
|
||||||
// {
|
|
||||||
// auto fileForUpdate = serverDiffIterator.next();
|
|
||||||
|
|
||||||
// if(fileForUpdate.path.contains("Temp")) continue;
|
|
||||||
|
|
||||||
// fileSendList.append(fileForUpdate);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if(forSend->length() > 0) //формирование сообщения об обновлении
|
if(forSend->length() > 0) //формирование сообщения об обновлении
|
||||||
{
|
{
|
||||||
@@ -220,7 +242,10 @@ bool UpdateController::checkNeedUpdate(ClientHandler *handler)
|
|||||||
log.append(QString::number(forSend->length()));
|
log.append(QString::number(forSend->length()));
|
||||||
log.append(" objects");
|
log.append(" objects");
|
||||||
fileSendList = *forSend;
|
fileSendList = *forSend;
|
||||||
|
|
||||||
emit sigLogMessage(log);
|
emit sigLogMessage(log);
|
||||||
|
printFileList(*forSend);
|
||||||
|
|
||||||
handler->sendMessageBlock(log);
|
handler->sendMessageBlock(log);
|
||||||
needUpdate = true;
|
needUpdate = true;
|
||||||
}
|
}
|
||||||
@@ -242,10 +267,10 @@ bool UpdateController::checkNeedUpdate(ClientHandler *handler)
|
|||||||
log.append(" Need delete: ");
|
log.append(" Need delete: ");
|
||||||
log.append(QString::number(forDelete->length()));
|
log.append(QString::number(forDelete->length()));
|
||||||
log.append(" objects");
|
log.append(" objects");
|
||||||
//ОПАСНОСТЬ С РУКИ! УДАЛИТЬ И ПРИВЕСТИ В ПОРЯДОК
|
fileDeleteList = *forDelete;
|
||||||
clientDataList = *forDelete;
|
|
||||||
//
|
|
||||||
emit sigLogMessage(log);
|
emit sigLogMessage(log);
|
||||||
|
printFileList(*forDelete);
|
||||||
handler->sendMessageBlock(log);
|
handler->sendMessageBlock(log);
|
||||||
needUpdate = true;
|
needUpdate = true;
|
||||||
}
|
}
|
||||||
@@ -255,33 +280,27 @@ bool UpdateController::checkNeedUpdate(ClientHandler *handler)
|
|||||||
log.append(Tools::getTime());
|
log.append(Tools::getTime());
|
||||||
log.append(" Client: " + handler->getClient()->getLogin());
|
log.append(" Client: " + handler->getClient()->getLogin());
|
||||||
log.append(" no delete required");
|
log.append(" no delete required");
|
||||||
|
|
||||||
emit sigLogMessage(log);
|
emit sigLogMessage(log);
|
||||||
handler->sendMessageBlock(log);
|
handler->sendMessageBlock(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
CalculateSizeToSend(*forSend);
|
CalculateSizeToSend(*forSend);
|
||||||
handler->sendNeedUpdate(needUpdate,sizeToSend,forSend->length());
|
handler->sendNeedUpdate(needUpdate,sizeToSend,forSend->length(),forDelete->length());
|
||||||
|
|
||||||
return needUpdate;
|
return needUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateController::calculateHash()
|
QList<FileData>* UpdateController::calculateHash(QString path)
|
||||||
{
|
{
|
||||||
|
|
||||||
QFile file(hashFileName);
|
|
||||||
serverDataList.clear();
|
serverDataList.clear();
|
||||||
|
|
||||||
if(file.exists()){
|
QDirIterator iterator(path,QDirIterator::Subdirectories);
|
||||||
file.remove();
|
if(!QDir(path).exists()){
|
||||||
|
QDir().mkdir(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
QDirIterator iterator(sourcePath,QDirIterator::Subdirectories);
|
QDir dir(path);
|
||||||
|
dir.setFilter(QDir::NoDotAndDotDot);
|
||||||
if(!QDir(applicationFolderName).exists()){
|
|
||||||
QDir().mkdir(applicationFolderName);
|
|
||||||
}
|
|
||||||
|
|
||||||
QDir dir(sourcePath);
|
|
||||||
QString hashString;
|
QString hashString;
|
||||||
QList<FileData> *files = new QList<FileData>;
|
QList<FileData> *files = new QList<FileData>;
|
||||||
|
|
||||||
@@ -323,21 +342,15 @@ void UpdateController::calculateHash()
|
|||||||
currentFile.hash = "FOLDER";
|
currentFile.hash = "FOLDER";
|
||||||
currentFile.path = Tools::createLocalPath(fileInfo.path());
|
currentFile.path = Tools::createLocalPath(fileInfo.path());
|
||||||
|
|
||||||
if(!folderDataList.contains(currentFile)){
|
if(!files->contains(currentFile)){
|
||||||
folderDataList.push_back(currentFile);
|
files->push_back(currentFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit sigLogMessage("Calculate hash complete");
|
std::sort(files->begin(),files->end());
|
||||||
serverDataList.append(folderDataList);
|
|
||||||
serverDataList.append(*files);
|
serverDataList.append(*files);
|
||||||
|
return files;
|
||||||
saveHash();
|
|
||||||
|
|
||||||
qDebug() << "Recalculate complete";
|
|
||||||
delete files;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray UpdateController::getLocalHash()
|
QByteArray UpdateController::getLocalHash()
|
||||||
@@ -352,28 +365,96 @@ QByteArray UpdateController::getLocalHash()
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString UpdateController::getCurrentVersionName()
|
||||||
|
{
|
||||||
|
return assetManager->getCurrentVersionData()->getViewName();
|
||||||
|
}
|
||||||
|
|
||||||
void UpdateController::CalculateSizeToSend(QList<FileData> diffList)
|
void UpdateController::CalculateSizeToSend(QList<FileData> diffList)
|
||||||
{
|
{
|
||||||
QListIterator<FileData> serverDiffIterator(diffList);
|
QListIterator<FileData> serverDiffIterator(diffList);
|
||||||
|
|
||||||
while (serverDiffIterator.hasNext()) //добавление недостающих файлов в список для отправки
|
while (serverDiffIterator.hasNext())
|
||||||
{
|
{
|
||||||
auto pathForUpdate = serverDiffIterator.next();
|
QString path;
|
||||||
QString path = Tools::createRootPath(pathForUpdate.path);
|
FileData pathForUpdate = serverDiffIterator.next();
|
||||||
|
if(pathForUpdate.path.contains(streamingAssetsFolderName))
|
||||||
|
{
|
||||||
|
path = Tools::createStreamingToRealPath(pathForUpdate.path,assetManager->getCurrentVersionData());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
path = Tools::createRootPath(pathForUpdate.path);
|
||||||
|
}
|
||||||
|
|
||||||
QFile file(path);
|
QFile file(path);
|
||||||
|
|
||||||
sizeToSend += file.size();
|
sizeToSend += file.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateController::~UpdateController()
|
void UpdateController::calculateSharedHash()
|
||||||
{
|
{
|
||||||
|
QDir sharedDir(sharedDataPath);
|
||||||
|
QDirIterator dirIterator(sharedDir);
|
||||||
|
QList<FileData> *fileList = new QList<FileData>;
|
||||||
|
QList<StreamingVersionData*> *versionList = new QList<StreamingVersionData*>;
|
||||||
|
|
||||||
|
while (dirIterator.hasNext())
|
||||||
|
{
|
||||||
|
dirIterator.next();
|
||||||
|
QFileInfo fileInfo = dirIterator.fileInfo();
|
||||||
|
if (fileInfo.fileName() == "." || fileInfo.fileName() == "..")
|
||||||
|
continue;
|
||||||
|
|
||||||
|
QString fileName = staticDataFolderName + "/" + fileInfo.fileName() + "Hash.xml";
|
||||||
|
|
||||||
|
fileList = calculateHash(fileInfo.absoluteFilePath());
|
||||||
|
saveHash(fileName,fileList);
|
||||||
|
|
||||||
|
StreamingVersionData *version = new StreamingVersionData(
|
||||||
|
fileInfo.absoluteFilePath(),fileInfo.fileName(),
|
||||||
|
fileInfo.birthTime(),fileInfo.size());
|
||||||
|
|
||||||
|
versionList->append(version);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
dataParser->createVersionListXmlAnswer(*versionList);
|
||||||
|
assetManager->setVersionList(versionList);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FileData> UpdateController::getFileSendList() const
|
void UpdateController::sendNewVersionList()
|
||||||
{
|
{
|
||||||
return fileSendList;
|
server->sendNewVersionListToAllClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UpdateController::checkDuplicate(QString versionName)
|
||||||
|
{
|
||||||
|
return assetManager->findDuplicate(versionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateController::printFileList(QList<FileData> fileData)
|
||||||
|
{
|
||||||
|
QListIterator<FileData> iterator(fileData);
|
||||||
|
|
||||||
|
while (iterator.hasNext())
|
||||||
|
{
|
||||||
|
auto next = iterator.next();
|
||||||
|
emit sigLogMessage(next.path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<FileData> UpdateController::getFileDeleteList() const
|
||||||
|
{
|
||||||
|
return fileDeleteList;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<FileData> UpdateController::getFileSendList()
|
||||||
|
{
|
||||||
|
|
||||||
|
QList<FileData> sendList = *assetManager->prepareRealPathList(&fileSendList);
|
||||||
|
return sendList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -382,3 +463,8 @@ QList<FileData> UpdateController::getClientDataList() const
|
|||||||
return clientDataList;
|
return clientDataList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateController::~UpdateController()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,13 +9,16 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include "Systems/dataparser.h"
|
|
||||||
#include "typesDataServerClient.h"
|
#include <Systems/dataparser.h>
|
||||||
|
#include <Data/typesDataServerClient.h>
|
||||||
|
|
||||||
class TCPServer;
|
class TCPServer;
|
||||||
class SendSystem;
|
class SendSystem;
|
||||||
class DataParser;
|
class DataParser;
|
||||||
class ClientHandler;
|
class ClientHandler;
|
||||||
|
class AssetsManager;
|
||||||
|
class ServerLMSWidget;
|
||||||
|
|
||||||
class UpdateController : public QObject
|
class UpdateController : public QObject
|
||||||
{
|
{
|
||||||
@@ -24,39 +27,57 @@ class UpdateController : public QObject
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
explicit UpdateController(QObject *parent = 0);
|
explicit UpdateController(QObject *parent = 0);
|
||||||
void initialize(TCPServer* server,DataParser *dataParser);
|
void initialize(ServerLMSWidget* server,DataParser *dataParser,AssetsManager *assetManager);
|
||||||
void compareFiles(ClientHandler* handler, QByteArray array);
|
void compareFiles(ClientHandler* handler, QByteArray array);
|
||||||
void showHash();
|
void showHash();
|
||||||
void calculateHash();
|
void calculateFullHash();
|
||||||
|
void calculateSharedHash();
|
||||||
|
void sendNewVersionList();
|
||||||
|
void setCurrentStreamingPath(QString path);
|
||||||
|
bool checkDuplicate(QString versionName);
|
||||||
|
QList<FileData>* calculateHash(QString path);
|
||||||
QByteArray getLocalHash();
|
QByteArray getLocalHash();
|
||||||
|
|
||||||
QList<FileData> getFileSendList() const;
|
QString getCurrentVersionName();
|
||||||
|
QList<FileData> getFileSendList();
|
||||||
QList<FileData> getClientDataList() const;
|
QList<FileData> getClientDataList() const;
|
||||||
|
QList<FileData> getFileDeleteList() const;
|
||||||
|
QString getCurrentStreamingPath() const;
|
||||||
|
|
||||||
~UpdateController();
|
~UpdateController();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void changeAssetVersion(QString versionName);
|
||||||
|
void createCopyVersion(QString versionName,QString newVersionName);
|
||||||
|
void deleteAssetVersion(QString versionName);
|
||||||
|
void setUpCurrentServerHash();
|
||||||
signals:
|
signals:
|
||||||
void sigLogMessage(QString message);
|
void sigLogMessage(QString message);
|
||||||
|
//void sigSendPackege(PacketType packetType);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<FileData> clientDataList;
|
QList<FileData> clientDataList;
|
||||||
QList<FileData> serverDataList;
|
QList<FileData> serverDataList;
|
||||||
QList<FileData> folderDataList;
|
|
||||||
|
|
||||||
QList<FileData> fileSendList;
|
QList<FileData> fileSendList;
|
||||||
QList<FileData> fileDeleteList;
|
QList<FileData> fileDeleteList;
|
||||||
|
|
||||||
QString sourcePath;
|
QString buildPath;
|
||||||
TCPServer *server;
|
QString currentStreamingPath;
|
||||||
|
QString sharedDataPath;
|
||||||
|
ServerLMSWidget *server;
|
||||||
DataParser *dataParser;
|
DataParser *dataParser;
|
||||||
|
AssetsManager *assetManager;
|
||||||
quint64 sizeToSend;
|
quint64 sizeToSend;
|
||||||
QMutex *mutex;
|
QMutex *mutex;
|
||||||
|
|
||||||
QString getCommands();
|
QString getCommands();
|
||||||
|
void printFileList(QList<FileData> fileData);
|
||||||
|
|
||||||
bool checkNeedUpdate(ClientHandler* handler);
|
bool checkNeedUpdate(ClientHandler* handler);
|
||||||
void setLocalFileData(QList<FileData> dataList);
|
void setLocalFileData(QList<FileData> dataList);
|
||||||
void calculateSize();
|
void calculateSize();
|
||||||
void saveHash();
|
void saveHash(QString fileName,QList<FileData> *fileList);
|
||||||
void loadHash();
|
void loadHash();
|
||||||
void CalculateSizeToSend(QList<FileData> diffList);
|
void CalculateSizeToSend(QList<FileData> diffList);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,16 +44,19 @@ void ClientHandler::initialize(int descriptor,ServerLMSWidget *serverWidget,
|
|||||||
connect(this,&ClientHandler::sigFolderBlock,sendSystem,&SendSystem::sendFolderBlock,Qt::AutoConnection);
|
connect(this,&ClientHandler::sigFolderBlock,sendSystem,&SendSystem::sendFolderBlock,Qt::AutoConnection);
|
||||||
connect(this,&ClientHandler::sigGetIsSendStopped,sendSystem,&SendSystem::getIsSendStopped,Qt::AutoConnection);
|
connect(this,&ClientHandler::sigGetIsSendStopped,sendSystem,&SendSystem::getIsSendStopped,Qt::AutoConnection);
|
||||||
connect(this,&ClientHandler::sigSendDeleteBlock,sendSystem,&SendSystem::sendDeleteBlock,Qt::AutoConnection);
|
connect(this,&ClientHandler::sigSendDeleteBlock,sendSystem,&SendSystem::sendDeleteBlock,Qt::AutoConnection);
|
||||||
connect(this,&ClientHandler::sigSendFinish,sendSystem,&SendSystem::sendFinish,Qt::AutoConnection);
|
connect(this,&ClientHandler::sigSendFinish,sendSystem,&SendSystem::sendPacketType,Qt::AutoConnection);
|
||||||
connect(this,&ClientHandler::sigSendMessageBlock,sendSystem,&SendSystem::sendMessageBlock,Qt::AutoConnection);
|
connect(this,&ClientHandler::sigSendMessageBlock,sendSystem,&SendSystem::sendMessageBlock,Qt::AutoConnection);
|
||||||
connect(this,&ClientHandler::sigNeedUpdate,sendSystem,&SendSystem::sendNeedUpdate,Qt::AutoConnection);
|
connect(this,&ClientHandler::sigNeedUpdate,sendSystem,&SendSystem::sendNeedUpdate,Qt::AutoConnection);
|
||||||
connect(this,&ClientHandler::sigSendNotify,sendSystem,&SendSystem::sendNotify,Qt::AutoConnection);
|
connect(this,&ClientHandler::sigSendNotify,sendSystem,&SendSystem::sendNotify,Qt::AutoConnection);
|
||||||
connect(this,&ClientHandler::sigSendFileBlockWithRename,sendSystem,&SendSystem::sendFileBlockWithRename,Qt::AutoConnection);
|
connect(this,&ClientHandler::sigSendFileBlockWithRename,sendSystem,&SendSystem::sendFileBlockWithRename,Qt::AutoConnection);
|
||||||
connect(socket,&QTcpSocket::readyRead,recognizeSystem,&RecognizeSystem::recognize,Qt::AutoConnection);
|
connect(this,&ClientHandler::sigSendVersion,sendSystem,&SendSystem::sendVersion,Qt::AutoConnection);
|
||||||
connect(socket, &QTcpSocket::disconnected, this, &ClientHandler::sendDisable,Qt::AutoConnection);
|
|
||||||
connect(this,&ClientHandler::sigSocketWrite,sendSystem,&SendSystem::socketWrite,Qt::AutoConnection);
|
connect(this,&ClientHandler::sigSocketWrite,sendSystem,&SendSystem::socketWrite,Qt::AutoConnection);
|
||||||
connect(this,&ClientHandler::sigSocketClose,sendSystem,&SendSystem::socketClose,Qt::AutoConnection);
|
connect(this,&ClientHandler::sigSocketClose,sendSystem,&SendSystem::socketClose,Qt::AutoConnection);
|
||||||
|
connect(this,&ClientHandler::sigSocketFlush,sendSystem,&SendSystem::socketFlush,Qt::AutoConnection);
|
||||||
|
connect(this,&ClientHandler::sigSendPacketType,sendSystem,&SendSystem::sendPacketType,Qt::AutoConnection);
|
||||||
|
|
||||||
|
connect(socket,&QTcpSocket::readyRead,recognizeSystem,&RecognizeSystem::recognize,Qt::AutoConnection);
|
||||||
|
connect(socket, &QTcpSocket::disconnected, this, &ClientHandler::sendDisable,Qt::AutoConnection);
|
||||||
|
|
||||||
recognizeSystem->initialize(updateController,dataParser,serverWidget,sendSystem, this);
|
recognizeSystem->initialize(updateController,dataParser,serverWidget,sendSystem, this);
|
||||||
sendSystem->setClient(client,socket);
|
sendSystem->setClient(client,socket);
|
||||||
@@ -62,6 +65,11 @@ void ClientHandler::initialize(int descriptor,ServerLMSWidget *serverWidget,
|
|||||||
emit sigInitSender(dataParser,logger);
|
emit sigInitSender(dataParser,logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientHandler::setClient(Client *value)
|
||||||
|
{
|
||||||
|
client = value;
|
||||||
|
}
|
||||||
|
|
||||||
void ClientHandler::sendHash()
|
void ClientHandler::sendHash()
|
||||||
{
|
{
|
||||||
QString path = "\\" + hashFileName;
|
QString path = "\\" + hashFileName;
|
||||||
@@ -69,21 +77,31 @@ void ClientHandler::sendHash()
|
|||||||
//emit sigSendNotify("HASHSENDCOMPLETE");
|
//emit sigSendNotify("HASHSENDCOMPLETE");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientHandler::sendVersion()
|
||||||
|
{
|
||||||
|
emit sigSendVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClientHandler::sendVersionList()
|
||||||
|
{
|
||||||
|
QFile file(versionListFile);
|
||||||
|
file.open(QFile::ReadOnly);
|
||||||
|
|
||||||
|
QByteArray array = file.readAll();
|
||||||
|
file.close();
|
||||||
|
emit sendXmlAnswer(array);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClientHandler::sendPacketType(PacketType packetType)
|
||||||
|
{
|
||||||
|
emit sigSendPacketType(packetType);
|
||||||
|
}
|
||||||
|
|
||||||
void ClientHandler::sendXmlAnswer(QByteArray array, PacketType packetType)
|
void ClientHandler::sendXmlAnswer(QByteArray array, PacketType packetType)
|
||||||
{
|
{
|
||||||
emit sigSendXmlAnswer(array, packetType);
|
emit sigSendXmlAnswer(array, packetType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientHandler::sendFolderBlock(QString path)
|
|
||||||
{
|
|
||||||
emit sigFolderBlock(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClientHandler::sendFileBlock(QString path)
|
|
||||||
{
|
|
||||||
emit sigFileBlock(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ClientHandler::getIsSendStopped()
|
bool ClientHandler::getIsSendStopped()
|
||||||
{
|
{
|
||||||
return emit sigGetIsSendStopped();
|
return emit sigGetIsSendStopped();
|
||||||
@@ -96,7 +114,7 @@ void ClientHandler::sendDeleteBlock(QString path)
|
|||||||
|
|
||||||
void ClientHandler::sendFinish()
|
void ClientHandler::sendFinish()
|
||||||
{
|
{
|
||||||
emit sigSendFinish();
|
emit sigSendFinish(PacketType::TYPE_FINISH);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientHandler::sendMessageBlock(QString text)
|
void ClientHandler::sendMessageBlock(QString text)
|
||||||
@@ -104,9 +122,9 @@ void ClientHandler::sendMessageBlock(QString text)
|
|||||||
emit sigSendMessageBlock(text);
|
emit sigSendMessageBlock(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientHandler::sendNeedUpdate(bool flag, quint64 size, quint64 fileCount)
|
void ClientHandler::sendNeedUpdate(bool flag, quint64 size, quint64 fileCount,quint64 deleteCount)
|
||||||
{
|
{
|
||||||
emit sigNeedUpdate(flag,size,fileCount);
|
emit sigNeedUpdate(flag,size,fileCount,deleteCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientHandler::sendDisable()
|
void ClientHandler::sendDisable()
|
||||||
|
|||||||
@@ -2,11 +2,13 @@
|
|||||||
#define CLIENTHANDLER_H
|
#define CLIENTHANDLER_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <Systems/sendsystem.h>
|
|
||||||
#include "Client.h"
|
|
||||||
#include <QTcpSocket>
|
#include <QTcpSocket>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include "Systems/tools.h"
|
|
||||||
|
#include <Systems/sendsystem.h>
|
||||||
|
#include <Systems/tools.h>
|
||||||
|
#include <Data/Client.h>
|
||||||
|
#include <Data/PacketType.h>
|
||||||
|
|
||||||
class SendSystem;
|
class SendSystem;
|
||||||
class DataParser;
|
class DataParser;
|
||||||
@@ -29,10 +31,13 @@ public:
|
|||||||
void sendDeleteBlock(QString path);
|
void sendDeleteBlock(QString path);
|
||||||
void sendFinish();
|
void sendFinish();
|
||||||
void sendMessageBlock(QString text);
|
void sendMessageBlock(QString text);
|
||||||
void sendNeedUpdate(bool flag, quint64 size,quint64 fileCount);
|
void sendNeedUpdate(bool flag, quint64 size,quint64 fileCount,quint64 deleteCount);
|
||||||
void sendDisable();
|
void sendDisable();
|
||||||
void recognize();
|
void recognize();
|
||||||
void sendHash();
|
void sendHash();
|
||||||
|
void sendVersionList();
|
||||||
|
void sendPacketType(PacketType packetType);
|
||||||
|
void sendVersion();
|
||||||
|
|
||||||
~ClientHandler();
|
~ClientHandler();
|
||||||
|
|
||||||
@@ -48,9 +53,9 @@ signals:
|
|||||||
void sigFileBlock(QString path);
|
void sigFileBlock(QString path);
|
||||||
bool sigGetIsSendStopped();
|
bool sigGetIsSendStopped();
|
||||||
void sigSendDeleteBlock(QString path);
|
void sigSendDeleteBlock(QString path);
|
||||||
void sigSendFinish();
|
void sigSendFinish(PacketType packetType);
|
||||||
void sigSendMessageBlock(QString text);
|
void sigSendMessageBlock(QString text);
|
||||||
void sigNeedUpdate(bool flag,quint64 size,quint64 fileCount);
|
void sigNeedUpdate(bool flag,quint64 size,quint64 fileCount,quint64 deleteCount);
|
||||||
void sigClientDisconnected(QString address,QString port);
|
void sigClientDisconnected(QString address,QString port);
|
||||||
void sigSendHash();
|
void sigSendHash();
|
||||||
void sigRecognize(ClientHandler *handler);
|
void sigRecognize(ClientHandler *handler);
|
||||||
@@ -59,13 +64,16 @@ signals:
|
|||||||
void sigSocketWrite(QByteArray array);
|
void sigSocketWrite(QByteArray array);
|
||||||
void sigSocketClose();
|
void sigSocketClose();
|
||||||
bool sigSocketFlush();
|
bool sigSocketFlush();
|
||||||
|
void sigSendVersion();
|
||||||
|
void sigSendPacketType(PacketType packetType);
|
||||||
|
|
||||||
public :
|
public :
|
||||||
QThread *thread;
|
QThread *thread;
|
||||||
QTcpSocket *socket;
|
QTcpSocket *socket;
|
||||||
|
|
||||||
void initialize(int descriptor, ServerLMSWidget *serverWidget,
|
void initialize(int descriptor, ServerLMSWidget *serverWidget,
|
||||||
UpdateController *updateController, DataParser *dataParser,Logger *logger);
|
UpdateController *updateController, DataParser *dataParser,Logger *logger);
|
||||||
|
void setClient(Client *value);
|
||||||
private:
|
private:
|
||||||
UpdateController *updateController;
|
UpdateController *updateController;
|
||||||
RecognizeSystem *recognizeSystem;
|
RecognizeSystem *recognizeSystem;
|
||||||
|
|||||||
@@ -51,8 +51,12 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
|||||||
connect(logger,&Logger::sigSendTextToLogger,this,&ServerLMSWidget::slotAddToLog,Qt::QueuedConnection);
|
connect(logger,&Logger::sigSendTextToLogger,this,&ServerLMSWidget::slotAddToLog,Qt::QueuedConnection);
|
||||||
logger->moveToThread(loggerThread);
|
logger->moveToThread(loggerThread);
|
||||||
|
|
||||||
|
assetsManager = new AssetsManager;
|
||||||
|
assetsManager->moveToThread(updateThread);
|
||||||
|
|
||||||
processingSystem = new ProcessingSystem(providerDBLMS);
|
processingSystem = new ProcessingSystem(providerDBLMS);
|
||||||
dataParser = new DataParser(processingSystem);
|
processingSystem->moveToThread(updateThread);
|
||||||
|
dataParser = new DataParser(assetsManager,processingSystem);
|
||||||
|
|
||||||
updateController = new UpdateController;
|
updateController = new UpdateController;
|
||||||
updateController->moveToThread(updateThread);
|
updateController->moveToThread(updateThread);
|
||||||
@@ -60,21 +64,19 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
|||||||
loggerThread->start();
|
loggerThread->start();
|
||||||
updateThread->start();
|
updateThread->start();
|
||||||
|
|
||||||
updateController->initialize(nullptr,dataParser);
|
|
||||||
processingSystem->initialize(dataParser,this);
|
processingSystem->initialize(dataParser,this);
|
||||||
|
|
||||||
logger->setTypeLog("widget");
|
logger->setTypeLog("widget");
|
||||||
|
|
||||||
connect(processingSystem,&ProcessingSystem::sigUpdateListClients,this, &ServerLMSWidget::slotUpdateListClients);
|
|
||||||
connect(updateController,&UpdateController::sigLogMessage,logger,&Logger::addTextToLogger);
|
connect(updateController,&UpdateController::sigLogMessage,logger,&Logger::addTextToLogger);
|
||||||
connect(dataParser,&DataParser::sigLogMessage,logger,&Logger::addTextToLogger);
|
connect(dataParser,&DataParser::sigLogMessage,logger,&Logger::addTextToLogger);
|
||||||
connect(processingSystem,&ProcessingSystem::sigLogMessage,logger,&Logger::addTextToLogger);
|
|
||||||
connect(this,&ServerLMSWidget::sigLog,logger,&Logger::addTextToLogger);
|
|
||||||
|
|
||||||
connect(processingSystem,&ProcessingSystem::sigAuthChanged,this, &ServerLMSWidget::slot_AuthChanged);
|
connect(this,&ServerLMSWidget::sigUpdateController,updateController,&UpdateController::initialize,Qt::DirectConnection);
|
||||||
connect(processingSystem,&ProcessingSystem::signal_msgToClientReady,this, &ServerLMSWidget::slot_msgToClientFromGUI);
|
connect(this,&ServerLMSWidget::sigLog,logger,&Logger::addTextToLogger,Qt::AutoConnection);
|
||||||
connect(processingSystem,&ProcessingSystem::signal_msgFromClientReady,this, &ServerLMSWidget::slot_msgToGUIfromClient);
|
connect(this,&ServerLMSWidget::sigCalculateFullHash,updateController,&UpdateController::calculateFullHash,Qt::AutoConnection);
|
||||||
|
|
||||||
|
emit sigUpdateController(this,dataParser,assetsManager);
|
||||||
on_btnStartServer_clicked();
|
on_btnStartServer_clicked();
|
||||||
|
|
||||||
first = true;
|
first = true;
|
||||||
@@ -95,6 +97,30 @@ void ServerLMSWidget::autorizationHandler(QString login)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ServerLMSWidget::sendNewVersionListToAllClient()
|
||||||
|
{
|
||||||
|
foreach(int idSocket,clientsMap.keys())
|
||||||
|
{
|
||||||
|
ClientHandler *handler = clientsMap[idSocket];
|
||||||
|
|
||||||
|
if (!handler->getClient()->getIsLoggedIn()) continue;
|
||||||
|
|
||||||
|
handler->sendVersionList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerLMSWidget::sendCurrentVersionToAllClient()
|
||||||
|
{
|
||||||
|
foreach(int idSocket,clientsMap.keys())
|
||||||
|
{
|
||||||
|
ClientHandler *handler = clientsMap[idSocket];
|
||||||
|
|
||||||
|
if (!handler->getClient()->getIsLoggedIn()) continue;
|
||||||
|
handler->sendVersion();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ServerLMSWidget::~ServerLMSWidget()
|
ServerLMSWidget::~ServerLMSWidget()
|
||||||
{
|
{
|
||||||
stopServer();
|
stopServer();
|
||||||
@@ -162,6 +188,11 @@ bool ServerLMSWidget::stopServer()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger *ServerLMSWidget::getLogger() const
|
||||||
|
{
|
||||||
|
return logger;
|
||||||
|
}
|
||||||
|
|
||||||
QMap<int, ClientHandler *> ServerLMSWidget::getClientsMap() const
|
QMap<int, ClientHandler *> ServerLMSWidget::getClientsMap() const
|
||||||
{
|
{
|
||||||
return clientsMap;
|
return clientsMap;
|
||||||
@@ -210,6 +241,18 @@ void ServerLMSWidget::slot_AuthChanged()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ServerLMSWidget::slot_sendPacketToAllClients(PacketType packetType)
|
||||||
|
{
|
||||||
|
foreach(int idSocket, clientsMap.keys())
|
||||||
|
{
|
||||||
|
ClientHandler *handler = clientsMap[idSocket];
|
||||||
|
|
||||||
|
if (!handler->getClient()->getIsLoggedIn()) continue;
|
||||||
|
|
||||||
|
handler->sendPacketType(packetType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ServerLMSWidget::removeClient(int idSocket)
|
void ServerLMSWidget::removeClient(int idSocket)
|
||||||
{
|
{
|
||||||
clientsMap.remove(idSocket);
|
clientsMap.remove(idSocket);
|
||||||
@@ -293,7 +336,7 @@ void ServerLMSWidget::on_btnStartServer_clicked()
|
|||||||
if(startServer())
|
if(startServer())
|
||||||
{
|
{
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
updateController->calculateHash();
|
emit sigCalculateFullHash();
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
|
|
||||||
ui->btnStartServer->setEnabled(false);
|
ui->btnStartServer->setEnabled(false);
|
||||||
|
|||||||
@@ -1,23 +1,26 @@
|
|||||||
#ifndef SERVERLMSWIDGET_H
|
#ifndef SERVERLMSWIDGET_H
|
||||||
#define SERVERLMSWIDGET_H
|
#define SERVERLMSWIDGET_H
|
||||||
|
|
||||||
|
#include "ServerLMS_global.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QTcpServer>
|
#include <QTcpServer>
|
||||||
#include <QTcpSocket>
|
#include <QTcpSocket>
|
||||||
#include <QXmlStreamWriter>
|
#include <QXmlStreamWriter>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
|
#include <QMutex>
|
||||||
|
|
||||||
#include <Systems/dataparser.h>
|
#include <Systems/dataparser.h>
|
||||||
#include <Systems/sendsystem.h>
|
#include <Systems/sendsystem.h>
|
||||||
#include <Systems/processingsystem.h>
|
#include <Systems/processingsystem.h>
|
||||||
#include <Systems/updatecontroller.h>
|
#include <Systems/updatecontroller.h>
|
||||||
|
#include <Systems/assetsmanager.h>
|
||||||
#include <Systems/recognizesystem.h>
|
#include <Systems/recognizesystem.h>
|
||||||
#include <Systems/logger.h>
|
#include <Systems/logger.h>
|
||||||
#include <QMutex>
|
|
||||||
|
|
||||||
#include "ServerLMS_global.h"
|
#include <Data/typesDataServerClient.h>
|
||||||
#include "typesDataServerClient.h"
|
#include <Data/Client.h>
|
||||||
#include "Client.h"
|
|
||||||
#include "multithreadserver.h"
|
#include "multithreadserver.h"
|
||||||
#include "providerdblms.h"
|
#include "providerdblms.h"
|
||||||
|
|
||||||
@@ -33,6 +36,7 @@ class UpdateController;
|
|||||||
class RecognizeSystem;
|
class RecognizeSystem;
|
||||||
class ClientHandler;
|
class ClientHandler;
|
||||||
class MultiThreadServer;
|
class MultiThreadServer;
|
||||||
|
class AssetsManager;
|
||||||
|
|
||||||
class SERVERLMS_EXPORT ServerLMSWidget : public QWidget
|
class SERVERLMS_EXPORT ServerLMSWidget : public QWidget
|
||||||
{
|
{
|
||||||
@@ -43,6 +47,8 @@ public:
|
|||||||
~ServerLMSWidget();
|
~ServerLMSWidget();
|
||||||
|
|
||||||
void autorizationHandler(QString login);
|
void autorizationHandler(QString login);
|
||||||
|
void sendNewVersionListToAllClient();
|
||||||
|
void sendCurrentVersionToAllClient();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Метод получения событий
|
// Метод получения событий
|
||||||
@@ -51,8 +57,11 @@ protected:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void sigRecognize();
|
void sigRecognize();
|
||||||
QTcpSocket* sigGetSocket();
|
|
||||||
void sigLog(QString log);
|
void sigLog(QString log);
|
||||||
|
void sigCalculateFullHash();
|
||||||
|
void sigUpdateController(ServerLMSWidget* server,DataParser *dataParser,AssetsManager *assetManager);
|
||||||
|
|
||||||
|
QTcpSocket* sigGetSocket();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void slot_LanguageChanged(QString language);
|
void slot_LanguageChanged(QString language);
|
||||||
@@ -60,8 +69,7 @@ public slots:
|
|||||||
void slotUpdateListClients();
|
void slotUpdateListClients();
|
||||||
void slot_BlockAutorization(bool block);
|
void slot_BlockAutorization(bool block);
|
||||||
void slot_AuthChanged();
|
void slot_AuthChanged();
|
||||||
|
void slot_sendPacketToAllClients(PacketType packetType);
|
||||||
private slots:
|
|
||||||
//слот обработки сигнала о готовности нового сообщения на отправку клиенту от мессенджера
|
//слот обработки сигнала о готовности нового сообщения на отправку клиенту от мессенджера
|
||||||
void slot_msgToClientFromGUI(QString login, QString text);
|
void slot_msgToClientFromGUI(QString login, QString text);
|
||||||
void slot_msgToGUIfromClient(QString login, QString text);
|
void slot_msgToGUIfromClient(QString login, QString text);
|
||||||
@@ -90,6 +98,8 @@ public:
|
|||||||
|
|
||||||
QMap<int, ClientHandler *> getClientsMap() const;
|
QMap<int, ClientHandler *> getClientsMap() const;
|
||||||
|
|
||||||
|
Logger *getLogger() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_btnStartServer_clicked();
|
void on_btnStartServer_clicked();
|
||||||
void on_btnStopServer_clicked();
|
void on_btnStopServer_clicked();
|
||||||
@@ -115,6 +125,7 @@ private:
|
|||||||
DataParser *dataParser;
|
DataParser *dataParser;
|
||||||
ProcessingSystem *processingSystem;
|
ProcessingSystem *processingSystem;
|
||||||
UpdateController *updateController;
|
UpdateController *updateController;
|
||||||
|
AssetsManager *assetsManager;
|
||||||
Logger *logger;
|
Logger *logger;
|
||||||
|
|
||||||
ProviderDBLMS* providerDBLMS;
|
ProviderDBLMS* providerDBLMS;
|
||||||
|
|||||||
Reference in New Issue
Block a user