diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 37643cc372..028bfdb9aa 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1160,7 +1160,7 @@ void DomainServer::sendDomainListToNode(const SharedNodePointer& node, const Hif // this data is at the beginning of each of the domain list packets QByteArray extendedHeader(NUM_DOMAIN_LIST_EXTENDED_HEADER_BYTES, 0); QDataStream extendedHeaderStream(&extendedHeader, QIODevice::WriteOnly); - + DomainServerNodeData* nodeData = static_cast(node->getLinkedData()); auto limitedNodeList = DependencyManager::get(); extendedHeaderStream << limitedNodeList->getSessionUUID(); @@ -1169,17 +1169,13 @@ void DomainServer::sendDomainListToNode(const SharedNodePointer& node, const Hif extendedHeaderStream << node->getLocalID(); extendedHeaderStream << node->getPermissions(); extendedHeaderStream << limitedNodeList->getAuthenticatePackets(); + extendedHeaderStream << nodeData->getLastDomainCheckinTimestamp(); + extendedHeaderStream << usecTimestampNow(); auto domainListPackets = NLPacketList::create(PacketType::DomainList, extendedHeader); // always send the node their own UUID back QDataStream domainListStream(domainListPackets.get()); - DomainServerNodeData* nodeData = static_cast(node->getLinkedData()); - - domainListStream << nodeData->getLastDomainCheckinTimestamp(); - - domainListStream << usecTimestampNow(); - // store the nodeInterestSet on this DomainServerNodeData, in case it has changed auto& nodeInterestSet = nodeData->getNodeInterestSet(); diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index e269499938..01c28dd5bb 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -646,14 +646,14 @@ void NodeList::processDomainServerList(QSharedPointer message) packetStream >> isAuthenticated; quint64 connectRequestTimestamp; - quint64 now = usecTimestampNow(); + qint64 now = (qint64)usecTimestampNow(); packetStream >> connectRequestTimestamp; - quint64 pingLagTime = (now - connectRequestTimestamp) / USECS_PER_MSEC; + qint64 pingLagTime = (now - (qint64)connectRequestTimestamp) / (qint64)USECS_PER_MSEC; quint64 domainServerPingReceiveTime; packetStream >> domainServerPingReceiveTime; - quint64 domainServerRequestLag = (domainServerPingReceiveTime - connectRequestTimestamp) / USECS_PER_MSEC; - quint64 domainServerResponseLag = (now - domainServerPingReceiveTime) / USECS_PER_MSEC; + qint64 domainServerRequestLag = ((qint64)domainServerPingReceiveTime - (qint64)connectRequestTimestamp) / (qint64)USECS_PER_MSEC; + qint64 domainServerResponseLag = (now - (qint64)domainServerPingReceiveTime) / (qint64)USECS_PER_MSEC; if (_domainHandler.getSockAddr().isNull()) { qWarning(networking) << "IGNORING DomainList packet while not connected to a Domain Server: sent " << pingLagTime << " msec ago.";