mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 08:14:48 +02:00
don't add node missing from a replicated kill packet
This commit is contained in:
parent
121cf76ee3
commit
98ccfa80a2
1 changed files with 16 additions and 1 deletions
|
@ -85,7 +85,22 @@ void AvatarMixer::handleReplicatedPacket(QSharedPointer<ReceivedMessage> message
|
|||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
auto nodeID = QUuid::fromRfc4122(message->peek(NUM_BYTES_RFC4122_UUID));
|
||||
|
||||
auto replicatedNode = addOrUpdateReplicatedNode(nodeID, message->getSenderSockAddr());
|
||||
SharedNodePointer replicatedNode;
|
||||
|
||||
if (message->getType() == PacketType::ReplicatedKillAvatar) {
|
||||
// this is a kill packet, which we should only process if we already have the node in our list
|
||||
// since it of course does not make sense to add a node just to remove it an instant later
|
||||
replicatedNode = nodeList->nodeWithUUID(nodeID);
|
||||
|
||||
if (!replicatedNode) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
replicatedNode = addOrUpdateReplicatedNode(nodeID, message->getSenderSockAddr());
|
||||
}
|
||||
|
||||
// we better have a node to work with at this point
|
||||
assert(replicatedNode);
|
||||
|
||||
if (message->getType() == PacketType::ReplicatedAvatarIdentity) {
|
||||
handleAvatarIdentityPacket(message, replicatedNode);
|
||||
|
|
Loading…
Reference in a new issue