Set AddressManager before NodeList

This commit is contained in:
Atlante45 2015-01-14 15:46:33 -08:00
parent 1399de52a5
commit 7b5babb02a
2 changed files with 9 additions and 6 deletions

View file

@ -15,6 +15,7 @@
#include <QtCore/QTimer>
#include <AccountManager.h>
#include <AddressManager.h>
#include <Assignment.h>
#include <HifiConfigVariantMap.h>
#include <LogHandler.h>
@ -48,7 +49,12 @@ AssignmentClient::AssignmentClient(int &argc, char **argv) :
setOrganizationDomain("highfidelity.io");
setApplicationName("assignment-client");
QSettings::setDefaultFormat(QSettings::IniFormat);
// create a NodeList as an unassigned client
DependencyManager::registerInheritance<LimitedNodeList, NodeList>();
auto addressManager = DependencyManager::set<AddressManager>();
auto nodeList = DependencyManager::set<NodeList>(NodeType::Unassigned);
// setup a shutdown event listener to handle SIGTERM or WM_CLOSE for us
#ifdef _WIN32
installNativeEventFilter(&ShutdownEventListener::getInstance());
@ -91,9 +97,6 @@ AssignmentClient::AssignmentClient(int &argc, char **argv) :
qDebug() << "The destination wallet UUID for credits is" << uuidStringWithoutCurlyBraces(walletUUID);
_requestAssignment.setWalletUUID(walletUUID);
}
// create a NodeList as an unassigned client
auto nodeList = DependencyManager::set<NodeList>(NodeType::Unassigned);
quint16 assignmentServerPort = DEFAULT_DOMAIN_SERVER_PORT;

View file

@ -1110,8 +1110,8 @@ void OctreeServer::run() {
beforeRun(); // after payload has been processed
connect(nodeList, SIGNAL(nodeAdded(SharedNodePointer)), SLOT(nodeAdded(SharedNodePointer)));
connect(nodeList, SIGNAL(nodeKilled(SharedNodePointer)),SLOT(nodeKilled(SharedNodePointer)));
connect(nodeList.data(), SIGNAL(nodeAdded(SharedNodePointer)), SLOT(nodeAdded(SharedNodePointer)));
connect(nodeList.data(), SIGNAL(nodeKilled(SharedNodePointer)),SLOT(nodeKilled(SharedNodePointer)));
// we need to ask the DS about agents so we can ping/reply with them