mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
use NodeList getNodeHash getter for methods that can be called from other threads
This commit is contained in:
parent
7d56dd57c0
commit
04286e39e6
1 changed files with 2 additions and 2 deletions
|
@ -257,7 +257,7 @@ int NodeList::updateNodeWithData(Node *node, const HifiSockAddr& senderSockAddr,
|
||||||
SharedNodePointer NodeList::nodeWithAddress(const HifiSockAddr &senderSockAddr) {
|
SharedNodePointer NodeList::nodeWithAddress(const HifiSockAddr &senderSockAddr) {
|
||||||
// naively returns the first node that has a matching active HifiSockAddr
|
// naively returns the first node that has a matching active HifiSockAddr
|
||||||
// note that there can be multiple nodes that have a matching active socket, so this isn't a good way to uniquely identify
|
// note that there can be multiple nodes that have a matching active socket, so this isn't a good way to uniquely identify
|
||||||
foreach (const SharedNodePointer& node, _nodeHash) {
|
foreach (const SharedNodePointer& node, getNodeHash()) {
|
||||||
if (node->getActiveSocket() && *node->getActiveSocket() == senderSockAddr) {
|
if (node->getActiveSocket() && *node->getActiveSocket() == senderSockAddr) {
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
@ -738,7 +738,7 @@ SharedNodePointer NodeList::addOrUpdateNode(const QUuid& uuid, char nodeType,
|
||||||
unsigned NodeList::broadcastToNodes(unsigned char* broadcastData, size_t dataBytes, const char* nodeTypes, int numNodeTypes) {
|
unsigned NodeList::broadcastToNodes(unsigned char* broadcastData, size_t dataBytes, const char* nodeTypes, int numNodeTypes) {
|
||||||
unsigned n = 0;
|
unsigned n = 0;
|
||||||
|
|
||||||
foreach (const SharedNodePointer& node, _nodeHash) {
|
foreach (const SharedNodePointer& node, getNodeHash()) {
|
||||||
// only send to the NodeTypes we are asked to send to.
|
// only send to the NodeTypes we are asked to send to.
|
||||||
if (memchr(nodeTypes, node->getType(), numNodeTypes)) {
|
if (memchr(nodeTypes, node->getType(), numNodeTypes)) {
|
||||||
if (getNodeActiveSocketOrPing(node.data())) {
|
if (getNodeActiveSocketOrPing(node.data())) {
|
||||||
|
|
Loading…
Reference in a new issue