mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
fix: GUI double send getOfflineMessage
This commit is contained in:
@@ -31,16 +31,16 @@ void SendSystem::sendDisable()
|
|||||||
socket->waitForBytesWritten();
|
socket->waitForBytesWritten();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSystem::sendXMLmsgGUItoServer(QByteArray array)
|
//void SendSystem::sendXMLmsgGUItoServer(QByteArray array)
|
||||||
{
|
//{
|
||||||
qDebug() << "SendSystem" << QThread::currentThreadId();
|
// qDebug() << "SendSystem" << QThread::currentThreadId();
|
||||||
QDataStream stream(socket);
|
// QDataStream stream(socket);
|
||||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
// stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||||
|
|
||||||
stream << PacketType::TYPE_XMLANSWER;
|
// stream << PacketType::TYPE_XMLANSWER;
|
||||||
stream << array;
|
// stream << array;
|
||||||
socket->waitForBytesWritten(6000);
|
// socket->waitForBytesWritten(6000);
|
||||||
}
|
//}
|
||||||
|
|
||||||
void SendSystem::sendFileBlock(QString path)
|
void SendSystem::sendFileBlock(QString path)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class SendSystem :public QObject
|
|||||||
public:
|
public:
|
||||||
explicit SendSystem(QObject* parent = nullptr);
|
explicit SendSystem(QObject* parent = nullptr);
|
||||||
void setSocket(QTcpSocket *socket);
|
void setSocket(QTcpSocket *socket);
|
||||||
void sendXMLmsgGUItoServer(QByteArray array);
|
//void sendXMLmsgGUItoServer(QByteArray array);
|
||||||
void sendDisable();
|
void sendDisable();
|
||||||
void sendFileBlock(QString path);
|
void sendFileBlock(QString path);
|
||||||
void sendFolderBlock(QString path);
|
void sendFolderBlock(QString path);
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ ConnectorToServer::ConnectorToServer(QWidget* parentWidget, QObject *parent) :
|
|||||||
versionSelectWidget(nullptr),
|
versionSelectWidget(nullptr),
|
||||||
versionContainer(nullptr),
|
versionContainer(nullptr),
|
||||||
notifyController(nullptr),
|
notifyController(nullptr),
|
||||||
isLoggedIn(false),
|
|
||||||
fl_GetedOfflineMessages(false)
|
fl_GetedOfflineMessages(false)
|
||||||
{
|
{
|
||||||
initialize();
|
initialize();
|
||||||
@@ -44,7 +43,6 @@ bool ConnectorToServer::authorizationInstructorLocal(QString login, QString pass
|
|||||||
autorization->Login = login;
|
autorization->Login = login;
|
||||||
autorization->Password = password;
|
autorization->Password = password;
|
||||||
autorization->TypeClient = TypeClientAutorization::TYPE_GUI;
|
autorization->TypeClient = TypeClientAutorization::TYPE_GUI;
|
||||||
isLoggedIn = true;
|
|
||||||
|
|
||||||
QByteArray array = dataParser->createAuthMessage(autorization);
|
QByteArray array = dataParser->createAuthMessage(autorization);
|
||||||
emit signal_sendXMLmsgGUItoServer(array);
|
emit signal_sendXMLmsgGUItoServer(array);
|
||||||
@@ -61,7 +59,6 @@ bool ConnectorToServer::deAuthorizationInstructorLocal(QString login)
|
|||||||
|
|
||||||
ClientDeAutorization *deAutorization = new ClientDeAutorization;
|
ClientDeAutorization *deAutorization = new ClientDeAutorization;
|
||||||
deAutorization->Login = login;
|
deAutorization->Login = login;
|
||||||
isLoggedIn = false;
|
|
||||||
|
|
||||||
QByteArray array = dataParser->createDeAuthMessage(deAutorization);
|
QByteArray array = dataParser->createDeAuthMessage(deAutorization);
|
||||||
emit signal_sendXMLmsgGUItoServer(array);
|
emit signal_sendXMLmsgGUItoServer(array);
|
||||||
@@ -367,11 +364,6 @@ void ConnectorToServer::slot_AnswerQueryToDB_ListTrainees(QList<Trainee> listTra
|
|||||||
listUsers.append(trainee);
|
listUsers.append(trainee);
|
||||||
}
|
}
|
||||||
emit signal_reInitMessangerByUsers(listUsers);
|
emit signal_reInitMessangerByUsers(listUsers);
|
||||||
|
|
||||||
if (isLoggedIn)
|
|
||||||
{
|
|
||||||
sendClientNotify(cmd_GetOfflineMessages);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectorToServer::slot_AnswerQueryToDB_ListComputers(QList<Computer> listComputers)
|
void ConnectorToServer::slot_AnswerQueryToDB_ListComputers(QList<Computer> listComputers)
|
||||||
@@ -466,7 +458,7 @@ void ConnectorToServer::bindConnection()
|
|||||||
connect(this,&ConnectorToServer::sigSetConnect,client,&TCPClient::setConnect,Qt::AutoConnection);
|
connect(this,&ConnectorToServer::sigSetConnect,client,&TCPClient::setConnect,Qt::AutoConnection);
|
||||||
connect(this,&ConnectorToServer::sigStopConnect,client,&TCPClient::setDisconnect,Qt::AutoConnection);
|
connect(this,&ConnectorToServer::sigStopConnect,client,&TCPClient::setDisconnect,Qt::AutoConnection);
|
||||||
|
|
||||||
connect(this,&ConnectorToServer::signal_sendXMLmsgGUItoServer,sendSystem,&SendSystem::sendXMLmsgGUItoServer);
|
connect(this,&ConnectorToServer::signal_sendXMLmsgGUItoServer,sendSystem,&SendSystem::sendXMLAnswer);
|
||||||
connect(this,&ConnectorToServer::sigSendAnswerToServer,sendSystem,&SendSystem::sendXMLAnswer,Qt::AutoConnection);
|
connect(this,&ConnectorToServer::sigSendAnswerToServer,sendSystem,&SendSystem::sendXMLAnswer,Qt::AutoConnection);
|
||||||
|
|
||||||
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::slot_Auth); // ::sigLoginResult);
|
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::slot_Auth); // ::sigLoginResult);
|
||||||
|
|||||||
@@ -152,8 +152,6 @@ private:
|
|||||||
QByteArray listTaskAmmArray;
|
QByteArray listTaskAmmArray;
|
||||||
|
|
||||||
ServerSettings serverSettings;
|
ServerSettings serverSettings;
|
||||||
bool isLoggedIn;
|
|
||||||
|
|
||||||
ServerAuthorization serverAuth;
|
ServerAuthorization serverAuth;
|
||||||
|
|
||||||
bool fl_GetedOfflineMessages;
|
bool fl_GetedOfflineMessages;
|
||||||
|
|||||||
@@ -573,7 +573,7 @@ void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotif
|
|||||||
chatSystem->sendOldMessages(client->getClient()->getId());
|
chatSystem->sendOldMessages(client->getClient()->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::instance().log(client->getClient()->getLogin() + clientNotify.Code,LogLevel::DEBUG);
|
Logger::instance().log(client->getClient()->getLogin() + " notifyCode " + clientNotify.Code,LogLevel::DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessingSystem::setCurrentDataInfo(DataInfo *dataInfo)
|
void ProcessingSystem::setCurrentDataInfo(DataInfo *dataInfo)
|
||||||
|
|||||||
@@ -56,10 +56,7 @@ private:
|
|||||||
qint64 sizeReceiveData;
|
qint64 sizeReceiveData;
|
||||||
qint64 fileSize;
|
qint64 fileSize;
|
||||||
int countSend;
|
int countSend;
|
||||||
bool isPackageTypeInited;
|
|
||||||
|
|
||||||
void packetTypeInit(PacketType packet,Client *client);
|
void packetTypeInit(PacketType packet,Client *client);
|
||||||
//void packetTypeInit(PacketType type);
|
|
||||||
|
|
||||||
bool checkIsChangeable();
|
bool checkIsChangeable();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -78,34 +78,6 @@ void SendSystem::sendFileBlock(QString path)
|
|||||||
|
|
||||||
void SendSystem::sendFileBlockByteArray(QByteArray array, PacketType packetType)
|
void SendSystem::sendFileBlockByteArray(QByteArray array, PacketType packetType)
|
||||||
{
|
{
|
||||||
// qDebug() << "sendFileBlockByteArray thread: " << QThread::currentThreadId();
|
|
||||||
// if(client->getClientType() == TypeClientAutorization::TYPE_QT_CLIENT ||
|
|
||||||
// client->getClientType() == TypeClientAutorization::TYPE_GUI)
|
|
||||||
// {
|
|
||||||
// QDataStream stream(socket);
|
|
||||||
// stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
|
||||||
|
|
||||||
// fileSize = array.size();
|
|
||||||
|
|
||||||
// if(fileSize == 0){
|
|
||||||
// Logger::instance().log(" WARNING! Zero size ",LogLevel::ERROR);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// stream << packetType; //Отправляем тип блока
|
|
||||||
// stream << fileSize;
|
|
||||||
// stream << array;
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// sendPacketType(packetType);
|
|
||||||
// QByteArray message;
|
|
||||||
// int size = array.length();
|
|
||||||
// message.append(reinterpret_cast<char*>(&size), sizeof(int));
|
|
||||||
// socket->write(message);
|
|
||||||
// socket->write(array);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if(client->getClientType() == TypeClientAutorization::TYPE_QT_CLIENT ||
|
if(client->getClientType() == TypeClientAutorization::TYPE_QT_CLIENT ||
|
||||||
client->getClientType() == TypeClientAutorization::TYPE_GUI)
|
client->getClientType() == TypeClientAutorization::TYPE_GUI)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user