From 5dd6daaad78a76565fa839e62ea699312cb8452d Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 26 Apr 2017 11:42:38 -0700 Subject: [PATCH] send identity on nodeActivated not nodeAdded --- interface/src/Application.cpp | 17 +++++++++-------- interface/src/main.cpp | 31 +++++++++++++++++++------------ 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 2d39a0e993..4801f39272 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5205,14 +5205,7 @@ void Application::resettingDomain() { } void Application::nodeAdded(SharedNodePointer node) const { - if (node->getType() == NodeType::AvatarMixer) { - // new avatar mixer, send off our identity packet right away - - qDebug() << __FUNCTION__ << "about to call... getMyAvatar()->sendIdentityPacket();"; - getMyAvatar()->markIdentityDataChanged(); - getMyAvatar()->sendIdentityPacket(); - getMyAvatar()->resetLastSent(); - } + // nothing to do here } void Application::nodeActivated(SharedNodePointer node) { @@ -5248,6 +5241,14 @@ void Application::nodeActivated(SharedNodePointer node) { if (node->getType() == NodeType::AudioMixer) { DependencyManager::get()->negotiateAudioFormat(); } + + if (node->getType() == NodeType::AvatarMixer) { + // new avatar mixer, send off our identity packet right away + qDebug() << __FUNCTION__ << "about to call... getMyAvatar()->sendIdentityPacket();"; + getMyAvatar()->markIdentityDataChanged(); + getMyAvatar()->sendIdentityPacket(); + getMyAvatar()->resetLastSent(); + } } void Application::nodeKilled(SharedNodePointer node) { diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 39b37e3d19..99dbb1a28e 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -79,6 +79,25 @@ int main(int argc, const char* argv[]) { instanceMightBeRunning = false; } + QCommandLineParser parser; + QCommandLineOption checkMinSpecOption("checkMinSpec", "Check if machine meets minimum specifications"); + QCommandLineOption runServerOption("runServer", "Whether to run the server"); + QCommandLineOption serverContentPathOption("serverContentPath", "Where to find server content", "serverContentPath"); + QCommandLineOption allowMultipleInstancesOption("allowMultipleInstances", "Allow multiple instances to run"); + parser.addOption(checkMinSpecOption); + parser.addOption(runServerOption); + parser.addOption(serverContentPathOption); + parser.addOption(allowMultipleInstancesOption); + parser.parse(arguments); + bool runServer = parser.isSet(runServerOption); + bool serverContentPathOptionIsSet = parser.isSet(serverContentPathOption); + QString serverContentPathOptionValue = serverContentPathOptionIsSet ? parser.value(serverContentPathOption) : QString(); + bool allowMultipleInstances = parser.isSet(allowMultipleInstancesOption); + + if (allowMultipleInstances) { + instanceMightBeRunning = false; + } + if (instanceMightBeRunning) { // Try to connect and send message to existing interface instance QLocalSocket socket; @@ -137,18 +156,6 @@ int main(int argc, const char* argv[]) { } } - QCommandLineParser parser; - QCommandLineOption checkMinSpecOption("checkMinSpec", "Check if machine meets minimum specifications"); - QCommandLineOption runServerOption("runServer", "Whether to run the server"); - QCommandLineOption serverContentPathOption("serverContentPath", "Where to find server content", "serverContentPath"); - parser.addOption(checkMinSpecOption); - parser.addOption(runServerOption); - parser.addOption(serverContentPathOption); - parser.parse(arguments); - bool runServer = parser.isSet(runServerOption); - bool serverContentPathOptionIsSet = parser.isSet(serverContentPathOption); - QString serverContentPathOptionValue = serverContentPathOptionIsSet ? parser.value(serverContentPathOption) : QString(); - QElapsedTimer startupTime; startupTime.start();