mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Merge branch 'DEV' into draft-send-contacts
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
|
||||
ProcessingSystem::ProcessingSystem(ProviderDBLMS* providerDBLMS, UpdateController* updateController, QObject *parent):
|
||||
QObject(parent),
|
||||
providerDBLMS(nullptr),
|
||||
updateController(nullptr)
|
||||
updateController(nullptr),
|
||||
providerDBLMS(nullptr)
|
||||
{
|
||||
this->providerDBLMS = providerDBLMS;
|
||||
this->updateController = updateController;
|
||||
@@ -58,6 +58,7 @@ void ProcessingSystem::processingClientAutorization(ClientHandler *client, Clien
|
||||
{//Авторизуется инструктор
|
||||
|
||||
client->getClient()->setLogin(clientAutorization.Login);
|
||||
client->getClient()->setAccessType("instructor");
|
||||
client->getClient()->setTypeClient(clientAutorization.TypeClient);
|
||||
|
||||
emit sigUpdateListClients();
|
||||
@@ -73,6 +74,7 @@ void ProcessingSystem::processingClientAutorization(ClientHandler *client, Clien
|
||||
{//Авторизуется обучаемый
|
||||
|
||||
client->getClient()->setLogin(clientAutorization.Login);
|
||||
client->getClient()->setAccessType("trainee");
|
||||
emit sigUpdateListClients();
|
||||
|
||||
//KAV redact
|
||||
@@ -120,6 +122,7 @@ void ProcessingSystem::processingClientDeAutorization(ClientHandler *client, Cli
|
||||
{//ДеАвторизуется обучаемый
|
||||
|
||||
client->getClient()->setLogin("");
|
||||
client->getClient()->setAccessType("");
|
||||
emit sigUpdateListClients();
|
||||
|
||||
arrayAnswer = dataParser->ClientAnswer()->deAuthorization(true, clientDeAutorization.Login);
|
||||
@@ -128,6 +131,7 @@ void ProcessingSystem::processingClientDeAutorization(ClientHandler *client, Cli
|
||||
{//ДеАвторизуется инструктор
|
||||
|
||||
client->getClient()->setLogin("");
|
||||
client->getClient()->setAccessType("");
|
||||
emit sigUpdateListClients();
|
||||
|
||||
arrayAnswer = dataParser->ClientAnswer()->deAuthorization(true, clientDeAutorization.Login);
|
||||
@@ -160,6 +164,38 @@ void ProcessingSystem::processingClientDeAutorization(QString login)
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessingSystem::processingEntryUnityClient(ClientHandler *client)
|
||||
{
|
||||
QString login = client->getClient()->getLogin();
|
||||
QString accessType = client->getClient()->getAccessType();
|
||||
|
||||
if(accessType == "trainee")
|
||||
{
|
||||
int id_trainee = providerDBLMS->getIdTraineeByLogin(login);
|
||||
providerDBLMS->entryTraineeOnSimulator(id_trainee);
|
||||
}
|
||||
else if(accessType == "instructor")
|
||||
{
|
||||
//Здесь пока ничего не происходит
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessingSystem::processingExitUnityClient(ClientHandler *client)
|
||||
{
|
||||
QString login = client->getClient()->getLogin();
|
||||
QString accessType = client->getClient()->getAccessType();
|
||||
|
||||
if(accessType == "trainee")
|
||||
{
|
||||
int id_trainee = providerDBLMS->getIdTraineeByLogin(login);
|
||||
providerDBLMS->exitTraineeFromSimulator(id_trainee);
|
||||
}
|
||||
else if(accessType == "instructor")
|
||||
{
|
||||
//Здесь пока ничего не происходит
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessingSystem::processingClientQueryToDB(ClientHandler *client, ClientQueryToDB clientQueryToDB, int id, void* data)
|
||||
{
|
||||
qDebug() << "ProcessingQueryThread " << QThread::currentThreadId();
|
||||
@@ -487,9 +523,24 @@ void ProcessingSystem::processingClientNotify(ClientHandler *client, ClientNotif
|
||||
sendTaskListToUnity(client);
|
||||
client->getSocket()->flush();
|
||||
}
|
||||
else if(clientNotify.Code == commandStartTimerClient)
|
||||
{
|
||||
//Фиксируем время входа Юнити-клиента
|
||||
if (client->getClient()->getIsUnity())
|
||||
{
|
||||
processingEntryUnityClient(client);
|
||||
}
|
||||
}
|
||||
else if(clientNotify.Code == commandDisableClient)
|
||||
{
|
||||
qDebug() << "processing thread: " << QThread::currentThreadId();
|
||||
|
||||
//Фиксируем время выхода Юнити-клиента
|
||||
if (client->getClient()->getIsUnity())
|
||||
{
|
||||
processingExitUnityClient(client);
|
||||
}
|
||||
|
||||
client->sendDisable();
|
||||
}
|
||||
else if(clientNotify.Code == commandGetServerDataList)
|
||||
|
||||
Reference in New Issue
Block a user