From 27305c7a431c0b1e91443aac793948c2c33a1d8c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 10 Feb 2014 10:23:06 -0800 Subject: [PATCH] change default domain to root, don't double load domains on startup --- interface/src/Application.cpp | 3 +++ libraries/shared/src/NodeList.cpp | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 1e960bb5a8..160d6b7c2c 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1827,6 +1827,9 @@ void Application::init() { _audio.setJitterBufferSamples(Menu::getInstance()->getAudioJitterBufferSamples()); } qDebug("Loaded settings"); + + // fire off an immediate domain-server check in now that settings are loaded + NodeList::getInstance()->sendDomainServerCheckIn(); // Set up VoxelSystem after loading preferences so we can get the desired max voxel count _voxels.setMaxVoxels(Menu::getInstance()->getMaxVoxels()); diff --git a/libraries/shared/src/NodeList.cpp b/libraries/shared/src/NodeList.cpp index 2672f3b27b..92f6f961d5 100644 --- a/libraries/shared/src/NodeList.cpp +++ b/libraries/shared/src/NodeList.cpp @@ -27,7 +27,7 @@ const char SOLO_NODE_TYPES[2] = { NodeType::AudioMixer }; -const QString DEFAULT_DOMAIN_HOSTNAME = "alpha.highfidelity.io"; +const QString DEFAULT_DOMAIN_HOSTNAME = "root.highfidelity.io"; const unsigned short DEFAULT_DOMAIN_SERVER_PORT = 40102; NodeList* NodeList::_sharedInstance = NULL; @@ -59,7 +59,7 @@ NodeList* NodeList::getInstance() { NodeList::NodeList(char newOwnerType, unsigned short int newSocketListenPort) : _nodeHash(), _nodeHashMutex(QMutex::Recursive), - _domainHostname(DEFAULT_DOMAIN_HOSTNAME), + _domainHostname(), _domainSockAddr(HifiSockAddr(QHostAddress::Null, DEFAULT_DOMAIN_SERVER_PORT)), _nodeSocket(this), _ownerType(newOwnerType), @@ -498,7 +498,7 @@ void NodeList::sendDomainServerCheckIn() { static bool printedDomainServerIP = false; // Lookup the IP address of the domain server if we need to - if (_domainSockAddr.getAddress().isNull()) { + if (_domainSockAddr.getAddress().isNull() && !_domainHostname.isEmpty()) { qDebug("Looking up DS hostname %s.", _domainHostname.toLocal8Bit().constData()); QHostInfo domainServerHostInfo = QHostInfo::fromName(_domainHostname); @@ -527,8 +527,8 @@ void NodeList::sendDomainServerCheckIn() { // we don't know our public socket and we need to send it to the domain server // send a STUN request to figure it out sendSTUNRequest(); - } else { - // construct the DS check in packet if we need to + } else if (!_domainSockAddr.getAddress().isNull()) { + // construct the DS check in packet if we can // check in packet has header, optional UUID, node type, port, IP, node types of interest, null termination QByteArray domainServerPacket = byteArrayWithPopluatedHeader(PacketTypeDomainListRequest); @@ -807,7 +807,8 @@ void NodeList::loadData(QSettings *settings) { if (domainServerHostname.size() > 0) { _domainHostname = domainServerHostname; - emit domainChanged(_domainHostname); + } else { + _domainHostname = DEFAULT_DOMAIN_HOSTNAME; } settings->endGroup();