diff --git a/LibServer/Systems/Parsers/processparser.cpp b/LibServer/Systems/Parsers/processparser.cpp index 617d388..d082ccc 100644 --- a/LibServer/Systems/Parsers/processparser.cpp +++ b/LibServer/Systems/Parsers/processparser.cpp @@ -603,8 +603,5 @@ void ProcessParser::clientNotify(QXmlStreamReader &xmlReader,ClientHandler *clie void ProcessParser::compareCFIObjects(QByteArray array,ClientHandler *clientHandler) { - QByteArray temp = array; - processingSystem->processingCFIUpdate(temp,clientHandler); - - + processingSystem->processingCFIUpdate(array); } diff --git a/LibServer/Systems/commonclienthandler.cpp b/LibServer/Systems/commonclienthandler.cpp index 79435c7..fb4b93c 100644 --- a/LibServer/Systems/commonclienthandler.cpp +++ b/LibServer/Systems/commonclienthandler.cpp @@ -176,3 +176,17 @@ void CommonClientHandler::slot_DocsChanged() } } +void CommonClientHandler::sendXmlAnswer(QByteArray array) +{ + foreach(int idSocket, clientsMap->keys()) + { + ClientHandler *handler = clientsMap->value(idSocket); + TypeClientAutorization type = handler->getClient()->getTypeClient(); + + if(type == TypeClientAutorization::TYPE_UNITY_CLIENT) + { + handler->sendXmlAnswer(array,PacketType::TYPE_UPDATEDCFI); + } + } +} + diff --git a/LibServer/Systems/commonclienthandler.h b/LibServer/Systems/commonclienthandler.h index f2dddb7..e32be8b 100644 --- a/LibServer/Systems/commonclienthandler.h +++ b/LibServer/Systems/commonclienthandler.h @@ -28,6 +28,8 @@ public: void slot_DocsChanged(); + void sendXmlAnswer(QByteArray array); + public slots: void slot_sendPacketToAllClients(PacketType packetType, bool flOnlyGUI); diff --git a/LibServer/Systems/processingsystem.cpp b/LibServer/Systems/processingsystem.cpp index d266fc8..43a499b 100644 --- a/LibServer/Systems/processingsystem.cpp +++ b/LibServer/Systems/processingsystem.cpp @@ -228,9 +228,16 @@ void ProcessingSystem::processingClientDeAutorization(QString login) } } -void ProcessingSystem::processingCFIUpdate(QByteArray array, ClientHandler *handler) +void ProcessingSystem::processingCFIUpdate(QByteArray array) { - handler->sendXmlAnswer(array); + cfiController->updateCfiXML(array); + cfiController->lockAccessToCfiXML(); + cfiController->unLockAccessToCfiXML(); + + QByteArray result; + QString path = updateController->getPathAdditionalFile(cfiListFileName); + Tools::loadFileXMLtoByteArray(path,result); + commonClientServer->sendXmlAnswer(result); } void ProcessingSystem::processingEntryUnityClient(ClientHandler *client) diff --git a/LibServer/Systems/processingsystem.h b/LibServer/Systems/processingsystem.h index a640089..65e1ace 100644 --- a/LibServer/Systems/processingsystem.h +++ b/LibServer/Systems/processingsystem.h @@ -59,7 +59,7 @@ public: ClientHandler* getUnityClientById(int id); void processingClientDeAutorization(QString login); - void processingCFIUpdate(QByteArray array,ClientHandler *handler); + void processingCFIUpdate(QByteArray array); void processingEntryUnityClient(ClientHandler *client); void processingExitUnityClient(ClientHandler *client);