mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Сделал выдачу tasksAMM.xml из сервера по запросу GUI-клиента
This commit is contained in:
@@ -234,14 +234,21 @@ void ProcessingSystem::processingClientQueryTasksXML(ClientHandler *client, Clie
|
||||
QByteArray arrayAnswer;
|
||||
|
||||
QString nameFile = "";
|
||||
QString pathFile = "";
|
||||
if(clientQueryTasksXML.Type == "fim")
|
||||
{
|
||||
nameFile = tasksFIMfileName;
|
||||
pathFile = updateController->getPathAdditionalFile(nameFile);
|
||||
client->sendFileBlock(pathFile);
|
||||
client->sendPacketType(PacketType::TYPE_XMLANSWER_QUERY_TASKS_XML_FIM);
|
||||
}
|
||||
else if(clientQueryTasksXML.Type == "amm")
|
||||
{
|
||||
nameFile = tasksAMMfileName;
|
||||
|
||||
arrayAnswer = updateController->getAdditionalFile(nameFile);
|
||||
|
||||
client->sendXmlAnswer(arrayAnswer, PacketType::TYPE_XMLANSWER_QUERY_TASKS_XML_FIM);
|
||||
pathFile = updateController->getPathAdditionalFile(nameFile);
|
||||
client->sendFileBlock(pathFile);
|
||||
client->sendPacketType(PacketType::TYPE_XMLANSWER_QUERY_TASKS_XML_AMM);
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessingSystem::processingToClientMessage(ClientHandler *client, ToClientMessage toClientMessage)
|
||||
|
||||
@@ -355,17 +355,10 @@ QList<FileData>* UpdateController::calculateHash(QString path)
|
||||
return files;
|
||||
}
|
||||
|
||||
QByteArray UpdateController::getAdditionalFile(QString name)
|
||||
QString UpdateController::getPathAdditionalFile(QString name)
|
||||
{
|
||||
QString path = Tools::createSharedPath("/" + assetManager->getCurrentVersionData()->getViewName() + "/AdditionalFiles" + name);
|
||||
QFile addFile(path);
|
||||
QByteArray array;
|
||||
if(addFile.open(QIODevice::ReadOnly)){
|
||||
array = addFile.readAll();
|
||||
addFile.close();
|
||||
}
|
||||
|
||||
return array;
|
||||
return path;
|
||||
}
|
||||
|
||||
QByteArray UpdateController::getLocalHash()
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
void saveVersionToFile(StreamingVersionData *streamingVersion);
|
||||
void xmlFileDataParse(QByteArray array);
|
||||
|
||||
QByteArray getAdditionalFile(QString name);
|
||||
QString getPathAdditionalFile(QString name);
|
||||
|
||||
public slots:
|
||||
void changeAssetVersion(QString versionName);
|
||||
|
||||
@@ -102,6 +102,11 @@ void ClientHandler::sendXmlAnswer(QByteArray array, PacketType packetType)
|
||||
emit sigSendXmlAnswer(array, packetType);
|
||||
}
|
||||
|
||||
void ClientHandler::sendFileBlock(QString path)
|
||||
{
|
||||
emit sigFileBlock(path);
|
||||
}
|
||||
|
||||
bool ClientHandler::getIsSendStopped()
|
||||
{
|
||||
return emit sigGetIsSendStopped();
|
||||
|
||||
Reference in New Issue
Block a user