mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 01:00:44 +02:00
fix assignment json for fulfilled assignments
This commit is contained in:
parent
7a1aa7ec89
commit
a826f3817b
1 changed files with 6 additions and 3 deletions
|
@ -816,7 +816,8 @@ QJsonObject DomainServer::jsonObjectForNode(const SharedNodePointer& node) {
|
||||||
nodeJson[JSON_KEY_WAKE_TIMESTAMP] = QString::number(node->getWakeTimestamp());
|
nodeJson[JSON_KEY_WAKE_TIMESTAMP] = QString::number(node->getWakeTimestamp());
|
||||||
|
|
||||||
// if the node has pool information, add it
|
// if the node has pool information, add it
|
||||||
SharedAssignmentPointer matchingAssignment = _allAssignments.value(node->getUUID());
|
DomainServerNodeData* nodeData = reinterpret_cast<DomainServerNodeData*>(node->getLinkedData());
|
||||||
|
SharedAssignmentPointer matchingAssignment = _allAssignments.value(nodeData->getAssignmentUUID());
|
||||||
if (matchingAssignment) {
|
if (matchingAssignment) {
|
||||||
nodeJson[JSON_KEY_POOL] = matchingAssignment->getPool();
|
nodeJson[JSON_KEY_POOL] = matchingAssignment->getPool();
|
||||||
}
|
}
|
||||||
|
@ -852,9 +853,11 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
||||||
|
|
||||||
// enumerate the NodeList to find the assigned nodes
|
// enumerate the NodeList to find the assigned nodes
|
||||||
foreach (const SharedNodePointer& node, LimitedNodeList::getInstance()->getNodeHash()) {
|
foreach (const SharedNodePointer& node, LimitedNodeList::getInstance()->getNodeHash()) {
|
||||||
if (_allAssignments.value(node->getUUID())) {
|
DomainServerNodeData* nodeData = reinterpret_cast<DomainServerNodeData*>(node->getLinkedData());
|
||||||
|
|
||||||
|
if (!nodeData->getAssignmentUUID().isNull()) {
|
||||||
// add the node using the UUID as the key
|
// add the node using the UUID as the key
|
||||||
QString uuidString = uuidStringWithoutCurlyBraces(node->getUUID());
|
QString uuidString = uuidStringWithoutCurlyBraces(nodeData->getAssignmentUUID());
|
||||||
assignedNodesJSON[uuidString] = jsonObjectForNode(node);
|
assignedNodesJSON[uuidString] = jsonObjectForNode(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue