mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Разблокировка при вылете АРМ Инструктора
This commit is contained in:
@@ -44,7 +44,7 @@ bool MultiThreadServer::startServer()
|
|||||||
{
|
{
|
||||||
|
|
||||||
stateServer = started;
|
stateServer = started;
|
||||||
slot_BlockAutorization(false, "SERVER", "StartServer");
|
slot_BlockAutorization(false, "SERVER", "StopServer");
|
||||||
Logger::instance().log("SERVER: start OK");
|
Logger::instance().log("SERVER: start OK");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -158,6 +158,10 @@ bool MultiThreadServer::slot_BlockAutorization(bool block, QString whoFullName,
|
|||||||
{
|
{
|
||||||
if(whoFullName == "SERVER")
|
if(whoFullName == "SERVER")
|
||||||
{
|
{
|
||||||
|
if(type == "StopServer")
|
||||||
|
{
|
||||||
|
blockersMap.clear();
|
||||||
|
}
|
||||||
this->blockAutorization();
|
this->blockAutorization();
|
||||||
blockersMap.insert(key, type);
|
blockersMap.insert(key, type);
|
||||||
blockRes = true;
|
blockRes = true;
|
||||||
@@ -196,7 +200,24 @@ bool MultiThreadServer::slot_BlockAutorization(bool block, QString whoFullName,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
blockersMap.take(key);
|
if(type == "DeAuthorizationInstructor")
|
||||||
|
{
|
||||||
|
QStringList listKeyForDel;
|
||||||
|
for(QString keyLocal : blockersMap.keys())
|
||||||
|
{
|
||||||
|
if(keyLocal.contains(whoFullName))
|
||||||
|
listKeyForDel.append(keyLocal);
|
||||||
|
}
|
||||||
|
for(QString keyLocal : listKeyForDel)
|
||||||
|
{
|
||||||
|
blockersMap.take(keyLocal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
blockersMap.take(key);
|
||||||
|
}
|
||||||
|
|
||||||
if(!blockersMap.count())
|
if(!blockersMap.count())
|
||||||
{
|
{
|
||||||
this->unBlockAutorization();
|
this->unBlockAutorization();
|
||||||
@@ -215,7 +236,7 @@ bool MultiThreadServer::slot_BlockAutorization(bool block, QString whoFullName,
|
|||||||
else
|
else
|
||||||
emit signal_sendPacketToAllClients(PacketType::FREE);
|
emit signal_sendPacketToAllClients(PacketType::FREE);
|
||||||
|
|
||||||
foreach(QString keyLocal, blockersMap.keys())
|
for(QString keyLocal : blockersMap.keys())
|
||||||
{
|
{
|
||||||
if(strTypes != "")
|
if(strTypes != "")
|
||||||
strTypes += ", ";
|
strTypes += ", ";
|
||||||
|
|||||||
Reference in New Issue
Block a user