Keep Agents and EntityScriptServers from connecting if lacking permissions

This commit is contained in:
Ryan Huffman 2017-01-19 14:35:27 -08:00
parent 3ac44e3a1c
commit b6893a0100

View file

@ -957,6 +957,16 @@ void DomainServer::sendDomainListToNode(const SharedNodePointer& node, const Hif
if (otherNode->getUUID() != node->getUUID()
&& nodeInterestSet.contains(otherNode->getType())) {
// (1/19/17) Agents only need to connect to Entity Script Servers to perform administrative tasks
// related to entity server scripts. Only agents with rez permissions should be doing that, so
// if the agent does not have those permissions, we do not want them and the server to incur the
// overhead of connecting to one another.
bool shouldNotConnect = (node->getType() == NodeType::Agent && otherNode->getType() == NodeType::EntityScriptServer
&& !node->getCanRez() && !node->getCanRezTmp())
|| (node->getType() == NodeType::EntityScriptServer && otherNode->getType() == NodeType::Agent
&& !otherNode->getCanRez() && !otherNode->getCanRezTmp());
if (!shouldNotConnect) {
// since we're about to add a node to the packet we start a segment
domainListPackets->startSegment();
@ -969,6 +979,7 @@ void DomainServer::sendDomainListToNode(const SharedNodePointer& node, const Hif
// we've added the node we wanted so end the segment now
domainListPackets->endSegment();
}
}
});
}
}