mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
feat: cfi package update
This commit is contained in:
@@ -22,7 +22,6 @@ enum PacketType
|
||||
TYPE_FILESIZE = 20,
|
||||
TYPE_BIGXML = 21,
|
||||
UPDATE_DOCS_COMPLETE = 22,
|
||||
TYPE_CFIUPDATE = 23,
|
||||
TYPE_UPDATEDCFI = 24,
|
||||
|
||||
TYPE_XMLANSWER_MESSAGE_FOR_GUI = 90,
|
||||
@@ -108,7 +107,7 @@ inline QString enumToString(PacketType value) {
|
||||
case PacketType::RECALCULATE_DOCS: return "RECALCULATE_DOCS";
|
||||
case PacketType::GET_DOCS: return "GET_DOCS";
|
||||
case PacketType::SEND_HASH: return "SEND_HASH";
|
||||
case PacketType::TYPE_CFIUPDATE: return "CFI_UPDATE";
|
||||
case PacketType::TYPE_UPDATEDCFI: return "UPDATED_CFI";
|
||||
|
||||
default: return "Unknown";
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ void CommonClientHandler::slot_DocsChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void CommonClientHandler::sendXmlAnswer(QByteArray array)
|
||||
void CommonClientHandler::sendUpdatedCFI(QByteArray array)
|
||||
{
|
||||
foreach(int idSocket, clientsMap->keys())
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user