make sure kill packet has node ID

This commit is contained in:
Stephen Birarda 2017-06-14 11:26:33 -07:00
parent b7d8c173c1
commit 6fc1045ee9

View file

@ -150,6 +150,13 @@ void AvatarMixer::optionallyReplicatePacket(ReceivedMessage& message, const Node
if (!packet) { if (!packet) {
// construct an NLPacket to send to the replicant that has the contents of the received packet // construct an NLPacket to send to the replicant that has the contents of the received packet
packet = NLPacket::create(replicatedType, message.getSize()); packet = NLPacket::create(replicatedType, message.getSize());
if (message.getType() == PacketType::KillAvatar) {
// this was not a replicated packet originally, we need to prepend the session ID
// for the killed node
packet->write(node->getUUID().toRfc4122());
}
packet->write(message.getMessage()); packet->write(message.getMessage());
} }
@ -541,8 +548,6 @@ void AvatarMixer::handleAvatarIdentityPacket(QSharedPointer<ReceivedMessage> mes
} }
auto end = usecTimestampNow(); auto end = usecTimestampNow();
_handleAvatarIdentityPacketElapsedTime += (end - start); _handleAvatarIdentityPacketElapsedTime += (end - start);
optionallyReplicatePacket(*message, *senderNode);
} }
void AvatarMixer::handleKillAvatarPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer node) { void AvatarMixer::handleKillAvatarPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer node) {