add some more logging

This commit is contained in:
ZappoMan 2017-04-26 14:03:36 -07:00
parent fd874429c1
commit 7154a11192
4 changed files with 13 additions and 3 deletions

View file

@ -583,6 +583,7 @@ void Agent::setIsAvatar(bool isAvatar) {
void Agent::sendAvatarIdentityPacket() { void Agent::sendAvatarIdentityPacket() {
if (_isAvatar) { if (_isAvatar) {
auto scriptedAvatar = DependencyManager::get<ScriptableAvatar>(); auto scriptedAvatar = DependencyManager::get<ScriptableAvatar>();
qDebug() << __FUNCTION__ << "about to call sendIdentityPacket()";
scriptedAvatar->sendIdentityPacket(); scriptedAvatar->sendIdentityPacket();
} }
} }

View file

@ -70,6 +70,7 @@ AvatarMixer::~AvatarMixer() {
} }
void AvatarMixer::sendIdentityPacket(AvatarMixerClientData* nodeData, const SharedNodePointer& destinationNode) { void AvatarMixer::sendIdentityPacket(AvatarMixerClientData* nodeData, const SharedNodePointer& destinationNode) {
qDebug() << __FUNCTION__ << "about to call nodeData->getAvatar().identityByteArray()... for node:" << nodeData->getNodeID();
QByteArray individualData = nodeData->getAvatar().identityByteArray(); QByteArray individualData = nodeData->getAvatar().identityByteArray();
auto identityPacket = NLPacket::create(PacketType::AvatarIdentity, individualData.size()); auto identityPacket = NLPacket::create(PacketType::AvatarIdentity, individualData.size());
@ -215,6 +216,8 @@ void AvatarMixer::manageDisplayName(const SharedNodePointer& node) {
soFar.second++; // refcount soFar.second++; // refcount
nodeData->flagIdentityChange(); nodeData->flagIdentityChange();
nodeData->setAvatarSessionDisplayNameMustChange(false); nodeData->setAvatarSessionDisplayNameMustChange(false);
qCDebug(avatars) << __FUNCTION__ << "about to call sendIdentityPacket()";
sendIdentityPacket(nodeData, node); // Tell node whose name changed about its new session display name. sendIdentityPacket(nodeData, node); // Tell node whose name changed about its new session display name.
qCDebug(avatars) << "Giving session display name" << sessionDisplayName << "to node with ID" << node->getUUID(); qCDebug(avatars) << "Giving session display name" << sessionDisplayName << "to node with ID" << node->getUUID();
} }
@ -405,9 +408,14 @@ void AvatarMixer::handleAvatarIdentityPacket(QSharedPointer<ReceivedMessage> mes
// parse the identity packet and update the change timestamp if appropriate // parse the identity packet and update the change timestamp if appropriate
AvatarData::Identity identity; AvatarData::Identity identity;
qCDebug(avatars) << __FUNCTION__ << "about to call parseAvatarIdentityPacket()";
AvatarData::parseAvatarIdentityPacket(message->getMessage(), identity); AvatarData::parseAvatarIdentityPacket(message->getMessage(), identity);
bool identityChanged = false; bool identityChanged = false;
bool displayNameChanged = false; bool displayNameChanged = false;
qCDebug(avatars) << __FUNCTION__ << "about to call processAvatarIdentity()";
avatar.processAvatarIdentity(identity, identityChanged, displayNameChanged); avatar.processAvatarIdentity(identity, identityChanged, displayNameChanged);
if (identityChanged) { if (identityChanged) {
QMutexLocker nodeDataLocker(&nodeData->getMutex()); QMutexLocker nodeDataLocker(&nodeData->getMutex());

View file

@ -67,6 +67,7 @@ void AvatarMixerSlave::processIncomingPackets(const SharedNodePointer& node) {
int AvatarMixerSlave::sendIdentityPacket(const AvatarMixerClientData* nodeData, const SharedNodePointer& destinationNode) { int AvatarMixerSlave::sendIdentityPacket(const AvatarMixerClientData* nodeData, const SharedNodePointer& destinationNode) {
qDebug() << __FUNCTION__ << "about to call nodeData->getConstAvatarData().identityByteArray()... for node:" << nodeData->getNodeID();
QByteArray individualData = nodeData->getConstAvatarData()->identityByteArray(); QByteArray individualData = nodeData->getConstAvatarData()->identityByteArray();
individualData.replace(0, NUM_BYTES_RFC4122_UUID, nodeData->getNodeID().toRfc4122()); // FIXME, this looks suspicious individualData.replace(0, NUM_BYTES_RFC4122_UUID, nodeData->getNodeID().toRfc4122()); // FIXME, this looks suspicious
auto identityPackets = NLPacketList::create(PacketType::AvatarIdentity, QByteArray(), true, true); auto identityPackets = NLPacketList::create(PacketType::AvatarIdentity, QByteArray(), true, true);
@ -302,6 +303,7 @@ void AvatarMixerSlave::broadcastAvatarData(const SharedNodePointer& node) {
// If the time that the mixer sent AVATAR DATA about Avatar B to Avatar A is BEFORE OR EQUAL TO // If the time that the mixer sent AVATAR DATA about Avatar B to Avatar A is BEFORE OR EQUAL TO
// the time that Avatar B flagged an IDENTITY DATA change, send IDENTITY DATA about Avatar B to Avatar A. // the time that Avatar B flagged an IDENTITY DATA change, send IDENTITY DATA about Avatar B to Avatar A.
if (nodeData->getLastBroadcastTime(otherNode->getUUID()) <= otherNodeData->getIdentityChangeTimestamp()) { if (nodeData->getLastBroadcastTime(otherNode->getUUID()) <= otherNodeData->getIdentityChangeTimestamp()) {
qCDebug(avatars) << __FUNCTION__ << "about to call sendIdentityPacket()";
identityBytesSent += sendIdentityPacket(otherNodeData, node); identityBytesSent += sendIdentityPacket(otherNodeData, node);
} }

View file

@ -1529,15 +1529,13 @@ void AvatarData::processAvatarIdentity(const Identity& identity, bool& identityC
} }
QByteArray AvatarData::identityByteArray() const { QByteArray AvatarData::identityByteArray() const {
qDebug() << __FUNCTION__;
QByteArray identityData; QByteArray identityData;
QDataStream identityStream(&identityData, QIODevice::Append); QDataStream identityStream(&identityData, QIODevice::Append);
const QUrl& urlToSend = cannonicalSkeletonModelURL(emptyURL); // depends on _skeletonModelURL const QUrl& urlToSend = cannonicalSkeletonModelURL(emptyURL); // depends on _skeletonModelURL
_avatarEntitiesLock.withReadLock([&] { _avatarEntitiesLock.withReadLock([&] {
qDebug() << __FUNCTION__ qDebug() << "AvatarData::identityByteArray() ... "
<< "session:" << getSessionUUID() << "session:" << getSessionUUID()
<< "url:" << urlToSend << "url:" << urlToSend
<< "displayName:" << _displayName << "displayName:" << _displayName
@ -1731,6 +1729,7 @@ void AvatarData::sendIdentityPacket() {
qDebug() << __FUNCTION__; qDebug() << __FUNCTION__;
auto nodeList = DependencyManager::get<NodeList>(); auto nodeList = DependencyManager::get<NodeList>();
qDebug() << __FUNCTION__ << "about to call identityByteArray()... for getSessionUUID:" << getSessionUUID();
QByteArray identityData = identityByteArray(); QByteArray identityData = identityByteArray();
auto packetList = NLPacketList::create(PacketType::AvatarIdentity, QByteArray(), true, true); auto packetList = NLPacketList::create(PacketType::AvatarIdentity, QByteArray(), true, true);