Fixed the type_ids.md document
The byte format positions and lens for the PEER_INFO and MY_INFO type ids were fixed to properly reflect format(s). Few format changes to the code using the 'auto' keyword. This will be an ongoing thing on every commit until all parts of the code use the 'auto' keyword were appropriate.
This commit is contained in:
parent
6e068a8e83
commit
577784ad6f
|
@ -176,8 +176,8 @@ This carry some user account and session information about a peer client connect
|
||||||
1. bytes[0-27] 28bytes - session id (224bit hash)
|
1. bytes[0-27] 28bytes - session id (224bit hash)
|
||||||
2. bytes[28-59] 32bytes - user id (256bit hash)
|
2. bytes[28-59] 32bytes - user id (256bit hash)
|
||||||
3. bytes[60-107] 48bytes - user name (TEXT - padded with 0x00)
|
3. bytes[60-107] 48bytes - user name (TEXT - padded with 0x00)
|
||||||
4. bytes[108-235] 128bytes - app name (TEXT - padded with 0x00)
|
4. bytes[108-241] 134bytes - app name (TEXT - padded with 0x00)
|
||||||
5. bytes[236-299] 64bytes - disp name (TEXT - padded with 0x00)
|
5. bytes[242-305] 64bytes - disp name (TEXT - padded with 0x00)
|
||||||
|
|
||||||
notes:
|
notes:
|
||||||
1. the session id is unique to the peer's session connection only. it
|
1. the session id is unique to the peer's session connection only. it
|
||||||
|
@ -201,9 +201,9 @@ This contains all of the information found in ```PEER_INFO``` for the local sess
|
||||||
|
|
||||||
```
|
```
|
||||||
format:
|
format:
|
||||||
1. bytes[300-427] 128bytes - email (TEXT - padded with 0x00)
|
1. bytes[306-433] 128bytes - email (TEXT - padded with 0x00)
|
||||||
2. bytes[428-431] 4bytes - host rank (32bit unsigned int)
|
2. bytes[434-437] 4bytes - host rank (32bit unsigned int)
|
||||||
3. bytes[432] 1byte - is email confirmed? (0x00 false, 0x01 true)
|
3. bytes[438] 1byte - is email confirmed? (0x00 false, 0x01 true)
|
||||||
```
|
```
|
||||||
|
|
||||||
```NEW_CMD```
|
```NEW_CMD```
|
||||||
|
|
|
@ -310,7 +310,7 @@ void Session::dataFromClient()
|
||||||
}
|
}
|
||||||
else if (tcpSocket->bytesAvailable() >= FRAME_HEADER_SIZE)
|
else if (tcpSocket->bytesAvailable() >= FRAME_HEADER_SIZE)
|
||||||
{
|
{
|
||||||
QByteArray header = tcpSocket->read(FRAME_HEADER_SIZE);
|
auto header = tcpSocket->read(FRAME_HEADER_SIZE);
|
||||||
|
|
||||||
tcpFrameType = static_cast<quint8>(header[0]);
|
tcpFrameType = static_cast<quint8>(header[0]);
|
||||||
tcpFrameCmdId = static_cast<quint32>(rdInt(header.mid(1, 4)));
|
tcpFrameCmdId = static_cast<quint32>(rdInt(header.mid(1, 4)));
|
||||||
|
@ -328,9 +328,10 @@ void Session::dataFromClient()
|
||||||
{
|
{
|
||||||
wrStringToBlock(fromTEXT(tcpSocket->read(BLKSIZE_APP_NAME)).trimmed(), appName, BLKSIZE_APP_NAME);
|
wrStringToBlock(fromTEXT(tcpSocket->read(BLKSIZE_APP_NAME)).trimmed(), appName, BLKSIZE_APP_NAME);
|
||||||
|
|
||||||
QString coName = fromTEXT(tcpSocket->read(272)).trimmed();
|
auto coName = fromTEXT(tcpSocket->read(272)).trimmed();
|
||||||
QStringList ver = QCoreApplication::applicationVersion().split('.');
|
auto ver = QCoreApplication::applicationVersion().split('.');
|
||||||
QByteArray servHeader;
|
|
||||||
|
QByteArray servHeader;
|
||||||
|
|
||||||
servHeader.append(wrInt(0, 8));
|
servHeader.append(wrInt(0, 8));
|
||||||
servHeader.append(wrInt(ver[0].toULongLong(), 16));
|
servHeader.append(wrInt(ver[0].toULongLong(), 16));
|
||||||
|
@ -495,7 +496,7 @@ void Session::login(const QByteArray &uId)
|
||||||
|
|
||||||
void Session::sendLocalInfo()
|
void Session::sendLocalInfo()
|
||||||
{
|
{
|
||||||
QByteArray frame = createPeerInfoFrame();
|
auto frame = createPeerInfoFrame();
|
||||||
|
|
||||||
Query db;
|
Query db;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user