add OS type to connect message

This commit is contained in:
Roxanne Skelly 2019-06-19 13:53:38 -07:00
parent b95515933f
commit 2ed5e8aefb
6 changed files with 23 additions and 4 deletions

View file

@ -127,7 +127,8 @@ void DomainGatekeeper::processConnectRequestPacket(QSharedPointer<ReceivedMessag
<< "and machine fingerprint" << nodeConnection.machineFingerprint
<< "user" << username
<< "reason" << QString(nodeConnection.connectReason ? "SilentDomainDisconnect" : "Connect")
<< "previous connection uptime" << nodeConnection.previousConnectionUpTime/USECS_PER_MSEC << "msec";
<< "previous connection uptime" << nodeConnection.previousConnectionUpTime/USECS_PER_MSEC << "msec"
<< "\nsysinfo" << nodeConnection.SystemInfo;
// signal that we just connected a node so the DomainServer can get it a list
// and broadcast its presence right away

View file

@ -36,6 +36,9 @@ NodeConnectionData NodeConnectionData::fromDataStream(QDataStream& dataStream, c
// now the machine fingerprint
dataStream >> newHeader.machineFingerprint;
// and the operating system type
dataStream >> newHeader.SystemInfo;
dataStream >> newHeader.connectReason;
dataStream >> newHeader.previousConnectionUpTime;

View file

@ -31,9 +31,9 @@ public:
QString placeName;
QString hardwareAddress;
QUuid machineFingerprint;
QString SystemInfo;
quint32 connectReason;
quint64 previousConnectionUpTime;
QByteArray protocolVersion;
};

View file

@ -418,6 +418,20 @@ void NodeList::sendDomainServerCheckIn() {
auto accountManager = DependencyManager::get<AccountManager>();
packetStream << FingerprintUtils::getMachineFingerprint();
QString systemInfo;
#if defined Q_OS_WIN
systemInfo = "OS:Windows";
#elif defined Q_OS_OSX
systemInfo = "OS:OSX";
#elif defined Q_OS_LINUX
systemInfo = "OS:Linux";
#elif defined Q_OS_ANDROID
systemInfo = "OS:Android";
#else
systemInfo = "OS:Unknown";
#endif
packetStream << systemInfo;
packetStream << _connectReason;
if (_nodeDisconnectTimestamp < _nodeConnectTimestamp) {

View file

@ -72,7 +72,7 @@ PacketVersion versionForPacketType(PacketType packetType) {
return static_cast<PacketVersion>(DomainConnectionDeniedVersion::IncludesExtraInfo);
case PacketType::DomainConnectRequest:
return static_cast<PacketVersion>(DomainConnectRequestVersion::HasReason);
return static_cast<PacketVersion>(DomainConnectRequestVersion::HasSystemInfo);
case PacketType::DomainServerAddedNode:
return static_cast<PacketVersion>(DomainServerAddedNodeVersion::PermissionsGrid);

View file

@ -346,7 +346,8 @@ enum class DomainConnectRequestVersion : PacketVersion {
HasMachineFingerprint,
AlwaysHasMachineFingerprint,
HasTimestamp,
HasReason
HasReason,
HasSystemInfo
};
enum class DomainConnectionDeniedVersion : PacketVersion {