mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:21:24 +02:00
debugging
This commit is contained in:
parent
fcd2e45d67
commit
c784ca9771
1 changed files with 10 additions and 4 deletions
|
@ -197,6 +197,7 @@ 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.
|
||||||
|
@ -206,6 +207,9 @@ void Avatar::updateAvatarEntities() {
|
||||||
qDebug() << "got bad avatarEntity json";
|
qDebug() << "got bad avatarEntity json";
|
||||||
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);
|
||||||
|
@ -214,7 +218,7 @@ void Avatar::updateAvatarEntities() {
|
||||||
properties.setClientOnly(true);
|
properties.setClientOnly(true);
|
||||||
properties.setOwningAvatarID(getID());
|
properties.setOwningAvatarID(getID());
|
||||||
|
|
||||||
// there's not entity-server to tell us we're the simulation owner, so always set the
|
// there's no entity-server to tell us we're the simulation owner, so always set the
|
||||||
// simulationOwner to the owningAvatarID and a high priority.
|
// simulationOwner to the owningAvatarID and a high priority.
|
||||||
properties.setSimulationOwner(getID(), 129);
|
properties.setSimulationOwner(getID(), 129);
|
||||||
|
|
||||||
|
@ -225,17 +229,19 @@ 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->markAsChangedOnServer();
|
|
||||||
entity->updateLastEditedFromRemote();
|
entity->updateLastEditedFromRemote();
|
||||||
|
qDebug() << "avatar-entities after entityTree->updateEntity(), element =" << entity->getElement().get();
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "AVATAR-ENTITES -- updateEntity failed: " << properties.getType();
|
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-ENTITES -- addEntity failed: " << properties.getType();
|
qDebug() << "AVATAR-ENTITIES -- addEntity failed: " << properties.getType();
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue