Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 12 files). Show all
Unified · Split
| @@ -9,18 +9,21 @@ · 8 unmodified lines | ||
| 9 | 9 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html |
| 10 | 10 | // |
| 11 | 11 | |
| 12 | +#include <iostream> // adebug | |
| 13 | +#include "EntityScriptingInterface.h" | |
| 14 | + | |
| 12 | 15 | #include <VariantMapToScriptValue.h> |
| 13 | 16 | |
| 17 | +#include "EntitiesLogging.h" | |
| 18 | +#include "EntityActionFactoryInterface.h" | |
| 19 | +#include "EntityActionInterface.h" | |
| 20 | +#include "EntitySimulation.h" | |
| 14 | 21 | #include "EntityTree.h" |
| 15 | 22 | #include "LightEntityItem.h" |
| 16 | 23 | #include "ModelEntityItem.h" |
| 24 | +#include "SimulationOwner.h" | |
| 17 | 25 | #include "ZoneEntityItem.h" |
| 18 | −#include "EntitiesLogging.h" | |
| 19 | −#include "EntitySimulation.h" | |
| 20 | −#include "EntityActionInterface.h" | |
| 21 | −#include "EntityActionFactoryInterface.h" | |
| 22 | 26 | |
| 23 | −#include "EntityScriptingInterface.h" | |
| 24 | 27 | |
| 25 | 28 | EntityScriptingInterface::EntityScriptingInterface() : |
| 26 | 29 | _entityTree(NULL) |
| @@ -76,10 +79,10 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties · 49 unmodified lines | ||
| 76 | 79 | // This Node is creating a new object. If it's in motion, set this Node as the simulator. |
| 77 | 80 | auto nodeList = DependencyManager::get<NodeList>(); |
| 78 | 81 | const QUuid myNodeID = nodeList->getSessionUUID(); |
| 79 | − propertiesWithSimID.setSimulatorOwnership(myNodeID, SCRIPT_EDIT_SIMULATOR_PRIORITY); | |
| 82 | + propertiesWithSimID.setSimulationOwner(myNodeID, SCRIPT_EDIT_SIMULATOR_PRIORITY); | |
| 80 | 83 | |
| 81 | 84 | // and make note of it now, so we can act on it right away. |
| 82 | − entity->setSimulatorID(propertiesWithSimID.getSimulatorID()); | |
| 85 | + entity->setSimulationOwner(myNodeID, SCRIPT_EDIT_SIMULATOR_PRIORITY); | |
| 83 | 86 | |
| 84 | 87 | entity->setLastBroadcast(usecTimestampNow()); |
| 85 | 88 | } else { |
| @@ -160,11 +163,11 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, EntityItemProperties proper · 74 unmodified lines | ||
| 160 | 163 | // simulation. |
| 161 | 164 | |
| 162 | 165 | // we re-assert our simulation ownership |
| 163 | − properties.setSimulatorOwnership(myNodeID, | |
| 166 | + properties.setSimulationOwner(myNodeID, | |
| 164 | 167 | glm::max(entity->getSimulatorPriority(), SCRIPT_EDIT_SIMULATOR_PRIORITY)); |
| 165 | 168 | } else { |
| 166 | 169 | // we make a bid for simulation ownership |
| 167 | − properties.setSimulatorOwnership(myNodeID, SCRIPT_EDIT_SIMULATOR_PRIORITY); | |
| 170 | + properties.setSimulationOwner(myNodeID, SCRIPT_EDIT_SIMULATOR_PRIORITY); | |
| 168 | 171 | entity->flagForOwnership(); |
| 169 | 172 | } |
| 170 | 173 | } |