mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:48:09 +02:00
Merge branch 'master' of git://github.com/worklist/hifi into windows_build
Conflicts: libraries/shared/src/NodeList.cpp libraries/shared/src/NodeList.h
This commit is contained in:
commit
bd6e30070d
3 changed files with 12 additions and 8 deletions
|
@ -55,7 +55,8 @@ void Agent::run() {
|
||||||
// XXXBHG - this seems less than ideal. There might be classes (like jurisdiction listeners, that need access to
|
// XXXBHG - this seems less than ideal. There might be classes (like jurisdiction listeners, that need access to
|
||||||
// other node types, but for them to get access to those node types, we have to add them here. It seems like
|
// other node types, but for them to get access to those node types, we have to add them here. It seems like
|
||||||
// NodeList should support adding types of interest
|
// NodeList should support adding types of interest
|
||||||
const NODE_TYPE AGENT_NODE_TYPES_OF_INTEREST[] = { NODE_TYPE_VOXEL_SERVER, NODE_TYPE_PARTICLE_SERVER };
|
const NODE_TYPE AGENT_NODE_TYPES_OF_INTEREST[] = { NODE_TYPE_VOXEL_SERVER, NODE_TYPE_PARTICLE_SERVER,
|
||||||
|
NODE_TYPE_AUDIO_MIXER };
|
||||||
|
|
||||||
nodeList->setNodeTypesOfInterest(AGENT_NODE_TYPES_OF_INTEREST, sizeof(AGENT_NODE_TYPES_OF_INTEREST));
|
nodeList->setNodeTypesOfInterest(AGENT_NODE_TYPES_OF_INTEREST, sizeof(AGENT_NODE_TYPES_OF_INTEREST));
|
||||||
|
|
||||||
|
|
|
@ -288,7 +288,9 @@ void NodeList::clear() {
|
||||||
|
|
||||||
// iterate the nodes in the list
|
// iterate the nodes in the list
|
||||||
while (nodeItem != _nodeHash.end()) {
|
while (nodeItem != _nodeHash.end()) {
|
||||||
nodeItem = killNodeAtHashIterator(nodeItem);
|
NodeHash::iterator previousNodeItem = nodeItem;
|
||||||
|
++nodeItem;
|
||||||
|
killNodeAtHashIterator(previousNodeItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,14 +456,12 @@ void NodeList::killNodeWithUUID(const QUuid& nodeUUID) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeHash::iterator NodeList::killNodeAtHashIterator(NodeHash::iterator& nodeItemToKill) {
|
void NodeList::killNodeAtHashIterator(NodeHash::iterator& nodeItemToKill) {
|
||||||
qDebug() << "Killed" << *nodeItemToKill.value();
|
qDebug() << "Killed" << *nodeItemToKill.value();
|
||||||
emit nodeKilled(nodeItemToKill.value());
|
emit nodeKilled(nodeItemToKill.value());
|
||||||
|
_nodeHash.erase(nodeItemToKill);
|
||||||
return _nodeHash.erase(nodeItemToKill);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void NodeList::sendKillNode(const char* nodeTypes, int numNodeTypes) {
|
void NodeList::sendKillNode(const char* nodeTypes, int numNodeTypes) {
|
||||||
unsigned char packet[MAX_PACKET_SIZE];
|
unsigned char packet[MAX_PACKET_SIZE];
|
||||||
unsigned char* packetPosition = packet;
|
unsigned char* packetPosition = packet;
|
||||||
|
@ -803,7 +803,10 @@ void NodeList::removeSilentNodes() {
|
||||||
|
|
||||||
if ((usecTimestampNow() - node->getLastHeardMicrostamp()) > NODE_SILENCE_THRESHOLD_USECS) {
|
if ((usecTimestampNow() - node->getLastHeardMicrostamp()) > NODE_SILENCE_THRESHOLD_USECS) {
|
||||||
// call our private method to kill this node (removes it and emits the right signal)
|
// call our private method to kill this node (removes it and emits the right signal)
|
||||||
nodeItem = killNodeAtHashIterator(nodeItem);
|
NodeHash::iterator previousNodeItem = nodeItem;
|
||||||
|
++nodeItem;
|
||||||
|
|
||||||
|
killNodeAtHashIterator(previousNodeItem);
|
||||||
} else {
|
} else {
|
||||||
// we didn't kill this node, push the iterator forwards
|
// we didn't kill this node, push the iterator forwards
|
||||||
++nodeItem;
|
++nodeItem;
|
||||||
|
|
|
@ -136,7 +136,7 @@ private:
|
||||||
void processSTUNResponse(unsigned char* packetData, size_t dataBytes);
|
void processSTUNResponse(unsigned char* packetData, size_t dataBytes);
|
||||||
|
|
||||||
void processKillNode(unsigned char* packetData, size_t dataBytes);
|
void processKillNode(unsigned char* packetData, size_t dataBytes);
|
||||||
NodeHash::iterator killNodeAtHashIterator(NodeHash::iterator& nodeItemToKill);
|
void killNodeAtHashIterator(NodeHash::iterator& nodeItemToKill);
|
||||||
|
|
||||||
NodeHash _nodeHash;
|
NodeHash _nodeHash;
|
||||||
QString _domainHostname;
|
QString _domainHostname;
|
||||||
|
|
Loading…
Reference in a new issue