mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:07:07 +02:00
Add node data to downstream avatar mixers
This commit is contained in:
parent
6c5947d319
commit
52150ad971
3 changed files with 13 additions and 5 deletions
|
@ -851,5 +851,9 @@ void AvatarMixer::parseDomainServerSettings(const QJsonObject& domainSettings) {
|
||||||
<< "and a maximum avatar scale of" << _domainMaximumScale;
|
<< "and a maximum avatar scale of" << _domainMaximumScale;
|
||||||
|
|
||||||
|
|
||||||
parseDownstreamServers(domainSettings, NodeType::AvatarMixer);
|
parseDownstreamServers(domainSettings, NodeType::AvatarMixer, [](Node& node) {
|
||||||
|
if (!node.getLinkedData()) {
|
||||||
|
node.setLinkedData(std::unique_ptr<NodeData> { new AvatarMixerClientData(node.getUUID()) });
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ void ThreadedAssignment::domainSettingsRequestFailed() {
|
||||||
setFinished(true);
|
setFinished(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThreadedAssignment::parseDownstreamServers(const QJsonObject& settingsObject, NodeType_t nodeType) {
|
void ThreadedAssignment::parseDownstreamServers(const QJsonObject& settingsObject, NodeType_t nodeType, DownstreamNodeFoundCallback callback) {
|
||||||
static const QString REPLICATION_GROUP_KEY = "replication";
|
static const QString REPLICATION_GROUP_KEY = "replication";
|
||||||
static const QString DOWNSTREAM_SERVERS_SETTING_KEY = "downstream_servers";
|
static const QString DOWNSTREAM_SERVERS_SETTING_KEY = "downstream_servers";
|
||||||
if (settingsObject.contains(REPLICATION_GROUP_KEY)) {
|
if (settingsObject.contains(REPLICATION_GROUP_KEY)) {
|
||||||
|
@ -161,8 +161,9 @@ void ThreadedAssignment::parseDownstreamServers(const QJsonObject& settingsObjec
|
||||||
};
|
};
|
||||||
|
|
||||||
// manually add the downstream node to our node list
|
// manually add the downstream node to our node list
|
||||||
nodeList->addOrUpdateNode(QUuid::createUuid(), NodeType::downstreamType(nodeType),
|
auto node = nodeList->addOrUpdateNode(QUuid::createUuid(), NodeType::downstreamType(nodeType),
|
||||||
downstreamServerAddr, downstreamServerAddr);
|
downstreamServerAddr, downstreamServerAddr);
|
||||||
|
callback(*node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
#include "Assignment.h"
|
#include "Assignment.h"
|
||||||
|
|
||||||
|
using DownstreamNodeFoundCallback = std::function<void(Node& downstreamNode)>;
|
||||||
|
|
||||||
class ThreadedAssignment : public Assignment {
|
class ThreadedAssignment : public Assignment {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -40,7 +42,8 @@ signals:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void commonInit(const QString& targetName, NodeType_t nodeType);
|
void commonInit(const QString& targetName, NodeType_t nodeType);
|
||||||
void parseDownstreamServers(const QJsonObject& settingsObject, NodeType_t nodeType);
|
void parseDownstreamServers(const QJsonObject& settingsObject, NodeType_t nodeType,
|
||||||
|
DownstreamNodeFoundCallback callback = [](Node& downstreamNode) {});
|
||||||
|
|
||||||
bool _isFinished;
|
bool _isFinished;
|
||||||
QTimer _domainServerTimer;
|
QTimer _domainServerTimer;
|
||||||
|
|
Loading…
Reference in a new issue