From 0f39356e94931ea84bc763f82b94b71e78ecc5b2 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 1 Feb 2017 16:16:41 -0800 Subject: [PATCH] Only users with perm rez can see the log --- assignment-client/src/scripts/EntityScriptServer.cpp | 2 +- interface/src/ui/EntityScriptServerLogDialog.cpp | 12 +++--------- interface/src/ui/EntityScriptServerLogDialog.h | 2 -- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/assignment-client/src/scripts/EntityScriptServer.cpp b/assignment-client/src/scripts/EntityScriptServer.cpp index 1975b0ce15..f1ba93b68a 100644 --- a/assignment-client/src/scripts/EntityScriptServer.cpp +++ b/assignment-client/src/scripts/EntityScriptServer.cpp @@ -182,7 +182,7 @@ void EntityScriptServer::updateEntityPPS() { void EntityScriptServer::handleEntityServerScriptLogPacket(QSharedPointer message, SharedNodePointer senderNode) { // These are temporary checks until we can ensure that nodes eventually disconnect if the Domain Server stops telling them // about each other. - if (senderNode->getCanRez() || senderNode->getCanRezTmp()) { + if (senderNode->getCanRez()) { bool enable = false; message->readPrimitive(&enable); diff --git a/interface/src/ui/EntityScriptServerLogDialog.cpp b/interface/src/ui/EntityScriptServerLogDialog.cpp index bb79ed7ef3..fd06388bf9 100644 --- a/interface/src/ui/EntityScriptServerLogDialog.cpp +++ b/interface/src/ui/EntityScriptServerLogDialog.cpp @@ -21,19 +21,13 @@ EntityScriptServerLogDialog::EntityScriptServerLogDialog(QWidget* parent) : Base QObject::connect(nodeList.data(), &NodeList::nodeActivated, this, &EntityScriptServerLogDialog::nodeActivated); QObject::connect(nodeList.data(), &NodeList::nodeKilled, this, &EntityScriptServerLogDialog::nodeKilled); - QObject::connect(nodeList.data(), &NodeList::canRezChanged, this, &EntityScriptServerLogDialog::shouldEnableLog); - QObject::connect(nodeList.data(), &NodeList::canRezTmpChanged, this, &EntityScriptServerLogDialog::shouldEnableLog); - shouldEnableLog(); + QObject::connect(nodeList.data(), &NodeList::canRezChanged, this, &EntityScriptServerLogDialog::enableToEntityServerScriptLog); + enableToEntityServerScriptLog(nodeList->getThisNodeCanRez()); } EntityScriptServerLogDialog::~EntityScriptServerLogDialog() { enableToEntityServerScriptLog(false); } -void EntityScriptServerLogDialog::shouldEnableLog() { - auto nodeList = DependencyManager::get(); - enableToEntityServerScriptLog(nodeList->getThisNodeCanRez() || nodeList->getThisNodeCanRezTmp()); -}; - void EntityScriptServerLogDialog::enableToEntityServerScriptLog(bool enable) { auto nodeList = DependencyManager::get(); @@ -63,7 +57,7 @@ void EntityScriptServerLogDialog::handleEntityServerScriptLogPacket(QSharedPoint void EntityScriptServerLogDialog::nodeActivated(SharedNodePointer activatedNode) { if (_subscribed && activatedNode->getType() == NodeType::EntityScriptServer) { _subscribed = false; - shouldEnableLog(); + enableToEntityServerScriptLog(DependencyManager::get()->getThisNodeCanRez()); } } diff --git a/interface/src/ui/EntityScriptServerLogDialog.h b/interface/src/ui/EntityScriptServerLogDialog.h index 8c68db036c..f183e9df33 100644 --- a/interface/src/ui/EntityScriptServerLogDialog.h +++ b/interface/src/ui/EntityScriptServerLogDialog.h @@ -33,8 +33,6 @@ private slots: void nodeActivated(SharedNodePointer activatedNode); void nodeKilled(SharedNodePointer killedNode); - void shouldEnableLog(); - private: bool _subscribed { false }; };