diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index 00c9ab2dde..a295319857 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -349,7 +349,6 @@ int EntityItem::expectedBytes() { return MINIMUM_HEADER_BYTES; } - // clients use this method to unpack FULL updates from entity-server int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args) { if (args.bitstreamVersion < VERSION_ENTITIES_SUPPORT_SPLIT_MTU) { @@ -667,6 +666,9 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef // entity-server is trying to clear our ownership (probably at our own request) // but we actually want to own it, therefore we ignore this clear event // and pretend that we own it (we assume we'll recover it soon) + + // However, for now, when the server uses a newer time than what we sent, listen to what we're told. + if (overwriteLocalData) weOwnSimulation = false; } else if (_simulationOwner.set(newSimOwner)) { _dirtyFlags |= Simulation::DIRTY_SIMULATOR_ID; somethingChanged = true; diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index e6dc0de185..9d5d14402d 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -952,7 +952,7 @@ bool EntityTree::filterProperties(EntityItemProperties& propertiesIn, EntityItem wasChanged = in != out; if (wasChanged) { // Logging will be removed eventually, but for now, the behavior is so fragile that it's worth logging. - qCDebug(entities) << "filter accepted. changed:" << wasChanged; + qCDebug(entities) << "filter accepted. changed: true"; qCDebug(entities) << " in:" << in; qCDebug(entities) << " out:" << out; } @@ -1059,9 +1059,8 @@ int EntityTree::processEditPacketData(ReceivedMessage& message, const unsigned c } if (!allowed || wasChanged) { bumpTimestamp(properties); - if (properties.getSimulationOwner().getID() == senderNode->getUUID()) { - properties.setSimulationOwner(QUuid(), 0); - } + // For now, free ownership on any modification. + properties.clearSimulationOwner(); } endFilter = usecTimestampNow();