diff --git a/assignment-client/src/AssignmentClientLogging.cpp b/assignment-client/src/AssignmentClientLogging.cpp index 73687f94d0..9110dccc5f 100644 --- a/assignment-client/src/AssignmentClientLogging.cpp +++ b/assignment-client/src/AssignmentClientLogging.cpp @@ -3,7 +3,7 @@ // assignment-client/src // // Created by Clement on 12/14/15. -// Copyright 2017 High Fidelity, Inc. +// Copyright 2015 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/assignment-client/src/AssignmentClientLogging.h b/assignment-client/src/AssignmentClientLogging.h index 144fbe2125..88e2add017 100644 --- a/assignment-client/src/AssignmentClientLogging.h +++ b/assignment-client/src/AssignmentClientLogging.h @@ -3,7 +3,7 @@ // assignment-client/src // // Created by Clement on 12/14/15. -// Copyright 2017 High Fidelity, Inc. +// Copyright 2015 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/assignment-client/src/scripts/EntityScriptServer.cpp b/assignment-client/src/scripts/EntityScriptServer.cpp index b21b5e9dcd..930b3946c6 100644 --- a/assignment-client/src/scripts/EntityScriptServer.cpp +++ b/assignment-client/src/scripts/EntityScriptServer.cpp @@ -80,9 +80,8 @@ EntityScriptServer::EntityScriptServer(ReceivedMessage& message) : ThreadedAssig packetReceiver.registerListener(PacketType::EntityScriptGetStatus, this, "handleEntityScriptGetStatusPacket"); packetReceiver.registerListener(PacketType::EntityServerScriptLog, this, "handleEntityServerScriptLogPacket"); - static const int LOG_INTERVAL = MSECS_PER_SECOND / 50; + static const int LOG_INTERVAL = MSECS_PER_SECOND / 10; auto timer = new QTimer(this); - timer->setTimerType(Qt::PreciseTimer); timer->setInterval(LOG_INTERVAL); connect(timer, &QTimer::timeout, this, &EntityScriptServer::pushLogs); timer->start(); @@ -215,24 +214,15 @@ void EntityScriptServer::pushLogs() { return; } - auto packet = NLPacket::create(PacketType::EntityServerScriptLog, buffer.size(), true); - packet->write(buffer.data(), buffer.size()); - auto nodeList = DependencyManager::get(); - - auto last = --std::end(_logListeners); - for (auto it = std::begin(_logListeners); it != last; ++it) { - auto node = nodeList->nodeWithUUID(*it); + for (auto uuid : _logListeners) { + auto node = nodeList->nodeWithUUID(uuid); if (node && node->getActiveSocket()) { - auto copy = NLPacket::createCopy(*packet); - nodeList->sendPacket(std::move(copy), *node); + auto packet = NLPacketList::create(PacketType::EntityServerScriptLog, QByteArray(), true, true); + packet->write(buffer.data(), buffer.size()); + nodeList->sendPacketList(std::move(packet), *node); } } - - auto node = nodeList->nodeWithUUID(*last); - if (node && node->getActiveSocket()) { - nodeList->sendPacket(std::move(packet), *node); - } } void EntityScriptServer::run() { diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 33db4fb0d6..1441ae9001 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -134,7 +135,6 @@ #include "devices/Faceshift.h" #include "devices/Leapmotion.h" #include "DiscoverabilityManager.h" -#include "EntityScriptServerLogClient.h" #include "GLCanvas.h" #include "InterfaceActionFactory.h" #include "InterfaceLogging.h" @@ -176,7 +176,6 @@ #include "FrameTimingsScriptingInterface.h" #include #include -#include // On Windows PC, NVidia Optimus laptop, we want to enable NVIDIA GPU // FIXME seems to be broken. diff --git a/interface/src/EntityScriptServerLogClient.cpp b/libraries/entities/src/EntityScriptServerLogClient.cpp similarity index 100% rename from interface/src/EntityScriptServerLogClient.cpp rename to libraries/entities/src/EntityScriptServerLogClient.cpp diff --git a/interface/src/EntityScriptServerLogClient.h b/libraries/entities/src/EntityScriptServerLogClient.h similarity index 100% rename from interface/src/EntityScriptServerLogClient.h rename to libraries/entities/src/EntityScriptServerLogClient.h