mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 21:33:35 +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
assignment-client/src/avatars
libraries/networking/src
|
@ -851,5 +851,9 @@ void AvatarMixer::parseDomainServerSettings(const QJsonObject& domainSettings) {
|
|||
<< "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);
|
||||
}
|
||||
|
||||
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 DOWNSTREAM_SERVERS_SETTING_KEY = "downstream_servers";
|
||||
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
|
||||
nodeList->addOrUpdateNode(QUuid::createUuid(), NodeType::downstreamType(nodeType),
|
||||
downstreamServerAddr, downstreamServerAddr);
|
||||
auto node = nodeList->addOrUpdateNode(QUuid::createUuid(), NodeType::downstreamType(nodeType),
|
||||
downstreamServerAddr, downstreamServerAddr);
|
||||
callback(*node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
#include "Assignment.h"
|
||||
|
||||
using DownstreamNodeFoundCallback = std::function<void(Node& downstreamNode)>;
|
||||
|
||||
class ThreadedAssignment : public Assignment {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@ -40,7 +42,8 @@ signals:
|
|||
|
||||
protected:
|
||||
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;
|
||||
QTimer _domainServerTimer;
|
||||
|
|
Loading…
Reference in a new issue