mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Отработка BUSSY
This commit is contained in:
@@ -85,6 +85,11 @@ void ConnectorToServer::slot_Auth(ServerAuthorization *serverAuth)
|
|||||||
emit sigLoginResult(serverAuth);
|
emit sigLoginResult(serverAuth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConnectorToServer::slot_ServerBlocked()
|
||||||
|
{
|
||||||
|
emit sigServerBlocked();
|
||||||
|
}
|
||||||
|
|
||||||
void ConnectorToServer::slot_SendDeleteVersion(StreamingVersionData *streaming)
|
void ConnectorToServer::slot_SendDeleteVersion(StreamingVersionData *streaming)
|
||||||
{
|
{
|
||||||
emit signal_SendDeleteVersion(streaming);
|
emit signal_SendDeleteVersion(streaming);
|
||||||
@@ -126,6 +131,9 @@ void ConnectorToServer::bindConnection()
|
|||||||
|
|
||||||
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::slot_Auth);
|
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::slot_Auth);
|
||||||
connect(recognizeSystem,&RecognizeSystem::sigDeAuth,this,&ConnectorToServer::sigDeLoginResult);
|
connect(recognizeSystem,&RecognizeSystem::sigDeAuth,this,&ConnectorToServer::sigDeLoginResult);
|
||||||
|
|
||||||
|
connect(recognizeSystem,&RecognizeSystem::sigServerBlocked,this,&ConnectorToServer::slot_ServerBlocked);
|
||||||
|
|
||||||
connect(recognizeSystem,&RecognizeSystem::signal_ReceiveMessage,this,&ConnectorToServer::signal_receiveMessage,Qt::AutoConnection);
|
connect(recognizeSystem,&RecognizeSystem::signal_ReceiveMessage,this,&ConnectorToServer::signal_receiveMessage,Qt::AutoConnection);
|
||||||
connect(recognizeSystem,&RecognizeSystem::sigShowServerDataList,this,&ConnectorToServer::slot_showServerList);
|
connect(recognizeSystem,&RecognizeSystem::sigShowServerDataList,this,&ConnectorToServer::slot_showServerList);
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ public slots:
|
|||||||
void slot_showServerList(QList<StreamingVersionData*> *serverList);
|
void slot_showServerList(QList<StreamingVersionData*> *serverList);
|
||||||
void slot_HashReady();
|
void slot_HashReady();
|
||||||
void slot_Auth(ServerAuthorization * serverAuth);
|
void slot_Auth(ServerAuthorization * serverAuth);
|
||||||
|
void slot_ServerBlocked();
|
||||||
|
|
||||||
void slot_SendDeleteVersion(StreamingVersionData *streaming);
|
void slot_SendDeleteVersion(StreamingVersionData *streaming);
|
||||||
void slot_SendSwitchVersion(StreamingVersionData *selectVersion);
|
void slot_SendSwitchVersion(StreamingVersionData *selectVersion);
|
||||||
@@ -123,6 +124,7 @@ signals:
|
|||||||
|
|
||||||
void sigLoginResult(ServerAuthorization * serverAuth);
|
void sigLoginResult(ServerAuthorization * serverAuth);
|
||||||
void sigDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
void sigDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||||
|
void sigServerBlocked();
|
||||||
|
|
||||||
void signal_UpdateDB(bool treeInstructor, bool treeTrainee);
|
void signal_UpdateDB(bool treeInstructor, bool treeTrainee);
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
|||||||
flSettingsServerIsChanged(false),
|
flSettingsServerIsChanged(false),
|
||||||
flTryConnectToServer(false),
|
flTryConnectToServer(false),
|
||||||
cntTryConnectToServer(0),
|
cntTryConnectToServer(0),
|
||||||
|
flTryLogin(false),
|
||||||
ui(new Ui::InstructorsAndTraineesWidget)
|
ui(new Ui::InstructorsAndTraineesWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@@ -51,6 +52,7 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
|||||||
connectorToServer = new ConnectorToServer(this);
|
connectorToServer = new ConnectorToServer(this);
|
||||||
connect(connectorToServer, &ConnectorToServer::sigLoginResult, this, &InstructorsAndTraineesWidget::slot_checkLoginResult);
|
connect(connectorToServer, &ConnectorToServer::sigLoginResult, this, &InstructorsAndTraineesWidget::slot_checkLoginResult);
|
||||||
connect(connectorToServer, &ConnectorToServer::sigDeLoginResult, this, &InstructorsAndTraineesWidget::slot_checkDeLoginResult);
|
connect(connectorToServer, &ConnectorToServer::sigDeLoginResult, this, &InstructorsAndTraineesWidget::slot_checkDeLoginResult);
|
||||||
|
connect(connectorToServer, &ConnectorToServer::sigServerBlocked, this, &InstructorsAndTraineesWidget::slot_ServerBlocked);
|
||||||
connect(connectorToServer,&ConnectorToServer::signal_AnswerDocsChanged,this, &InstructorsAndTraineesWidget::slot_AnswerDocsChanged);
|
connect(connectorToServer,&ConnectorToServer::signal_AnswerDocsChanged,this, &InstructorsAndTraineesWidget::slot_AnswerDocsChanged);
|
||||||
|
|
||||||
messangerController = new MessangerController(connectorToServer, this);
|
messangerController = new MessangerController(connectorToServer, this);
|
||||||
@@ -219,12 +221,18 @@ void InstructorsAndTraineesWidget::slot_checkLoginResult(ServerAuthorization *se
|
|||||||
|
|
||||||
viewerTrainees->activate();
|
viewerTrainees->activate();
|
||||||
viewerInstructors->activate();
|
viewerInstructors->activate();
|
||||||
|
|
||||||
|
waitAnimationWidget->hideWithStop();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
waitAnimationWidget->hideWithStop();
|
||||||
|
|
||||||
ui->btnAuthorizationInstructor->setChecked(false);
|
ui->btnAuthorizationInstructor->setChecked(false);
|
||||||
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Instructor authorization.") + "\n" + tr("Invalid login or password!")).exec();
|
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Instructor authorization.") + "\n" + tr("Invalid login or password!")).exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flTryLogin = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstructorsAndTraineesWidget::slot_checkDeLoginResult(ServerDeAuthorization *serverDeAuth)
|
void InstructorsAndTraineesWidget::slot_checkDeLoginResult(ServerDeAuthorization *serverDeAuth)
|
||||||
@@ -253,6 +261,18 @@ void InstructorsAndTraineesWidget::slot_checkDeLoginResult(ServerDeAuthorization
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InstructorsAndTraineesWidget::slot_ServerBlocked()
|
||||||
|
{
|
||||||
|
if(flTryLogin)
|
||||||
|
{
|
||||||
|
flTryLogin = false;
|
||||||
|
waitAnimationWidget->hideWithStop();
|
||||||
|
|
||||||
|
ui->btnAuthorizationInstructor->setChecked(false);
|
||||||
|
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningClose, tr("Attention!") + "\n" + tr("Server blocked!")).exec();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
|
void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
|
||||||
{
|
{
|
||||||
if(state)
|
if(state)
|
||||||
@@ -332,7 +352,9 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
|
|||||||
|
|
||||||
|
|
||||||
updateLabelServer();
|
updateLabelServer();
|
||||||
}
|
|
||||||
|
flTryLogin = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstructorsAndTraineesWidget::slot_traineeSelected(int id_trainee)
|
void InstructorsAndTraineesWidget::slot_traineeSelected(int id_trainee)
|
||||||
@@ -402,6 +424,10 @@ bool InstructorsAndTraineesWidget::authorizationInstructorDialog(QWidget* parent
|
|||||||
// Вычисление MD5 хэша
|
// Вычисление MD5 хэша
|
||||||
password = HashTools::hashingMD5string(password);
|
password = HashTools::hashingMD5string(password);
|
||||||
|
|
||||||
|
waitAnimationWidget->showWithPlay();
|
||||||
|
|
||||||
|
flTryLogin = true;
|
||||||
|
|
||||||
connectorToServer->sendAuthorizationInstructorLocal(login, password);
|
connectorToServer->sendAuthorizationInstructorLocal(login, password);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ public Q_SLOTS:
|
|||||||
void slot_checkLoginResult(ServerAuthorization * serverAuth);
|
void slot_checkLoginResult(ServerAuthorization * serverAuth);
|
||||||
//Слот обработки результата деавторизации
|
//Слот обработки результата деавторизации
|
||||||
void slot_checkDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
void slot_checkDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||||
|
|
||||||
|
void slot_ServerBlocked();
|
||||||
|
|
||||||
//Слот обработки результата подключения к серверу
|
//Слот обработки результата подключения к серверу
|
||||||
void slot_ConnectedToServer(bool state);
|
void slot_ConnectedToServer(bool state);
|
||||||
|
|
||||||
@@ -114,6 +117,8 @@ private:
|
|||||||
bool flTryConnectToServer;
|
bool flTryConnectToServer;
|
||||||
int cntTryConnectToServer;
|
int cntTryConnectToServer;
|
||||||
|
|
||||||
|
bool flTryLogin;
|
||||||
|
|
||||||
Ui::InstructorsAndTraineesWidget *ui;
|
Ui::InstructorsAndTraineesWidget *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ void ProcessingSystem::processingClientAutorization(ClientHandler *client, Clien
|
|||||||
client->sendXmlAnswer(arrayAnswer);
|
client->sendXmlAnswer(arrayAnswer);
|
||||||
client->sendVersion();
|
client->sendVersion();
|
||||||
|
|
||||||
|
//client->sendPacketType(PacketType::BUSY);
|
||||||
|
//client->sendPacketType(PacketType::FREE);
|
||||||
|
|
||||||
QString str = QString(arrayAnswer);
|
QString str = QString(arrayAnswer);
|
||||||
//logger->addTextToLogger("To Client: " + str);
|
//logger->addTextToLogger("To Client: " + str);
|
||||||
//Извещаем об изменениях в авторизации
|
//Извещаем об изменениях в авторизации
|
||||||
|
|||||||
Reference in New Issue
Block a user