mirror of
https://github.com/overte-org/overte.git
synced 2025-07-15 20:56:37 +02:00
Merge pull request #6989 from ctrlaltdavid/20796
Restart at last location after crash
This commit is contained in:
commit
ef380ca38c
3 changed files with 9 additions and 3 deletions
|
@ -540,14 +540,14 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
||||||
connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle()));
|
connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle()));
|
||||||
connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(clearDomainOctreeDetails()));
|
connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(clearDomainOctreeDetails()));
|
||||||
connect(&domainHandler, &DomainHandler::settingsReceived, this, &Application::domainSettingsReceived);
|
connect(&domainHandler, &DomainHandler::settingsReceived, this, &Application::domainSettingsReceived);
|
||||||
connect(&domainHandler, &DomainHandler::hostnameChanged,
|
|
||||||
DependencyManager::get<AddressManager>().data(), &AddressManager::storeCurrentAddress);
|
|
||||||
|
|
||||||
// update our location every 5 seconds in the metaverse server, assuming that we are authenticated with one
|
// update our location every 5 seconds in the metaverse server, assuming that we are authenticated with one
|
||||||
const qint64 DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS = 5 * 1000;
|
const qint64 DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS = 5 * 1000;
|
||||||
|
|
||||||
auto discoverabilityManager = DependencyManager::get<DiscoverabilityManager>();
|
auto discoverabilityManager = DependencyManager::get<DiscoverabilityManager>();
|
||||||
connect(&locationUpdateTimer, &QTimer::timeout, discoverabilityManager.data(), &DiscoverabilityManager::updateLocation);
|
connect(&locationUpdateTimer, &QTimer::timeout, discoverabilityManager.data(), &DiscoverabilityManager::updateLocation);
|
||||||
|
connect(&locationUpdateTimer, &QTimer::timeout,
|
||||||
|
DependencyManager::get<AddressManager>().data(), &AddressManager::storeCurrentAddress);
|
||||||
locationUpdateTimer.start(DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS);
|
locationUpdateTimer.start(DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS);
|
||||||
|
|
||||||
// if we get a domain change, immediately attempt update location in metaverse server
|
// if we get a domain change, immediately attempt update location in metaverse server
|
||||||
|
@ -590,6 +590,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
||||||
|
|
||||||
connect(addressManager.data(), &AddressManager::hostChanged, this, &Application::updateWindowTitle);
|
connect(addressManager.data(), &AddressManager::hostChanged, this, &Application::updateWindowTitle);
|
||||||
connect(this, &QCoreApplication::aboutToQuit, addressManager.data(), &AddressManager::storeCurrentAddress);
|
connect(this, &QCoreApplication::aboutToQuit, addressManager.data(), &AddressManager::storeCurrentAddress);
|
||||||
|
|
||||||
|
// Save avatar location immediately after a teleport.
|
||||||
|
connect(getMyAvatar(), &MyAvatar::positionGoneTo,
|
||||||
|
DependencyManager::get<AddressManager>().data(), &AddressManager::storeCurrentAddress);
|
||||||
|
|
||||||
auto scriptEngines = DependencyManager::get<ScriptEngines>().data();
|
auto scriptEngines = DependencyManager::get<ScriptEngines>().data();
|
||||||
scriptEngines->registerScriptInitializer([this](ScriptEngine* engine){
|
scriptEngines->registerScriptInitializer([this](ScriptEngine* engine){
|
||||||
|
|
|
@ -285,6 +285,7 @@ void MyAvatar::update(float deltaTime) {
|
||||||
// However, render/MyAvatar::update/Application::update don't always match (e.g., when using the separate avatar update thread),
|
// However, render/MyAvatar::update/Application::update don't always match (e.g., when using the separate avatar update thread),
|
||||||
// so we update now. It's ok if it updates again in the normal way.
|
// so we update now. It's ok if it updates again in the normal way.
|
||||||
updateSensorToWorldMatrix();
|
updateSensorToWorldMatrix();
|
||||||
|
emit positionGoneTo();
|
||||||
}
|
}
|
||||||
|
|
||||||
Head* head = getHead();
|
Head* head = getHead();
|
||||||
|
@ -1629,7 +1630,7 @@ void MyAvatar::decreaseSize() {
|
||||||
|
|
||||||
void MyAvatar::resetSize() {
|
void MyAvatar::resetSize() {
|
||||||
_targetScale = 1.0f;
|
_targetScale = 1.0f;
|
||||||
qCDebug(interfaceapp, "Reseted scale to %f", (double)_targetScale);
|
qCDebug(interfaceapp, "Reset scale to %f", (double)_targetScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::goToLocation(const glm::vec3& newPosition,
|
void MyAvatar::goToLocation(const glm::vec3& newPosition,
|
||||||
|
|
|
@ -272,6 +272,7 @@ signals:
|
||||||
void transformChanged();
|
void transformChanged();
|
||||||
void newCollisionSoundURL(const QUrl& url);
|
void newCollisionSoundURL(const QUrl& url);
|
||||||
void collisionWithEntity(const Collision& collision);
|
void collisionWithEntity(const Collision& collision);
|
||||||
|
void positionGoneTo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue