Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 7 files). Show all
Unified · Split
| @@ -11,9 +11,13 @@ · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | #include "EntityScriptServer.h" |
| 13 | 13 | |
| 14 | +#include <mutex> | |
| 15 | + | |
| 14 | 16 | #include <AudioConstants.h> |
| 15 | 17 | #include <AudioInjectorManager.h> |
| 18 | +#include <ClientServerUtils.h> | |
| 16 | 19 | #include <EntityScriptingInterface.h> |
| 20 | +#include <LogHandler.h> | |
| 17 | 21 | #include <MessagesClient.h> |
| 18 | 22 | #include <plugins/CodecPlugin.h> |
| 19 | 23 | #include <plugins/PluginManager.h> |
| @@ -24,13 +28,9 @@ · 4 unmodified lines | ||
| 24 | 28 | #include <UUID.h> |
| 25 | 29 | #include <WebSocketServerClass.h> |
| 26 | 30 | |
| 27 | −#include "ClientServerUtils.h" | |
| 31 | +#include "EntityScriptServerLogging.h" | |
| 28 | 32 | #include "../entities/AssignmentParentFinder.h" |
| 29 | 33 | |
| 30 | − | |
| 31 | −#include <LogHandler.h> | |
| 32 | −#include <mutex> | |
| 33 | − | |
| 34 | 34 | using Mutex = std::mutex; |
| 35 | 35 | using Lock = std::lock_guard<Mutex>; |
| 36 | 36 | |
| @@ -101,7 +101,7 @@ void EntityScriptServer::handleReloadEntityServerScriptPacket(QSharedPointer<Rec · 64 unmodified lines | ||
| 101 | 101 | auto entityID = QUuid::fromRfc4122(message->read(NUM_BYTES_RFC4122_UUID)); |
| 102 | 102 | |
| 103 | 103 | if (_entityViewer.getTree() && !_shuttingDown) { |
| 104 | − qDebug() << "Reloading: " << entityID; | |
| 104 | + qCDebug(entity_script_server) << "Reloading: " << entityID; | |
| 105 | 105 | _entitiesScriptEngine->unloadEntityScript(entityID); |
| 106 | 106 | checkAndCallPreload(entityID, true); |
| 107 | 107 | } |
| @@ -191,12 +191,12 @@ void EntityScriptServer::handleEntityServerScriptLogPacket(QSharedPointer<Receiv · 83 unmodified lines | ||
| 191 | 191 | if (enable && senderNode->getCanRez()) { |
| 192 | 192 | if (it == std::end(_logListeners)) { |
| 193 | 193 | _logListeners.insert(senderUUID); |
| 194 | − qInfo() << "Node" << senderUUID << "subscribed to log stream"; | |
| 194 | + qCInfo(entity_script_server) << "Node" << senderUUID << "subscribed to log stream"; | |
| 195 | 195 | } |
| 196 | 196 | } else { |
| 197 | 197 | if (it != std::end(_logListeners)) { |
| 198 | 198 | _logListeners.erase(it); |
| 199 | − qInfo() << "Node" << senderUUID << "unsubscribed from log stream"; | |
| 199 | + qCInfo(entity_script_server) << "Node" << senderUUID << "unsubscribed from log stream"; | |
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | } |
| @@ -226,16 +226,12 @@ void EntityScriptServer::pushLogs() { · 23 unmodified lines | ||
| 226 | 226 | if (node && node->getActiveSocket()) { |
| 227 | 227 | auto copy = NLPacket::createCopy(*packet); |
| 228 | 228 | nodeList->sendPacket(std::move(copy), *node); |
| 229 | − } else { | |
| 230 | − qWarning() << "Node not found"; | |
| 231 | 229 | } |
| 232 | 230 | } |
| 233 | 231 | |
| 234 | 232 | auto node = nodeList->nodeWithUUID(*last); |
| 235 | 233 | if (node && node->getActiveSocket()) { |
| 236 | 234 | nodeList->sendPacket(std::move(packet), *node); |
| 237 | − } else { | |
| 238 | − qWarning() << "Node not found"; | |
| 239 | 235 | } |
| 240 | 236 | } |
| 241 | 237 | |
| @@ -388,7 +384,7 @@ void EntityScriptServer::handleSelectedAudioFormat(QSharedPointer<ReceivedMessag · 146 unmodified lines | ||
| 388 | 384 | void EntityScriptServer::selectAudioFormat(const QString& selectedCodecName) { |
| 389 | 385 | _selectedCodecName = selectedCodecName; |
| 390 | 386 | |
| 391 | − qDebug() << "Selected Codec:" << _selectedCodecName; | |
| 387 | + qCDebug(entity_script_server) << "Selected Codec:" << _selectedCodecName; | |
| 392 | 388 | |
| 393 | 389 | // release any old codec encoder/decoder first... |
| 394 | 390 | if (_codec && _encoder) { |
| @@ -402,7 +398,7 @@ void EntityScriptServer::selectAudioFormat(const QString& selectedCodecName) { · 7 unmodified lines | ||
| 402 | 398 | if (_selectedCodecName == plugin->getName()) { |
| 403 | 399 | _codec = plugin; |
| 404 | 400 | _encoder = plugin->createEncoder(AudioConstants::SAMPLE_RATE, AudioConstants::MONO); |
| 405 | − qDebug() << "Selected Codec Plugin:" << _codec.get(); | |
| 401 | + qCDebug(entity_script_server) << "Selected Codec Plugin:" << _codec.get(); | |
| 406 | 402 | break; |
| 407 | 403 | } |
| 408 | 404 | } |
| @@ -490,7 +486,7 @@ void EntityScriptServer::checkAndCallPreload(const EntityItemID& entityID, const · 81 unmodified lines | ||
| 490 | 486 | QString scriptUrl = entity->getServerScripts(); |
| 491 | 487 | if (!scriptUrl.isEmpty()) { |
| 492 | 488 | scriptUrl = ResourceManager::normalizeURL(scriptUrl); |
| 493 | − qDebug() << "Loading entity server script" << scriptUrl << "for" << entityID; | |
| 489 | + qCDebug(entity_script_server) << "Loading entity server script" << scriptUrl << "for" << entityID; | |
| 494 | 490 | ScriptEngine::loadEntityScript(_entitiesScriptEngine, entityID, scriptUrl, reload); |
| 495 | 491 | } |
| 496 | 492 | } |