feat: cfi package update

This commit is contained in:
semenov
2026-02-16 09:35:38 +03:00
parent c16e99cc3e
commit a3d6c2899b
9 changed files with 21 additions and 11 deletions

View File

@@ -249,7 +249,7 @@ void CommonClientHandler::slot_DocsChanged()
}
}
void CommonClientHandler::sendXmlAnswer(QByteArray array)
void CommonClientHandler::sendUpdatedCFI(QByteArray array)
{
foreach(int idSocket, clientsMap->keys())
{

View File

@@ -32,7 +32,7 @@ public:
void slot_DocsChanged();
void sendXmlAnswer(QByteArray array);
void sendUpdatedCFI(QByteArray array);
public slots:
void slot_sendPacketToAllClients(PacketType packetType, bool flOnlyGUI);

View File

@@ -266,7 +266,7 @@ void ProcessingSystem::processingCFIUpdate(QByteArray array)
cfiController->unLockAccessToCfiXML();
commonClientServer->sendXmlAnswer(result);
commonClientServer->sendUpdatedCFI(result);
}
void ProcessingSystem::processingEntryUnityClient(ClientHandler *client)
@@ -735,6 +735,13 @@ void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotif
{
chatSystem->sendOldMessages(clientData->getId());
}
else if (clientNotify.Code == commandGetCFI)
{
QByteArray result;
QString path = updateController->getPathAdditionalFile(cfiListFileName);
Tools::loadFileXMLtoByteArray(path,result);
client->sendXmlAnswer(result,PacketType::TYPE_UPDATEDCFI);
}
}
void ProcessingSystem::setCurrentDataInfo(DataInfo *dataInfo)

View File

@@ -29,7 +29,7 @@ void RecognizeSystem::initialize(UpdateController *updateController,DataParser*
connect(this,&RecognizeSystem::sigCopyVersion,updateController,&UpdateController::createCopyVersion,Qt::AutoConnection);
connect(this,&RecognizeSystem::sigXmlParser,dataParser->getProcessParser(),&ProcessParser::slot_read,Qt::AutoConnection);
//connect(this,&RecognizeSystem::sigRecalculateDocs,server,&ServerLMSWidget::slot_UpdateDocs,Qt::AutoConnection);
connect(this,&RecognizeSystem::sigSendDocs,sendSystem,&SendSystem::sendDocs,Qt::AutoConnection);
connect(this,&RecognizeSystem::sigSendDocs,sendSystem,&SendSystem::sendDocs,Qt::AutoConnection);
}
void RecognizeSystem::recognize()
@@ -509,11 +509,6 @@ void RecognizeSystem::recognize()
packetType = PacketType::TYPE_NONE;
client->setClientHash(hash);
}
if(packetType == PacketType::TYPE_CFIUPDATE)
{
qDebug() << "CFI HELLO";
}
packetType = PacketType::TYPE_NONE;
}

View File

@@ -323,6 +323,11 @@ void SendSystem::sendStop()
isSendStopped = true;
}
void SendSystem::sendCFI(QByteArray array)
{
sendXmlAnswer(array,PacketType::TYPE_UPDATEDCFI);
}
void SendSystem::sendDocs(QString docsPath)
{
sendFileBlock(docsPath);

View File

@@ -31,6 +31,7 @@ public:
void sendPacketType(PacketType packet);
void sendNotify(QString notify);
void sendStop();
void sendCFI(QByteArray array);
void sendDocs(QString docPath);
void sendXmlAnswer(QByteArray array, PacketType packetType = PacketType::TYPE_XMLANSWER);
void sendNeedUpdate(bool flag,quint64 size,quint64 fileCount,quint64 deleteCount);

View File

@@ -55,6 +55,7 @@ static const QString commandUnchangable = "UNCHANGEABLE";
static const QString commandUpdateFilesClient = "update";
static const QString commandGetTasks = "GETTASKS";
static const QString commandeGetOfflineMessages = "GETOFFLINEMESSAGE";
static const QString commandGetCFI = "GETCFI";
//static quint64 fileBlockSize = 1460;
static quint64 sendFileBlockSize = 256000;

View File

@@ -280,6 +280,7 @@ bool UpdateController::checkNeedUpdate(ClientHandler *handler)
{
if(item.path.contains("Temp")) continue;
if(item.path.contains("docs.xml")) continue;
if(item.path.contains("CfiList.xml")) continue;
if (!serverDataList.contains(item))
{
@@ -291,6 +292,7 @@ bool UpdateController::checkNeedUpdate(ClientHandler *handler)
{
if(item.path.contains("Temp")) continue;
if(item.path.contains("docs.xml")) continue;
if(item.path.contains("CfiList.xml")) continue;
if (!clientDataList.contains(item))
{