mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
карта блок-в. Блокировка правильная. Множ. доступ
This commit is contained in:
@@ -191,17 +191,17 @@ void ServerLMSWidget::start()
|
||||
startInitialization_step0();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_BlockAutorization(bool block)
|
||||
void ServerLMSWidget::slot_BlockAutorizationIndicate(bool block, QString whoFullName, QString type)
|
||||
{
|
||||
if(block)
|
||||
{
|
||||
server->blockAutorization();
|
||||
Logger::instance().log("Autorization is blocked");
|
||||
//server->blockAutorization();
|
||||
Logger::instance().log(QString("Server BLOCK from: %1 [type: %2]").arg(whoFullName, type));
|
||||
}
|
||||
else
|
||||
{
|
||||
server->unBlockAutorization();
|
||||
Logger::instance().log("Autorization is unblocked");
|
||||
//server->unBlockAutorization();
|
||||
Logger::instance().log(QString("Server UNBLOCK from: %1 [type: %2]").arg(whoFullName, type));
|
||||
}
|
||||
updateStateOnlyServer();
|
||||
}
|
||||
@@ -222,9 +222,9 @@ void ServerLMSWidget::on_btnStartServer_clicked()
|
||||
|
||||
ui->btnStartServer->setEnabled(false);
|
||||
ui->btnStopServer->setEnabled(true);
|
||||
slot_BlockAutorization(false);
|
||||
//slot_BlockAutorizationIndicate(false, "SERVER");
|
||||
|
||||
updateStateOnlyServer();
|
||||
//updateStateOnlyServer();
|
||||
|
||||
emit signal_Tray_ShowMessage(tr("Server is started!"));
|
||||
|
||||
@@ -240,9 +240,9 @@ void ServerLMSWidget::on_btnStopServer_clicked()
|
||||
|
||||
ui->btnStopServer->setEnabled(false);
|
||||
ui->btnStartServer->setEnabled(true);
|
||||
slot_BlockAutorization(true);
|
||||
//slot_BlockAutorizationIndicate(true, "SERVER");
|
||||
|
||||
updateStateOnlyServer();
|
||||
//updateStateOnlyServer();
|
||||
|
||||
emit signal_Tray_ShowMessage(tr("Server is stoped!"));
|
||||
|
||||
@@ -298,20 +298,6 @@ void ServerLMSWidget::on_btnSettings_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_trySetServerState(PacketType packetType)
|
||||
{
|
||||
if (packetType == PacketType::BUSY)
|
||||
{
|
||||
server->blockAutorization();
|
||||
updateStateOnlyServer();
|
||||
}
|
||||
else if (packetType == PacketType::FREE)
|
||||
{
|
||||
server->unBlockAutorization();
|
||||
updateStateOnlyServer();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::setLanguageInterfase()
|
||||
{
|
||||
ServerDBSettings settings;
|
||||
@@ -366,7 +352,7 @@ void ServerLMSWidget::startInitialization_step0()
|
||||
|
||||
providerDBLMS = new ProviderDBLMS(this);
|
||||
connect(providerDBLMS, &ProviderDBLMS::signal_ErrorPostgreSQL, this, &ServerLMSWidget::slot_ErrorPostgreSQL);
|
||||
connect(providerDBLMS, &ProviderDBLMS::signal_BlockAutorization, this, &ServerLMSWidget::slot_BlockAutorization);
|
||||
//connect(providerDBLMS, &ProviderDBLMS::signal_BlockAutorization, this, &ServerLMSWidget::slot_BlockAutorizationIndicate);
|
||||
|
||||
mutex = new QMutex;
|
||||
|
||||
@@ -390,9 +376,13 @@ void ServerLMSWidget::startInitialization_step0()
|
||||
|
||||
commonClientHandler = new CommonClientHandler;
|
||||
connect(this, &ServerLMSWidget::signal_DocsChanged, commonClientHandler, &CommonClientHandler::slot_DocsChanged);
|
||||
connect(commonClientHandler, &CommonClientHandler::sigSetServerState, this, &ServerLMSWidget::slot_trySetServerState);
|
||||
//connect(commonClientHandler, &CommonClientHandler::sigSetServerState, this, &ServerLMSWidget::slot_trySetServerState);
|
||||
|
||||
server = new MultiThreadServer(this, updateController, processingSystem, dataParser, 6000);
|
||||
connect(server, &MultiThreadServer::signal_BlockAutorizationIndicate, this, &ServerLMSWidget::slot_BlockAutorizationIndicate);
|
||||
connect(providerDBLMS, &ProviderDBLMS::signal_BlockAutorization, server, &MultiThreadServer::slot_BlockAutorization, Qt::DirectConnection);
|
||||
connect(updateController, &UpdateController::signal_BlockAutorization, server, &MultiThreadServer::slot_BlockAutorization, Qt::DirectConnection);
|
||||
connect(server, &MultiThreadServer::signal_sendPacketToAllClients, commonClientHandler, &CommonClientHandler::slot_sendPacketToAllClients);
|
||||
|
||||
loggerThread->start();
|
||||
updateThread->start();
|
||||
|
||||
Reference in New Issue
Block a user