associate incoming place name with DomainServerNodeData

This commit is contained in:
Stephen Birarda 2016-05-10 12:13:22 -07:00
parent 51c16739f2
commit 7110fe98eb
6 changed files with 14 additions and 0 deletions

View file

@ -105,6 +105,7 @@ void DomainGatekeeper::processConnectRequestPacket(QSharedPointer<ReceivedMessag
DomainServerNodeData* nodeData = reinterpret_cast<DomainServerNodeData*>(node->getLinkedData());
nodeData->setSendingSockAddr(message->getSenderSockAddr());
nodeData->setNodeInterestSet(nodeConnection.interestList.toSet());
nodeData->setPlaceName(nodeConnection.placeName);
// signal that we just connected a node so the DomainServer can get it a list
// and broadcast its presence right away

View file

@ -56,6 +56,9 @@ public:
void addOverrideForKey(const QString& key, const QString& value, const QString& overrideValue);
void removeOverrideForKey(const QString& key, const QString& value);
const QString& getPlaceName() { return _placeName; }
void setPlaceName(const QString& placeName) { _placeName; }
private:
QJsonObject overrideValuesIfNeeded(const QJsonObject& newStats);
@ -75,6 +78,8 @@ private:
bool _isAuthenticated = true;
NodeSet _nodeInterestSet;
QString _nodeVersion;
QString _placeName;
};
#endif // hifi_DomainServerNodeData_h

View file

@ -19,6 +19,7 @@ NodeConnectionData NodeConnectionData::fromDataStream(QDataStream& dataStream, c
if (isConnectRequest) {
dataStream >> newHeader.connectUUID;
dataStream >> newHeader.placeName;
}
dataStream >> newHeader.nodeType

View file

@ -27,6 +27,7 @@ public:
HifiSockAddr localSockAddr;
HifiSockAddr senderSockAddr;
QList<NodeType_t> interestList;
QString placeName;
};

View file

@ -312,6 +312,9 @@ void NodeList::sendDomainServerCheckIn() {
// pack the connect UUID for this connect request
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

View file

@ -58,6 +58,9 @@ PacketVersion versionForPacketType(PacketType packetType) {
case PacketType::AssetUpload:
// Removal of extension from Asset requests
return 18;
case PacketType::DomainConnectRequest:
// addition of referring hostname information
return 18;
default:
return 17;
}