mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
feat: add CFI Update
This commit is contained in:
@@ -260,12 +260,12 @@ void RecognizeSystem::recognize(QTcpSocket *socket)
|
|||||||
|
|
||||||
if(packetType == PacketType::BUSY)
|
if(packetType == PacketType::BUSY)
|
||||||
{
|
{
|
||||||
signal_ServerBlockState(true);
|
emit signal_ServerBlockState(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(packetType == PacketType::FREE)
|
if(packetType == PacketType::FREE)
|
||||||
{
|
{
|
||||||
signal_ServerBlockState(false);
|
emit signal_ServerBlockState(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(packetType == PacketType::HASH_READY)
|
if(packetType == PacketType::HASH_READY)
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ enum PacketType
|
|||||||
TYPE_FILESIZE = 20,
|
TYPE_FILESIZE = 20,
|
||||||
TYPE_BIGXML = 21,
|
TYPE_BIGXML = 21,
|
||||||
UPDATE_DOCS_COMPLETE = 22,
|
UPDATE_DOCS_COMPLETE = 22,
|
||||||
|
TYPE_CFIUPDATE = 23,
|
||||||
|
TYPE_UPDATEDCFI = 24,
|
||||||
|
|
||||||
TYPE_XMLANSWER_MESSAGE_FOR_GUI = 90,
|
TYPE_XMLANSWER_MESSAGE_FOR_GUI = 90,
|
||||||
|
|
||||||
@@ -103,6 +105,7 @@ inline QString enumToString(PacketType value) {
|
|||||||
case PacketType::RECALCULATE_DOCS: return "RECALCULATE_DOCS";
|
case PacketType::RECALCULATE_DOCS: return "RECALCULATE_DOCS";
|
||||||
case PacketType::GET_DOCS: return "GET_DOCS";
|
case PacketType::GET_DOCS: return "GET_DOCS";
|
||||||
case PacketType::SEND_HASH: return "SEND_HASH";
|
case PacketType::SEND_HASH: return "SEND_HASH";
|
||||||
|
case PacketType::TYPE_CFIUPDATE: return "CFI_UPDATE";
|
||||||
|
|
||||||
default: return "Unknown";
|
default: return "Unknown";
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,10 @@ void ProcessParser::slot_read(ClientHandler *client, QByteArray array)
|
|||||||
|
|
||||||
clientBlockAuth(xmlReader,client);
|
clientBlockAuth(xmlReader,client);
|
||||||
}
|
}
|
||||||
|
else if(xmlReader.name() == "CFIObjects")
|
||||||
|
{
|
||||||
|
compareCFIObjects(array,client);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
emit sigLogMessage("XmlParser: unrecognized tag");
|
emit sigLogMessage("XmlParser: unrecognized tag");
|
||||||
@@ -597,4 +601,10 @@ void ProcessParser::clientNotify(QXmlStreamReader &xmlReader,ClientHandler *clie
|
|||||||
processingSystem->processingClientNotify(client, clientNotify);
|
processingSystem->processingClientNotify(client, clientNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProcessParser::compareCFIObjects(QByteArray array,ClientHandler *clientHandler)
|
||||||
|
{
|
||||||
|
QByteArray temp = array;
|
||||||
|
processingSystem->processingCFIUpdate(temp,clientHandler);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public:
|
|||||||
explicit ProcessParser(QObject *parent = nullptr);
|
explicit ProcessParser(QObject *parent = nullptr);
|
||||||
void initialize(ProcessingSystem *processingSystem);
|
void initialize(ProcessingSystem *processingSystem);
|
||||||
|
|
||||||
|
void compareCFIObjects(QByteArray array,ClientHandler *clientHandler);
|
||||||
public slots:
|
public slots:
|
||||||
void slot_read(ClientHandler *client, QByteArray array);
|
void slot_read(ClientHandler *client, QByteArray array);
|
||||||
|
|
||||||
|
|||||||
@@ -226,6 +226,11 @@ void ProcessingSystem::processingClientDeAutorization(QString login)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProcessingSystem::processingCFIUpdate(QByteArray array, ClientHandler *handler)
|
||||||
|
{
|
||||||
|
handler->sendXmlAnswer(array);
|
||||||
|
}
|
||||||
|
|
||||||
void ProcessingSystem::processingEntryUnityClient(ClientHandler *client)
|
void ProcessingSystem::processingEntryUnityClient(ClientHandler *client)
|
||||||
{
|
{
|
||||||
QString login = client->getClient()->getLogin();
|
QString login = client->getClient()->getLogin();
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ public:
|
|||||||
ClientHandler* getUnityClientById(int id);
|
ClientHandler* getUnityClientById(int id);
|
||||||
void processingClientDeAutorization(QString login);
|
void processingClientDeAutorization(QString login);
|
||||||
|
|
||||||
|
void processingCFIUpdate(QByteArray array,ClientHandler *handler);
|
||||||
|
|
||||||
void processingEntryUnityClient(ClientHandler *client);
|
void processingEntryUnityClient(ClientHandler *client);
|
||||||
void processingExitUnityClient(ClientHandler *client);
|
void processingExitUnityClient(ClientHandler *client);
|
||||||
signals:
|
signals:
|
||||||
|
|||||||
@@ -510,6 +510,11 @@ void RecognizeSystem::recognize()
|
|||||||
packetType = PacketType::TYPE_NONE;
|
packetType = PacketType::TYPE_NONE;
|
||||||
client->setClientHash(hash);
|
client->setClientHash(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(packetType == PacketType::TYPE_CFIUPDATE)
|
||||||
|
{
|
||||||
|
qDebug() << "CFI HELLO";
|
||||||
|
}
|
||||||
packetType = PacketType::TYPE_NONE;
|
packetType = PacketType::TYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ void SendSystem::sendFileBlockByteArray(QByteArray array, PacketType packetType)
|
|||||||
while (size > 0)
|
while (size > 0)
|
||||||
{
|
{
|
||||||
QByteArray chunk = array.mid(bytesSended,sendFileBlockSize);
|
QByteArray chunk = array.mid(bytesSended,sendFileBlockSize);
|
||||||
quint64 bytesSended = socket->write(chunk);
|
bytesSended = socket->write(chunk);
|
||||||
|
|
||||||
size -= bytesSended;
|
size -= bytesSended;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -384,8 +384,8 @@ void ServerLMSWidget::startInitialization_step0()
|
|||||||
|
|
||||||
server = new MultiThreadServer(this, updateController, processingSystem, dataParser, 6000);
|
server = new MultiThreadServer(this, updateController, processingSystem, dataParser, 6000);
|
||||||
connect(server, &MultiThreadServer::signal_BlockAutorizationIndicate, this, &ServerLMSWidget::slot_BlockAutorizationIndicate);
|
connect(server, &MultiThreadServer::signal_BlockAutorizationIndicate, this, &ServerLMSWidget::slot_BlockAutorizationIndicate);
|
||||||
connect(providerDBLMS, &ProviderDBLMS::signal_BlockAutorization, server, &MultiThreadServer::slot_BlockAutorization, Qt::DirectConnection);
|
connect(providerDBLMS, &ProviderDBLMS::signal_BlockAutorization, server, &MultiThreadServer::slot_BlockAutorization, Qt::AutoConnection);
|
||||||
connect(updateController, &UpdateController::signal_BlockAutorization, server, &MultiThreadServer::slot_BlockAutorization, Qt::DirectConnection);
|
connect(updateController, &UpdateController::signal_BlockAutorization, server, &MultiThreadServer::slot_BlockAutorization, Qt::AutoConnection);
|
||||||
connect(server, &MultiThreadServer::signal_sendPacketToAllClients, commonClientHandler, &CommonClientHandler::slot_sendPacketToAllClients);
|
connect(server, &MultiThreadServer::signal_sendPacketToAllClients, commonClientHandler, &CommonClientHandler::slot_sendPacketToAllClients);
|
||||||
|
|
||||||
loggerThread->start();
|
loggerThread->start();
|
||||||
|
|||||||
Reference in New Issue
Block a user