mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 21:36:47 +02:00
try different login for deciding when to update/clear simulatorID
This commit is contained in:
parent
a30e807051
commit
4677324a87
1 changed files with 4 additions and 8 deletions
|
@ -191,13 +191,11 @@ bool EntityMotionState::shouldSendUpdate(uint32_t simulationFrame) {
|
||||||
QString myNodeID = nodeList->getSessionUUID().toString();
|
QString myNodeID = nodeList->getSessionUUID().toString();
|
||||||
QString simulatorID = _entity->getSimulatorID();
|
QString simulatorID = _entity->getSimulatorID();
|
||||||
|
|
||||||
if (simulatorID.isEmpty() && _sentMoving) {
|
if (simulatorID.isEmpty() && baseResult) {
|
||||||
// The object is moving and nobody thinks they own the motion. set this Node as the simulator
|
// The object is moving and nobody thinks they own the motion. set this Node as the simulator
|
||||||
// _entity->updateSimulatorID(myNodeID);
|
|
||||||
simulatorID = myNodeID;
|
simulatorID = myNodeID;
|
||||||
} else if (simulatorID == myNodeID && !_sentMoving) {
|
} else if (simulatorID == myNodeID && _numNonMovingUpdates > 0) {
|
||||||
// we are the simulator and the object has stopped. give up "simulator" status
|
// we are the simulator and the object has stopped. give up "simulator" status
|
||||||
// _entity->updateSimulatorID("");
|
|
||||||
simulatorID = "";
|
simulatorID = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,16 +260,14 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, uint32_
|
||||||
|
|
||||||
|
|
||||||
qDebug() << "EntityMotionState::sendUpdate" << _sentMoving << _body->isActive();
|
qDebug() << "EntityMotionState::sendUpdate" << _sentMoving << _body->isActive();
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
QString myNodeID = nodeList->getSessionUUID().toString();
|
QString myNodeID = nodeList->getSessionUUID().toString();
|
||||||
QString simulatorID = _entity->getSimulatorID();
|
QString simulatorID = _entity->getSimulatorID();
|
||||||
|
if (simulatorID.isEmpty()) {
|
||||||
if (simulatorID.isEmpty() && _sentMoving) {
|
|
||||||
// The object is moving and nobody thinks they own the motion. set this Node as the simulator
|
// The object is moving and nobody thinks they own the motion. set this Node as the simulator
|
||||||
_entity->setSimulatorID(myNodeID);
|
_entity->setSimulatorID(myNodeID);
|
||||||
properties.setSimulatorID(myNodeID);
|
properties.setSimulatorID(myNodeID);
|
||||||
} else if (simulatorID == myNodeID && !_sentMoving) {
|
} else if (simulatorID == myNodeID && _numNonMovingUpdates > 0) {
|
||||||
// we are the simulator and the object has stopped. give up "simulator" status
|
// we are the simulator and the object has stopped. give up "simulator" status
|
||||||
_entity->setSimulatorID("");
|
_entity->setSimulatorID("");
|
||||||
properties.setSimulatorID("");
|
properties.setSimulatorID("");
|
||||||
|
|
Loading…
Reference in a new issue