mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 15:23:56 +02:00
fix seeking in packet, use nodeActivated for ignore list send
This commit is contained in:
parent
b68958317a
commit
cc9b72daa4
2 changed files with 3 additions and 4 deletions
|
@ -80,14 +80,12 @@ void Node::updateClockSkewUsec(qint64 clockSkewSample) {
|
|||
_clockSkewUsec = (quint64)_clockSkewMovingPercentile.getValueAtPercentile();
|
||||
}
|
||||
|
||||
void Node::parseIgnoreRequestMessage(QSharedPointer<ReceivedMessage> message) {
|
||||
void Node::parseIgnoreRequestMessage(QSharedPointer<ReceivedMessage> message) {
|
||||
while (message->getBytesLeftToRead()) {
|
||||
// parse out the UUID being ignored from the packet
|
||||
QUuid ignoredUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
||||
|
||||
addIgnoredNode(ignoredUUID);
|
||||
|
||||
message->seek(message->getPosition() + NUM_BYTES_RFC4122_UUID);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ NodeList::NodeList(char newOwnerType, unsigned short socketListenPort, unsigned
|
|||
connect(this, &LimitedNodeList::nodeAdded, this, &NodeList::startNodeHolePunch);
|
||||
|
||||
// anytime we get a new node we may need to re-send our set of ignored node IDs to it
|
||||
connect(this, &LimitedNodeList::nodeAdded, this, &NodeList::maybeSendIgnoreSetToNode);
|
||||
connect(this, &LimitedNodeList::nodeActivated, this, &NodeList::maybeSendIgnoreSetToNode);
|
||||
|
||||
// setup our timer to send keepalive pings (it's started and stopped on domain connect/disconnect)
|
||||
_keepAlivePingTimer.setInterval(KEEPALIVE_PING_INTERVAL_MS);
|
||||
|
@ -747,6 +747,7 @@ void NodeList::maybeSendIgnoreSetToNode(SharedNodePointer newNode) {
|
|||
// so send that list along now (assuming it isn't empty)
|
||||
|
||||
QReadLocker setLocker { &_ignoredSetLock };
|
||||
|
||||
if (_ignoredNodeIDs.size() > 0) {
|
||||
// setup a packet list so we can send the stream of ignore IDs
|
||||
auto ignorePacketList = NLPacketList::create(PacketType::NodeIgnoreRequest, QByteArray(), true);
|
||||
|
|
Loading…
Reference in a new issue