mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
ref: init package
This commit is contained in:
@@ -51,10 +51,15 @@ void RecognizeSystem::recognize()
|
||||
|
||||
if(!isPackageTypeInited) //первичная инициализация для типа клиента
|
||||
{
|
||||
char *read = new char[0];
|
||||
stream.readRawData(read,1);
|
||||
packetType = static_cast<PacketType>(QString(read[0]).toInt());
|
||||
// char *read = new char[0];
|
||||
// stream.readRawData(read,1);
|
||||
// packetType = static_cast<PacketType>(QString(read[0]).toInt());
|
||||
|
||||
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;
|
||||
@@ -63,9 +68,13 @@ void RecognizeSystem::recognize()
|
||||
|
||||
if(client->getIsUnity())
|
||||
{
|
||||
char *read = new char[0];
|
||||
stream.readRawData(read,1);
|
||||
packetType = static_cast<PacketType>(QString(read[0]).toInt());
|
||||
char *read = new char[4];
|
||||
stream.readRawData(read,4);
|
||||
int numPackage = *((int*)read);
|
||||
packetType = static_cast<PacketType>(numPackage);
|
||||
|
||||
socket->peek(read,4);
|
||||
//data = socket->readAll();
|
||||
|
||||
if(!stream.commitTransaction()) continue;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user