From b960d86f8095e87eefc042e940067de5a368256d Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 8 Jul 2015 11:54:06 -0700 Subject: [PATCH] Remove datagramProcessor from Application --- interface/src/Application.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index dfa082719a..3b633580ee 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -308,7 +308,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : _window(new MainWindow(desktop())), _toolWindow(NULL), _friendsWindow(NULL), - _datagramProcessor(), _undoStack(), _undoStackScriptingInterface(&_undoStack), _frameCount(0), @@ -387,8 +386,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : // make sure the node thread is given highest priority nodeThread->setPriority(QThread::TimeCriticalPriority); - _datagramProcessor = new DatagramProcessor(nodeList.data()); - // have the NodeList use deleteLater from DM customDeleter nodeList->setCustomDeleter([](Dependency* dependency) { static_cast(dependency)->deleteLater(); @@ -404,9 +401,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : ResourceCache* geometryCache = geometryCacheP.data(); connect(this, &Application::checkBackgroundDownloads, geometryCache, &ResourceCache::checkAsynchronousGets); - // connect the DataProcessor processDatagrams slot to the QUDPSocket readyRead() signal - connect(&nodeList->getNodeSocket(), &QUdpSocket::readyRead, _datagramProcessor, &DatagramProcessor::processDatagrams); - // put the audio processing on a separate thread QThread* audioThread = new QThread(); audioThread->setObjectName("Audio Thread"); @@ -641,6 +635,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : auto applicationUpdater = DependencyManager::get(); connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog); applicationUpdater->checkForUpdate(); + + auto& packetReceiver = nodeList->getPacketReceiver(); + packetReceiver.registerPacketListener(PacketType::DomainConnectionDenied, this, "handleDomainConnectionDeniedPacket"); } void Application::aboutToQuit() { @@ -654,7 +651,7 @@ void Application::cleanupBeforeQuit() { _entities.clear(); // this will allow entity scripts to properly shutdown - _datagramProcessor->shutdown(); // tell the datagram processor we're shutting down, so it can short circuit + //_datagramProcessor->shutdown(); // tell the datagram processor we're shutting down, so it can short circuit _entities.shutdown(); // tell the entities system we're shutting down, so it will stop running scripts ScriptEngine::stopAllScripts(this); // stop all currently running global scripts @@ -1783,7 +1780,7 @@ void Application::checkFPS() { _fps = (float)_frameCount / diffTime; _frameCount = 0; - _datagramProcessor->resetCounters(); + //_datagramProcessor->resetCounters(); _timerStart.start(); // ask the node list to check in with the domain server