From b00c5b82646e719673186e9c14b851f1036306fd Mon Sep 17 00:00:00 2001 From: semenov Date: Fri, 19 Sep 2025 11:39:54 +0300 Subject: [PATCH] fix: fast connection --- ServerLMS/Systems/processingsystem.cpp | 10 ++++++---- ServerLMS/Systems/recognizesystem.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ServerLMS/Systems/processingsystem.cpp b/ServerLMS/Systems/processingsystem.cpp index a1b66dd..e80e9c2 100644 --- a/ServerLMS/Systems/processingsystem.cpp +++ b/ServerLMS/Systems/processingsystem.cpp @@ -519,6 +519,8 @@ void ProcessingSystem::processingSendMessage(ClientMessage clientMessage) void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotify clientNotify) { + Client *clientData = client->getClient(); + if(clientNotify.Code == commandReadyClient) {//Клиент готов принять задания client->setReady(true); @@ -528,7 +530,7 @@ void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotif else if(clientNotify.Code == commandStartTimerClient) { //Фиксируем время входа Юнити-клиента - if (client->getClient()->getClientType() == TypeClientAutorization::TYPE_UNITY_CLIENT) + if (clientData->getClientType() == TypeClientAutorization::TYPE_UNITY_CLIENT) { processingEntryUnityClient(client); } @@ -538,7 +540,7 @@ void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotif qDebug() << "processing thread: " << QThread::currentThreadId(); //Фиксируем время выхода Юнити-клиента - if (client->getClient()->getClientType() == TypeClientAutorization::TYPE_UNITY_CLIENT) + if (clientData->getClientType() == TypeClientAutorization::TYPE_UNITY_CLIENT) { processingExitUnityClient(client); } @@ -570,10 +572,10 @@ void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotif } else if (clientNotify.Code == commandeGetOfflineMessages) { - chatSystem->sendOldMessages(client->getClient()->getId()); + chatSystem->sendOldMessages(clientData->getId()); } - Logger::instance().log(client->getClient()->getLogin() + " notifyCode " + clientNotify.Code,LogLevel::DEBUG); + Logger::instance().log(clientData->getLogin() + " notifyCode " + clientNotify.Code,LogLevel::DEBUG); } void ProcessingSystem::setCurrentDataInfo(DataInfo *dataInfo) diff --git a/ServerLMS/Systems/recognizesystem.cpp b/ServerLMS/Systems/recognizesystem.cpp index a7e8826..9f90754 100644 --- a/ServerLMS/Systems/recognizesystem.cpp +++ b/ServerLMS/Systems/recognizesystem.cpp @@ -27,7 +27,7 @@ void RecognizeSystem::initialize(UpdateController *updateController,DataParser* connect(this,&RecognizeSystem::sigChangeVersion,updateController,&UpdateController::changeAssetVersion,Qt::AutoConnection); connect(this,&RecognizeSystem::sigDeleteVersion,updateController,&UpdateController::deleteAssetVersion,Qt::AutoConnection); connect(this,&RecognizeSystem::sigCopyVersion,updateController,&UpdateController::createCopyVersion,Qt::AutoConnection); - connect(this,&RecognizeSystem::sigXmlParser,dataParser->getProcessParser(),&ProcessParser::slot_read,Qt::DirectConnection); + connect(this,&RecognizeSystem::sigXmlParser,dataParser->getProcessParser(),&ProcessParser::slot_read,Qt::AutoConnection); qDebug() << "Recognize init thread ID " << QThread::currentThreadId(); } @@ -182,15 +182,15 @@ void RecognizeSystem::recognize() Logger::instance().log("File loaded"); + emit sigXmlParser(clientHandler,data); + //ОЧИСТКА ПОСЛЕ ПЕРЕДАЧИ fileSize = 0; tmpBlock.clear(); sizeReceiveData = 0; countSend = 0; - - emit sigXmlParser(clientHandler,data); - packetType = PacketType::TYPE_NONE; + data.clear(); continue; }