mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 21:29:33 +02:00
Copy pasting the code that Stephen did and also adding the AssetServer to the list of dependent nodes for the agent
This commit is contained in:
parent
301f0ba145
commit
25654824a2
1 changed files with 14 additions and 9 deletions
|
@ -17,6 +17,7 @@
|
||||||
#include <QtNetwork/QNetworkReply>
|
#include <QtNetwork/QNetworkReply>
|
||||||
|
|
||||||
#include <AvatarHashMap.h>
|
#include <AvatarHashMap.h>
|
||||||
|
#include <AssetClient.h>
|
||||||
#include <MessagesClient.h>
|
#include <MessagesClient.h>
|
||||||
#include <NetworkAccessManager.h>
|
#include <NetworkAccessManager.h>
|
||||||
#include <NodeList.h>
|
#include <NodeList.h>
|
||||||
|
@ -51,21 +52,19 @@ Agent::Agent(NLPacket& packet) :
|
||||||
{
|
{
|
||||||
DependencyManager::get<EntityScriptingInterface>()->setPacketSender(&_entityEditSender);
|
DependencyManager::get<EntityScriptingInterface>()->setPacketSender(&_entityEditSender);
|
||||||
|
|
||||||
DependencyManager::set<ResourceCacheSharedItems>();
|
auto assetClient = DependencyManager::set<AssetClient>();
|
||||||
DependencyManager::set<SoundCache>();
|
|
||||||
DependencyManager::set<AssetClient>();
|
|
||||||
DependencyManager::set<recording::Deck>();
|
|
||||||
DependencyManager::set<recording::Recorder>();
|
|
||||||
DependencyManager::set<RecordingScriptingInterface>();
|
|
||||||
|
|
||||||
// Setup AssetClient
|
|
||||||
auto assetClient = DependencyManager::get<AssetClient>();
|
|
||||||
QThread* assetThread = new QThread;
|
QThread* assetThread = new QThread;
|
||||||
assetThread->setObjectName("Asset Thread");
|
assetThread->setObjectName("Asset Thread");
|
||||||
assetClient->moveToThread(assetThread);
|
assetClient->moveToThread(assetThread);
|
||||||
connect(assetThread, &QThread::started, assetClient.data(), &AssetClient::init);
|
connect(assetThread, &QThread::started, assetClient.data(), &AssetClient::init);
|
||||||
assetThread->start();
|
assetThread->start();
|
||||||
|
|
||||||
|
DependencyManager::set<ResourceCacheSharedItems>();
|
||||||
|
DependencyManager::set<SoundCache>();
|
||||||
|
DependencyManager::set<recording::Deck>();
|
||||||
|
DependencyManager::set<recording::Recorder>();
|
||||||
|
DependencyManager::set<RecordingScriptingInterface>();
|
||||||
|
|
||||||
auto& packetReceiver = DependencyManager::get<NodeList>()->getPacketReceiver();
|
auto& packetReceiver = DependencyManager::get<NodeList>()->getPacketReceiver();
|
||||||
|
|
||||||
|
@ -143,7 +142,7 @@ void Agent::run() {
|
||||||
messagesThread->start();
|
messagesThread->start();
|
||||||
|
|
||||||
nodeList->addSetOfNodeTypesToNodeInterestSet({
|
nodeList->addSetOfNodeTypesToNodeInterestSet({
|
||||||
NodeType::AudioMixer, NodeType::AvatarMixer, NodeType::EntityServer, NodeType::MessagesMixer
|
NodeType::AudioMixer, NodeType::AvatarMixer, NodeType::EntityServer, NodeType::MessagesMixer, NodeType::AssetServer
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,4 +457,10 @@ void Agent::aboutToFinish() {
|
||||||
|
|
||||||
// our entity tree is going to go away so tell that to the EntityScriptingInterface
|
// our entity tree is going to go away so tell that to the EntityScriptingInterface
|
||||||
DependencyManager::get<EntityScriptingInterface>()->setEntityTree(NULL);
|
DependencyManager::get<EntityScriptingInterface>()->setEntityTree(NULL);
|
||||||
|
|
||||||
|
// cleanup the AssetClient thread
|
||||||
|
QThread* assetThread = DependencyManager::get<AssetClient>()->thread();
|
||||||
|
DependencyManager::destroy<AssetClient>();
|
||||||
|
assetThread->quit();
|
||||||
|
assetThread->wait();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue