mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 07:23:00 +02:00
send hostname to DS with every DS packet to handle changes
This commit is contained in:
parent
962066c7d1
commit
5ab876114f
4 changed files with 10 additions and 9 deletions
|
@ -55,9 +55,9 @@ void DomainGatekeeper::processConnectRequestPacket(QSharedPointer<ReceivedMessag
|
||||||
if (message->getSize() == 0) {
|
if (message->getSize() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream packetStream(message->getMessage());
|
QDataStream packetStream(message->getMessage());
|
||||||
|
|
||||||
// read a NodeConnectionData object from the packet so we can pass around this data while we're inspecting it
|
// read a NodeConnectionData object from the packet so we can pass around this data while we're inspecting it
|
||||||
NodeConnectionData nodeConnection = NodeConnectionData::fromDataStream(packetStream, message->getSenderSockAddr());
|
NodeConnectionData nodeConnection = NodeConnectionData::fromDataStream(packetStream, message->getSenderSockAddr());
|
||||||
|
|
||||||
|
|
|
@ -678,6 +678,9 @@ void DomainServer::processListRequestPacket(QSharedPointer<ReceivedMessage> mess
|
||||||
DomainServerNodeData* nodeData = reinterpret_cast<DomainServerNodeData*>(sendingNode->getLinkedData());
|
DomainServerNodeData* nodeData = reinterpret_cast<DomainServerNodeData*>(sendingNode->getLinkedData());
|
||||||
nodeData->setNodeInterestSet(nodeRequestData.interestList.toSet());
|
nodeData->setNodeInterestSet(nodeRequestData.interestList.toSet());
|
||||||
|
|
||||||
|
// update the connecting hostname in case it has changed
|
||||||
|
nodeData->setPlaceName(nodeRequestData.placeName);
|
||||||
|
|
||||||
sendDomainListToNode(sendingNode, message->getSenderSockAddr());
|
sendDomainListToNode(sendingNode, message->getSenderSockAddr());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,12 +19,11 @@ NodeConnectionData NodeConnectionData::fromDataStream(QDataStream& dataStream, c
|
||||||
|
|
||||||
if (isConnectRequest) {
|
if (isConnectRequest) {
|
||||||
dataStream >> newHeader.connectUUID;
|
dataStream >> newHeader.connectUUID;
|
||||||
dataStream >> newHeader.placeName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dataStream >> newHeader.nodeType
|
dataStream >> newHeader.nodeType
|
||||||
>> newHeader.publicSockAddr >> newHeader.localSockAddr
|
>> newHeader.publicSockAddr >> newHeader.localSockAddr
|
||||||
>> newHeader.interestList;
|
>> newHeader.interestList >> newHeader.placeName;
|
||||||
|
|
||||||
newHeader.senderSockAddr = senderSockAddr;
|
newHeader.senderSockAddr = senderSockAddr;
|
||||||
|
|
||||||
|
|
|
@ -312,13 +312,12 @@ void NodeList::sendDomainServerCheckIn() {
|
||||||
|
|
||||||
// pack the connect UUID for this connect request
|
// pack the connect UUID for this connect request
|
||||||
packetStream << connectUUID;
|
packetStream << connectUUID;
|
||||||
|
|
||||||
// pack the hostname information (so the domain-server can see which place name we came in on)
|
|
||||||
packetStream << DependencyManager::get<AddressManager>()->getPlaceName();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// pack our data to send to the domain-server
|
// pack our data to send to the domain-server including
|
||||||
packetStream << _ownerType << _publicSockAddr << _localSockAddr << _nodeTypesOfInterest.toList();
|
// the hostname information (so the domain-server can see which place name we came in on)
|
||||||
|
packetStream << _ownerType << _publicSockAddr << _localSockAddr << _nodeTypesOfInterest.toList()
|
||||||
|
<< DependencyManager::get<AddressManager>()->getPlaceName();
|
||||||
|
|
||||||
if (!_domainHandler.isConnected()) {
|
if (!_domainHandler.isConnected()) {
|
||||||
DataServerAccountInfo& accountInfo = accountManager->getAccountInfo();
|
DataServerAccountInfo& accountInfo = accountManager->getAccountInfo();
|
||||||
|
|
Loading…
Reference in a new issue