mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 20:58:28 +02:00
clean up sequence numbers for killed sending nodes
This commit is contained in:
parent
fe011e6752
commit
790f7a08cf
2 changed files with 25 additions and 2 deletions
|
@ -272,9 +272,8 @@ void AvatarMixer::broadcastAvatarData() {
|
||||||
// Did we somehow get out of order packets from the sender?
|
// Did we somehow get out of order packets from the sender?
|
||||||
// We don't expect this to happen - in RELEASE we add this to a trackable stat
|
// We don't expect this to happen - in RELEASE we add this to a trackable stat
|
||||||
// and in DEBUG we crash on the assert above
|
// and in DEBUG we crash on the assert above
|
||||||
|
otherNodeData->incrementNumOutOfOrderSends();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// make sure we haven't already sent this data from this sender to this receiver
|
// make sure we haven't already sent this data from this sender to this receiver
|
||||||
// or that somehow we haven't sent
|
// or that somehow we haven't sent
|
||||||
|
@ -374,12 +373,35 @@ void AvatarMixer::nodeKilled(SharedNodePointer killedNode) {
|
||||||
if (killedNode->getType() == NodeType::Agent
|
if (killedNode->getType() == NodeType::Agent
|
||||||
&& killedNode->getLinkedData()) {
|
&& killedNode->getLinkedData()) {
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
|
||||||
// this was an avatar we were sending to other people
|
// this was an avatar we were sending to other people
|
||||||
// send a kill packet for it to our other nodes
|
// send a kill packet for it to our other nodes
|
||||||
QByteArray killPacket = nodeList->byteArrayWithPopulatedHeader(PacketTypeKillAvatar);
|
QByteArray killPacket = nodeList->byteArrayWithPopulatedHeader(PacketTypeKillAvatar);
|
||||||
killPacket += killedNode->getUUID().toRfc4122();
|
killPacket += killedNode->getUUID().toRfc4122();
|
||||||
|
|
||||||
nodeList->broadcastToNodes(killPacket, NodeSet() << NodeType::Agent);
|
nodeList->broadcastToNodes(killPacket, NodeSet() << NodeType::Agent);
|
||||||
|
|
||||||
|
// we also want to remove sequence number data for this avatar on our other avatars
|
||||||
|
// so invoke the appropriate method on the AvatarMixerClientData for other avatars
|
||||||
|
nodeList->eachMatchingNode(
|
||||||
|
[&](const SharedNodePointer& node)->bool {
|
||||||
|
if (!node->getLinkedData()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node->getUUID() == killedNode->getUUID()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
[&](const SharedNodePointer& node) {
|
||||||
|
QMetaObject::invokeMethod(node->getLinkedData(),
|
||||||
|
"removeLastBroadcastSequenceNumber",
|
||||||
|
Qt::AutoConnection,
|
||||||
|
Q_ARG(const QUuid&, QUuid(killedNode->getUUID())));
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
PacketSequenceNumber getLastBroadcastSequenceNumber(const QUuid& nodeUUID) const;
|
PacketSequenceNumber getLastBroadcastSequenceNumber(const QUuid& nodeUUID) const;
|
||||||
void setLastBroadcastSequenceNumber(const QUuid& nodeUUID, PacketSequenceNumber sequenceNumber)
|
void setLastBroadcastSequenceNumber(const QUuid& nodeUUID, PacketSequenceNumber sequenceNumber)
|
||||||
{ _lastBroadcastSequenceNumbers[nodeUUID] = sequenceNumber; }
|
{ _lastBroadcastSequenceNumbers[nodeUUID] = sequenceNumber; }
|
||||||
|
Q_INVOKABLE void removeLastBroadcastSequenceNumber(const QUuid& nodeUUID) { _lastBroadcastSequenceNumbers.erase(nodeUUID); }
|
||||||
|
|
||||||
quint64 getBillboardChangeTimestamp() const { return _billboardChangeTimestamp; }
|
quint64 getBillboardChangeTimestamp() const { return _billboardChangeTimestamp; }
|
||||||
void setBillboardChangeTimestamp(quint64 billboardChangeTimestamp) { _billboardChangeTimestamp = billboardChangeTimestamp; }
|
void setBillboardChangeTimestamp(quint64 billboardChangeTimestamp) { _billboardChangeTimestamp = billboardChangeTimestamp; }
|
||||||
|
|
Loading…
Reference in a new issue