clean up debugging prints

This commit is contained in:
Seth Alves 2016-05-20 14:56:47 -07:00
parent ff36b39067
commit d95d3ff3ac

View file

@ -197,19 +197,16 @@ void Avatar::updateAvatarEntities() {
QScriptEngine scriptEngine; QScriptEngine scriptEngine;
entityTree->withWriteLock([&] { entityTree->withWriteLock([&] {
AvatarEntityMap avatarEntities = getAvatarEntityData(); AvatarEntityMap avatarEntities = getAvatarEntityData();
qDebug() << "---------------";
for (auto entityID : avatarEntities.keys()) { for (auto entityID : avatarEntities.keys()) {
// see EntityEditPacketSender::queueEditEntityMessage for the other end of this. unpack properties // see EntityEditPacketSender::queueEditEntityMessage for the other end of this. unpack properties
// and either add or update the entity. // and either add or update the entity.
QByteArray jsonByteArray = avatarEntities.value(entityID); QByteArray jsonByteArray = avatarEntities.value(entityID);
QJsonDocument jsonProperties = QJsonDocument::fromBinaryData(jsonByteArray); QJsonDocument jsonProperties = QJsonDocument::fromBinaryData(jsonByteArray);
if (!jsonProperties.isObject()) { if (!jsonProperties.isObject()) {
qDebug() << "got bad avatarEntity json"; qCDebug(interfaceapp) << "got bad avatarEntity json" << QString(jsonByteArray.toHex());
continue; continue;
} }
qDebug() << jsonProperties.toJson();
QVariant variantProperties = jsonProperties.toVariant(); QVariant variantProperties = jsonProperties.toVariant();
QVariantMap asMap = variantProperties.toMap(); QVariantMap asMap = variantProperties.toMap();
QScriptValue scriptProperties = variantMapToScriptValue(asMap, scriptEngine); QScriptValue scriptProperties = variantMapToScriptValue(asMap, scriptEngine);
@ -229,19 +226,14 @@ void Avatar::updateAvatarEntities() {
EntityItemPointer entity = entityTree->findEntityByEntityItemID(EntityItemID(entityID)); EntityItemPointer entity = entityTree->findEntityByEntityItemID(EntityItemID(entityID));
if (entity) { if (entity) {
qDebug() << "avatar-entities existing entity, element =" << entity->getElement().get();
if (entityTree->updateEntity(entityID, properties)) { if (entityTree->updateEntity(entityID, properties)) {
entity->updateLastEditedFromRemote(); entity->updateLastEditedFromRemote();
qDebug() << "avatar-entities after entityTree->updateEntity(), element =" << entity->getElement().get();
} else { } else {
qDebug() << "AVATAR-ENTITIES -- updateEntity failed: " << properties.getType();
success = false; success = false;
} }
} else { } else {
qDebug() << "avatar-entities new entity";
entity = entityTree->addEntity(entityID, properties); entity = entityTree->addEntity(entityID, properties);
if (!entity) { if (!entity) {
qDebug() << "AVATAR-ENTITIES -- addEntity failed: " << properties.getType();
success = false; success = false;
} }
} }
@ -1194,7 +1186,7 @@ void Avatar::setParentID(const QUuid& parentID) {
if (success) { if (success) {
setTransform(beforeChangeTransform, success); setTransform(beforeChangeTransform, success);
if (!success) { if (!success) {
qDebug() << "Avatar::setParentID failed to reset avatar's location."; qCDebug(interfaceapp) << "Avatar::setParentID failed to reset avatar's location.";
} }
} }
} }
@ -1209,7 +1201,7 @@ void Avatar::setParentJointIndex(quint16 parentJointIndex) {
if (success) { if (success) {
setTransform(beforeChangeTransform, success); setTransform(beforeChangeTransform, success);
if (!success) { if (!success) {
qDebug() << "Avatar::setParentJointIndex failed to reset avatar's location."; qCDebug(interfaceapp) << "Avatar::setParentJointIndex failed to reset avatar's location.";
} }
} }
} }