mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 07:23:39 +02:00
Keep Agents and EntityScriptServers from connecting if lacking permissions
This commit is contained in:
parent
3ac44e3a1c
commit
b6893a0100
1 changed files with 21 additions and 10 deletions
|
@ -953,10 +953,20 @@ void DomainServer::sendDomainListToNode(const SharedNodePointer& node, const Hif
|
||||||
// DTLSServerSession* dtlsSession = _isUsingDTLS ? _dtlsSessions[senderSockAddr] : NULL;
|
// DTLSServerSession* dtlsSession = _isUsingDTLS ? _dtlsSessions[senderSockAddr] : NULL;
|
||||||
if (nodeData->isAuthenticated()) {
|
if (nodeData->isAuthenticated()) {
|
||||||
// if this authenticated node has any interest types, send back those nodes as well
|
// if this authenticated node has any interest types, send back those nodes as well
|
||||||
limitedNodeList->eachNode([&](const SharedNodePointer& otherNode){
|
limitedNodeList->eachNode([&](const SharedNodePointer& otherNode) {
|
||||||
if (otherNode->getUUID() != node->getUUID()
|
if (otherNode->getUUID() != node->getUUID()
|
||||||
&& nodeInterestSet.contains(otherNode->getType())) {
|
&& 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
|
// since we're about to add a node to the packet we start a segment
|
||||||
domainListPackets->startSegment();
|
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
|
// we've added the node we wanted so end the segment now
|
||||||
domainListPackets->endSegment();
|
domainListPackets->endSegment();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue