allow domain to pass down its ID from config

This commit is contained in:
Stephen Birarda 2014-09-10 15:13:02 -07:00
parent c9ed83ac14
commit ee6a90dd54
2 changed files with 10 additions and 1 deletions

View file

@ -189,6 +189,12 @@ void DomainServer::setupNodeListAndAssignments(const QUuid& sessionUUID) {
populateDefaultStaticAssignmentsExcludingTypes(parsedTypes);
LimitedNodeList* nodeList = LimitedNodeList::createInstance(domainServerPort, domainServerDTLSPort);
const QString DOMAIN_CONFIG_ID_KEY = "id";
// set our LimitedNodeList UUID to match the UUID from our config
// nodes will currently use this to add resources to data-web that relate to our domain
nodeList->setSessionUUID(_argumentVariantMap.value(DOMAIN_CONFIG_ID_KEY).toString());
connect(nodeList, &LimitedNodeList::nodeAdded, this, &DomainServer::nodeAdded);
connect(nodeList, &LimitedNodeList::nodeKilled, this, &DomainServer::nodeKilled);

View file

@ -397,7 +397,10 @@ int NodeList::processDomainServerList(const QByteArray& packet) {
_numNoReplyDomainCheckIns = 0;
// if this was the first domain-server list from this domain, we've now connected
_domainHandler.setIsConnected(true);
if (!_domainHandler.isConnected()) {
_domainHandler.setUUID(uuidFromPacketHeader(packet));
_domainHandler.setIsConnected(true);
}
int readNodes = 0;