fix: first initialize

This commit is contained in:
semenov
2025-09-18 12:55:26 +03:00
parent a2375700b1
commit ced8a5cc64
3 changed files with 45 additions and 34 deletions

View File

@@ -48,19 +48,6 @@ void RecognizeSystem::recognize()
{
stream.startTransaction();
if(!isPackageTypeInited) //первичная инициализация для типа клиента
{
char *read = new char[4];
stream.readRawData(read,4);
int numPackage = *((int*)read);
packetType = static_cast<PacketType>(numPackage);
packetTypeInit(packetType,client);
if(!stream.commitTransaction()) continue;
continue;
}
if(client->getClientType() == TypeClientAutorization::TYPE_UNITY_CLIENT)
{
char *read = new char[4];
@@ -466,25 +453,6 @@ void RecognizeSystem::recognize()
//mutex->unlock();
}
void RecognizeSystem::packetTypeInit(PacketType packet,Client *client)
{
if(packet == PacketType::TYPE_QT)
{
client->setUnity(TypeClientAutorization::TYPE_QT_CLIENT);
qDebug() << "ConnectionType isUnity: " << client->getClientType();
}
else if (packet == PacketType::TYPE_UNITY)
{
client->setUnity(TypeClientAutorization::TYPE_UNITY_CLIENT);
//Фиксируем время входа Юнити-клиента
}
isPackageTypeInited = true;
Logger::instance().log("C: " + client->getLogin() + " send pack " + enumToString(packetType));
packetType = PacketType::TYPE_NONE;
}
bool RecognizeSystem::checkIsChangeable()
{
return updateController->getCurrentVersion()->getIsChangeable();