mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
ref: segregate clientAnswer
This commit is contained in:
@@ -51,8 +51,10 @@ add_library(ServerLMS SHARED
|
||||
Systems/commonclienthandler.h
|
||||
Systems/logger.cpp
|
||||
Systems/logger.h
|
||||
Systems/dataparser.cpp
|
||||
Systems/dataparser.h
|
||||
Systems/Parsers/dataparser.cpp
|
||||
Systems/Parsers/dataparser.h
|
||||
Systems/Parsers/clientanswerparser.cpp
|
||||
Systems/Parsers/clientanswerparser.h
|
||||
Systems/processingsystem.cpp
|
||||
Systems/processingsystem.h
|
||||
Systems/sendsystem.cpp
|
||||
|
||||
126
ServerLMS/ServerLMS/Systems/Parsers/clientanswerparser.cpp
Normal file
126
ServerLMS/ServerLMS/Systems/Parsers/clientanswerparser.cpp
Normal file
@@ -0,0 +1,126 @@
|
||||
#include "clientanswerparser.h"
|
||||
|
||||
ClientAnswerParser::ClientAnswerParser(QObject *parent) : QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ClientAnswerParser::initialize(DataParser *dataParser)
|
||||
{
|
||||
this->dataParser = dataParser;
|
||||
}
|
||||
|
||||
QByteArray ClientAnswerParser::authorization(bool result, QString instructorName,QString clientName, QString accessType, QString login)
|
||||
{
|
||||
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Result", result? "true" : "false"};
|
||||
SAttribute attribute2 = {"InstructorName", instructorName};
|
||||
SAttribute attribute3 = {"ClientName", clientName};
|
||||
SAttribute attribute4 = {"AccessType", accessType};
|
||||
SAttribute attribute5 = {"Login", login};
|
||||
QList<SAttribute> listAttr = {attribute1, attribute2, attribute3, attribute4, attribute5};
|
||||
SXmlAnswerTag tag = {"ServerAuthorization", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return dataParser->xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray ClientAnswerParser::deAuthorization(bool result, QString login)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Result", result? "true" : "false"};
|
||||
SAttribute attribute2 = {"Login", login};
|
||||
QList<SAttribute> listAttr = {attribute1, attribute2};
|
||||
SXmlAnswerTag tag = {"ServerDeAuthorization", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return dataParser->xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray ClientAnswerParser::message(QString text, QString login)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
SAttribute attribute2;
|
||||
|
||||
SAttribute attribute1 = {"Text", text};
|
||||
QList<SAttribute> listAttr = {attribute1};
|
||||
if(login != "")
|
||||
{
|
||||
attribute2 = {"Login", login};
|
||||
listAttr.append(attribute2);
|
||||
}
|
||||
SXmlAnswerTag tag = {"ServerMessage", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return dataParser->xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray ClientAnswerParser::task(QString text)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Text", text};
|
||||
QList<SAttribute> listAttr = {attribute1};
|
||||
SXmlAnswerTag tag = {"ServerTask", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return dataParser->xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray ClientAnswerParser::notify(QString code)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Code", code};
|
||||
QList<SAttribute> listAttr = {attribute1};
|
||||
SXmlAnswerTag tag = {"ServerNotify", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return dataParser->xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray ClientAnswerParser::tasks(QStringList listTasks)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
foreach(QString task, listTasks)
|
||||
{
|
||||
QList<SAttribute> listAttr;
|
||||
|
||||
SAttribute attribute1 = {"Head", task};
|
||||
SAttribute attribute2 = {"IsComplete", "false"};
|
||||
listAttr.append(attribute1);
|
||||
listAttr.append(attribute2);
|
||||
|
||||
SXmlAnswerTag tag = {"ServerTask", listAttr};
|
||||
listTag.append(tag);
|
||||
}
|
||||
|
||||
return dataParser->xmlAnswer(listTag, "TaskArray", "Tasks");
|
||||
}
|
||||
|
||||
QByteArray ClientAnswerParser::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;
|
||||
}
|
||||
30
ServerLMS/ServerLMS/Systems/Parsers/clientanswerparser.h
Normal file
30
ServerLMS/ServerLMS/Systems/Parsers/clientanswerparser.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef CLIENTANSWERPARSER_H
|
||||
#define CLIENTANSWERPARSER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <Systems/Parsers/dataparser.h>
|
||||
#include <Data/typesDataServerClient.h>
|
||||
|
||||
|
||||
class ClientAnswerParser : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ClientAnswerParser(QObject *parent = nullptr);
|
||||
void initialize(DataParser *dataParser);
|
||||
|
||||
QByteArray authorization(bool result, QString instructorName, QString clientName, QString accessType, QString login);
|
||||
QByteArray deAuthorization(bool result, QString login);
|
||||
QByteArray message(QString text, QString login = "");
|
||||
QByteArray task(QString text);
|
||||
QByteArray notify(QString code);
|
||||
QByteArray tasks(QStringList listTasks);
|
||||
QByteArray currentVersion();
|
||||
signals:
|
||||
|
||||
private:
|
||||
DataParser *dataParser;
|
||||
};
|
||||
|
||||
#endif // CLIENTANSWERPARSER_H
|
||||
@@ -8,6 +8,8 @@ QObject(parent)
|
||||
{
|
||||
this->processingSystem = processingSystem;
|
||||
this->assetsManager = assetManager;
|
||||
clientAnswer = new ClientAnswerParser;
|
||||
clientAnswer->initialize(this);
|
||||
mutex = new QMutex;
|
||||
|
||||
if (!QDir(staticDataFolderName).exists()){
|
||||
@@ -296,38 +298,6 @@ QByteArray DataParser::xmlAnswer(QList<SXmlAnswerTag> listTag, QString elemUp1,
|
||||
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_authorization(bool result, QString instructorName,QString clientName, QString accessType, QString login)
|
||||
{
|
||||
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Result", result? "true" : "false"};
|
||||
SAttribute attribute2 = {"InstructorName", instructorName};
|
||||
SAttribute attribute3 = {"ClientName", clientName};
|
||||
SAttribute attribute4 = {"AccessType", accessType};
|
||||
SAttribute attribute5 = {"Login", login};
|
||||
QList<SAttribute> listAttr = {attribute1, attribute2, attribute3, attribute4, attribute5};
|
||||
SXmlAnswerTag tag = {"ServerAuthorization", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_deAuthorization(bool result, QString login)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Result", result? "true" : "false"};
|
||||
SAttribute attribute2 = {"Login", login};
|
||||
QList<SAttribute> listAttr = {attribute1, attribute2};
|
||||
SXmlAnswerTag tag = {"ServerDeAuthorization", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
bool DataParser::loadBlankXML(QString nameFile, QDomDocument *commonDOM)
|
||||
{
|
||||
QFile blankFile(nameFile);
|
||||
@@ -456,89 +426,6 @@ QByteArray DataParser::xmlAnswer_ClientQueryToDB_ListTasks(bool result, QList<Ta
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_message(QString text, QString login)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
SAttribute attribute2;
|
||||
|
||||
SAttribute attribute1 = {"Text", text};
|
||||
QList<SAttribute> listAttr = {attribute1};
|
||||
if(login != "")
|
||||
{
|
||||
attribute2 = {"Login", login};
|
||||
listAttr.append(attribute2);
|
||||
}
|
||||
SXmlAnswerTag tag = {"ServerMessage", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_task(QString text)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Text", text};
|
||||
QList<SAttribute> listAttr = {attribute1};
|
||||
SXmlAnswerTag tag = {"ServerTask", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_notify(QString code)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
SAttribute attribute1 = {"Code", code};
|
||||
QList<SAttribute> listAttr = {attribute1};
|
||||
SXmlAnswerTag tag = {"ServerNotify", listAttr};
|
||||
|
||||
listTag.append(tag);
|
||||
|
||||
return xmlAnswer(listTag);
|
||||
}
|
||||
|
||||
QByteArray DataParser::xmlAnswer_tasks(QStringList listTasks)
|
||||
{
|
||||
QList<SXmlAnswerTag> listTag;
|
||||
|
||||
foreach(QString task, listTasks)
|
||||
{
|
||||
QList<SAttribute> listAttr;
|
||||
|
||||
SAttribute attribute1 = {"Head", task};
|
||||
SAttribute attribute2 = {"IsComplete", "false"};
|
||||
listAttr.append(attribute1);
|
||||
listAttr.append(attribute2);
|
||||
|
||||
SXmlAnswerTag tag = {"ServerTask", listAttr};
|
||||
listTag.append(tag);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
QByteArray DataParser::readTempFile()
|
||||
{
|
||||
QByteArray array;
|
||||
@@ -561,3 +448,8 @@ DataParser::~DataParser()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ClientAnswerParser *DataParser::ClientAnswer() const
|
||||
{
|
||||
return clientAnswer;
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
#include "Systems/processingsystem.h"
|
||||
#include "Systems/tools.h"
|
||||
#include "Systems/assetsmanager.h"
|
||||
#include "logger.h"
|
||||
#include "Systems/logger.h"
|
||||
#include "Systems/Parsers/clientanswerparser.h"
|
||||
#include "serverlmswidget.h"
|
||||
|
||||
#include <QByteArray>
|
||||
@@ -18,6 +19,7 @@
|
||||
class ProcessingSystem;
|
||||
class ClientHandler;
|
||||
class AssetsManager;
|
||||
class ClientAnswerParser;
|
||||
|
||||
class DataParser : public QObject
|
||||
{
|
||||
@@ -29,8 +31,6 @@ public:
|
||||
void xmlFileDataParse(QByteArray array);
|
||||
|
||||
QByteArray xmlAnswer(QList<SXmlAnswerTag> listTag,QString elemUp1 = "", QString elemUp2 = "");
|
||||
QByteArray xmlAnswer_authorization(bool result, QString instructorName, QString clientName, QString accessType, QString login);
|
||||
QByteArray xmlAnswer_deAuthorization(bool result, QString login);
|
||||
|
||||
bool loadBlankXML(QString nameFile, QDomDocument* commonDOM);
|
||||
bool saveDOMtoXML(QString nameFile, QDomDocument* commonDOM);
|
||||
@@ -41,14 +41,11 @@ public:
|
||||
QByteArray xmlAnswer_ClientQueryToDB_ListClassrooms(bool result, QList<Classroom> *listClassrooms);
|
||||
QByteArray xmlAnswer_ClientQueryToDB_ListTasks(bool result, QList<Task> *listTasks);
|
||||
|
||||
QByteArray xmlAnswer_message(QString text, QString login = "");
|
||||
QByteArray xmlAnswer_task(QString text);
|
||||
QByteArray xmlAnswer_notify(QString code);
|
||||
QByteArray xmlAnswer_tasks(QStringList listTasks);
|
||||
|
||||
QByteArray xmlAnswer_currentVersion();
|
||||
~DataParser();
|
||||
|
||||
ClientAnswerParser *ClientAnswer() const;
|
||||
|
||||
signals:
|
||||
void sigLogMessage(QString log);
|
||||
|
||||
@@ -58,6 +55,7 @@ private:
|
||||
|
||||
ProcessingSystem *processingSystem;
|
||||
AssetsManager *assetsManager;
|
||||
ClientAnswerParser *clientAnswer;
|
||||
QByteArray readTempFile();
|
||||
};
|
||||
|
||||
@@ -69,7 +69,7 @@ void CommonClientHandler::slot_msgToClientFromGUI(QString login, QString text)
|
||||
{
|
||||
QString textMsg = text;
|
||||
|
||||
QByteArray byteArrayMsg = dataParser->xmlAnswer_message(textMsg);
|
||||
QByteArray byteArrayMsg = dataParser->ClientAnswer()->message(textMsg);
|
||||
|
||||
//Проходим все открытые сокеты, ищем нужный
|
||||
foreach(int idSocket, clientsMap->keys())
|
||||
@@ -95,7 +95,7 @@ void CommonClientHandler::slot_msgToGUIfromClient(QString login, QString text)
|
||||
{
|
||||
QString textMsg = text;
|
||||
|
||||
QByteArray byteArrayMsg = dataParser->xmlAnswer_message(textMsg, login);
|
||||
QByteArray byteArrayMsg = dataParser->ClientAnswer()->message(textMsg, login);
|
||||
|
||||
//Проходим все открытые сокеты, ищем нужный
|
||||
foreach(int idSocket, clientsMap->keys())
|
||||
@@ -119,7 +119,7 @@ void CommonClientHandler::slot_msgToGUIfromClient(QString login, QString text)
|
||||
|
||||
void CommonClientHandler::slot_sendTaskToClient(QString fullNameClient,QString textTask)
|
||||
{
|
||||
QByteArray byteArrayTask = dataParser->xmlAnswer_task(textTask);
|
||||
QByteArray byteArrayTask = dataParser->ClientAnswer()->task(textTask);
|
||||
|
||||
//Проходим все открытые сокеты
|
||||
foreach(int idSocket, clientsMap->keys())
|
||||
@@ -138,3 +138,4 @@ void CommonClientHandler::slot_sendTaskToClient(QString fullNameClient,QString t
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ void ProcessingSystem::processingClientAutorization(ClientHandler *client, Clien
|
||||
{
|
||||
if(server->getStateBlockAutorization() == blocked)
|
||||
{
|
||||
QByteArray arrayAnswer = dataParser->xmlAnswer_notify(NOTIFY_SERVER_BLOCKED);
|
||||
QByteArray arrayAnswer = dataParser->ClientAnswer()->notify(NOTIFY_SERVER_BLOCKED);
|
||||
client->sendXmlAnswer(arrayAnswer);
|
||||
|
||||
QString str = QString(arrayAnswer);
|
||||
@@ -49,7 +49,7 @@ void ProcessingSystem::processingClientAutorization(ClientHandler *client, Clien
|
||||
instructorName = providerDBLMS->getMainInstructorName();
|
||||
traineeName = providerDBLMS->getNameTraineeByLogin(clientAutorization.Login);
|
||||
|
||||
arrayAnswer = dataParser->xmlAnswer_authorization(true, instructorName, traineeName, "trainee", clientAutorization.Login);
|
||||
arrayAnswer = dataParser->ClientAnswer()->authorization(true, instructorName, traineeName, "trainee", clientAutorization.Login);
|
||||
}
|
||||
else if(providerDBLMS->authorizationInstructor(clientAutorization.Login, clientAutorization.Password))
|
||||
{//Авторизуется инструктор
|
||||
@@ -60,11 +60,11 @@ void ProcessingSystem::processingClientAutorization(ClientHandler *client, Clien
|
||||
|
||||
instructorName = providerDBLMS->getNameInstructorByLogin(clientAutorization.Login);
|
||||
|
||||
arrayAnswer = dataParser->xmlAnswer_authorization(true, instructorName, instructorName, "instructor", clientAutorization.Login);
|
||||
arrayAnswer = dataParser->ClientAnswer()->authorization(true, instructorName, instructorName, "instructor", clientAutorization.Login);
|
||||
}
|
||||
else
|
||||
{//Никто не авторизовался
|
||||
arrayAnswer = dataParser->xmlAnswer_authorization(false, "", "", "", "");
|
||||
arrayAnswer = dataParser->ClientAnswer()->authorization(false, "", "", "", "");
|
||||
}
|
||||
client->sendXmlAnswer(arrayAnswer);
|
||||
client->sendVersion();
|
||||
@@ -80,7 +80,7 @@ void ProcessingSystem::processingClientDeAutorization(ClientHandler *client, Cli
|
||||
{
|
||||
if(server->getStateBlockAutorization() == blocked)
|
||||
{
|
||||
QByteArray arrayAnswer = dataParser->xmlAnswer_notify(NOTIFY_SERVER_BLOCKED);
|
||||
QByteArray arrayAnswer = dataParser->ClientAnswer()->notify(NOTIFY_SERVER_BLOCKED);
|
||||
client->sendXmlAnswer(arrayAnswer);
|
||||
|
||||
QString str = QString(arrayAnswer);
|
||||
@@ -98,7 +98,7 @@ void ProcessingSystem::processingClientDeAutorization(ClientHandler *client, Cli
|
||||
client->getClient()->setLogin("");
|
||||
emit sigUpdateListClients();
|
||||
|
||||
arrayAnswer = dataParser->xmlAnswer_deAuthorization(true, clientDeAutorization.Login);
|
||||
arrayAnswer = dataParser->ClientAnswer()->deAuthorization(true, clientDeAutorization.Login);
|
||||
}
|
||||
else if(providerDBLMS->deAuthorizationInstructor(clientDeAutorization.Login))
|
||||
{//ДеАвторизуется инструктор
|
||||
@@ -106,11 +106,11 @@ void ProcessingSystem::processingClientDeAutorization(ClientHandler *client, Cli
|
||||
client->getClient()->setLogin("");
|
||||
emit sigUpdateListClients();
|
||||
|
||||
arrayAnswer = dataParser->xmlAnswer_deAuthorization(true, clientDeAutorization.Login);
|
||||
arrayAnswer = dataParser->ClientAnswer()->deAuthorization(true, clientDeAutorization.Login);
|
||||
}
|
||||
else
|
||||
{//Никто не ДеАвторизовался
|
||||
arrayAnswer = dataParser->xmlAnswer_deAuthorization(false, "");
|
||||
arrayAnswer = dataParser->ClientAnswer()->deAuthorization(false, "");
|
||||
}
|
||||
client->sendXmlAnswer(arrayAnswer);
|
||||
|
||||
@@ -259,7 +259,7 @@ void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotif
|
||||
//TODO KAV redact
|
||||
//listTasks = pInstructorsAndTrainees->getDbLMS()->getWhatItDoes(client->getClient()->getLogin());
|
||||
|
||||
QByteArray arrayAnswer = dataParser->xmlAnswer_tasks(listTasks);
|
||||
QByteArray arrayAnswer = dataParser->ClientAnswer()->tasks(listTasks);
|
||||
client->sendXmlAnswer(arrayAnswer);
|
||||
|
||||
QString str = QString(arrayAnswer);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <Systems/updatecontroller.h>
|
||||
#include <Systems/tools.h>
|
||||
#include <Systems/dataparser.h>
|
||||
#include <Systems/Parsers/dataparser.h>
|
||||
|
||||
#include <Data/Client.h>
|
||||
#include <Data/PacketType.h>
|
||||
|
||||
@@ -12,9 +12,9 @@ void SendSystem::initialize(DataParser *dataParser,Logger *logger)
|
||||
this->logger = logger;
|
||||
|
||||
connect(this,&SendSystem::sigSendToLogger,logger,&Logger::addTextToLogger,Qt::AutoConnection);
|
||||
connect(this,&SendSystem::sigSendXMLmessage,dataParser,&DataParser::xmlAnswer_message,Qt::AutoConnection);
|
||||
connect(this,&SendSystem::sigSendNotify,dataParser,&DataParser::xmlAnswer_notify,Qt::DirectConnection); //потому что возвращает значение
|
||||
connect(this,&SendSystem::sigSendVersion,dataParser,&DataParser::xmlAnswer_currentVersion,Qt::AutoConnection);
|
||||
connect(this,&SendSystem::sigSendXMLmessage,dataParser->ClientAnswer(),&ClientAnswerParser::message,Qt::AutoConnection);
|
||||
connect(this,&SendSystem::sigSendNotify,dataParser->ClientAnswer(),&ClientAnswerParser::notify,Qt::DirectConnection); //потому что возвращает значение
|
||||
connect(this,&SendSystem::sigSendVersion,dataParser->ClientAnswer(),&ClientAnswerParser::currentVersion,Qt::AutoConnection);
|
||||
|
||||
qDebug() << "SendSystem thread: " << QThread::currentThreadId();
|
||||
}
|
||||
@@ -83,7 +83,7 @@ void SendSystem::sendFileBlock(QString path)
|
||||
|
||||
void SendSystem::sendVersion()
|
||||
{
|
||||
QByteArray data = dataParser->xmlAnswer_currentVersion();
|
||||
QByteArray data = dataParser->ClientAnswer()->currentVersion();
|
||||
sendXmlAnswer(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,13 +5,14 @@
|
||||
#include <QString>
|
||||
#include <QtNetwork>
|
||||
|
||||
#include <Systems/dataparser.h>
|
||||
#include <Systems/Parsers/dataparser.h>
|
||||
#include <Systems/tools.h>
|
||||
#include <Data/Client.h>
|
||||
#include <Data/PacketType.h>
|
||||
|
||||
class DataParser;
|
||||
class FileData;
|
||||
|
||||
class SendSystem : public QObject
|
||||
{
|
||||
|
||||
|
||||
@@ -85,3 +85,5 @@ QString Tools::createFolderPath(QString path)
|
||||
|
||||
return folderPath;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <QDataStream>
|
||||
#include <QMutex>
|
||||
|
||||
#include <Systems/dataparser.h>
|
||||
#include <Systems/Parsers/dataparser.h>
|
||||
#include <Data/typesDataServerClient.h>
|
||||
#include <Data/StreamingVersionData.h>
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ class Logger;
|
||||
class ServerLMSWidget;
|
||||
class UpdateController;
|
||||
class RecognizeSystem;
|
||||
class ClientAnswerParser;
|
||||
|
||||
class ClientHandler : public QObject
|
||||
{
|
||||
|
||||
@@ -137,7 +137,7 @@ bool ServerLMSWidget::stopServer()
|
||||
{
|
||||
if(stateServer == started)
|
||||
{
|
||||
QByteArray arrayAnswer = dataParser->xmlAnswer_notify(NOTIFY_SERVER_END);
|
||||
QByteArray arrayAnswer = dataParser->ClientAnswer()->notify(NOTIFY_SERVER_END);
|
||||
|
||||
//Закрываем все открытые сокеты
|
||||
foreach(int idSocket, clientsMap.keys())
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <QTranslator>
|
||||
#include <QMutex>
|
||||
|
||||
#include <Systems/dataparser.h>
|
||||
#include <Systems/Parsers/dataparser.h>
|
||||
#include <Systems/sendsystem.h>
|
||||
#include <Systems/processingsystem.h>
|
||||
#include <Systems/updatecontroller.h>
|
||||
|
||||
Reference in New Issue
Block a user