mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 04:13:11 +02:00
entity server timout
This commit is contained in:
parent
812373cdab
commit
20ad05726e
5 changed files with 31 additions and 17 deletions
|
@ -56,7 +56,7 @@ StackView {
|
||||||
Qt.callLater(function() {
|
Qt.callLater(function() {
|
||||||
addressBarDialog.keyboardEnabled = HMD.active;
|
addressBarDialog.keyboardEnabled = HMD.active;
|
||||||
addressLine.forceActiveFocus();
|
addressLine.forceActiveFocus();
|
||||||
addressBarDialog.raised = true;
|
addressBarDialog.keyboardRaised = true;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -371,6 +371,8 @@ static const QString INFO_HELP_PATH = "html/tabletHelp.html";
|
||||||
|
|
||||||
static const unsigned int THROTTLED_SIM_FRAMERATE = 15;
|
static const unsigned int THROTTLED_SIM_FRAMERATE = 15;
|
||||||
static const int THROTTLED_SIM_FRAME_PERIOD_MS = MSECS_PER_SECOND / THROTTLED_SIM_FRAMERATE;
|
static const int THROTTLED_SIM_FRAME_PERIOD_MS = MSECS_PER_SECOND / THROTTLED_SIM_FRAMERATE;
|
||||||
|
static const int ENTITY_SERVER_ADDED_TIMEOUT = 5000;
|
||||||
|
static const int ENTITY_SERVER_CONNECTION_TIMEOUT = 5000;
|
||||||
|
|
||||||
static const uint32_t INVALID_FRAME = UINT32_MAX;
|
static const uint32_t INVALID_FRAME = UINT32_MAX;
|
||||||
|
|
||||||
|
@ -1224,6 +1226,18 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
getOverlays().deleteOverlay(getTabletScreenID());
|
getOverlays().deleteOverlay(getTabletScreenID());
|
||||||
getOverlays().deleteOverlay(getTabletHomeButtonID());
|
getOverlays().deleteOverlay(getTabletHomeButtonID());
|
||||||
getOverlays().deleteOverlay(getTabletFrameID());
|
getOverlays().deleteOverlay(getTabletFrameID());
|
||||||
|
_failedToConnectToEntityServer = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
_entityServerConnectionTimer.setSingleShot(true);
|
||||||
|
connect(&_entityServerConnectionTimer, &QTimer::timeout, this, &Application::setFailedToConnectToEntityServer);
|
||||||
|
|
||||||
|
connect(&domainHandler, &DomainHandler::connectedToDomain, this, [this]() {
|
||||||
|
if (!isServerlessMode()) {
|
||||||
|
_entityServerConnectionTimer.setInterval(ENTITY_SERVER_ADDED_TIMEOUT);
|
||||||
|
_entityServerConnectionTimer.start();
|
||||||
|
_failedToConnectToEntityServer = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
connect(&domainHandler, &DomainHandler::domainConnectionRefused, this, &Application::domainConnectionRefused);
|
connect(&domainHandler, &DomainHandler::domainConnectionRefused, this, &Application::domainConnectionRefused);
|
||||||
|
|
||||||
|
@ -6630,7 +6644,13 @@ void Application::resettingDomain() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::nodeAdded(SharedNodePointer node) const {
|
void Application::nodeAdded(SharedNodePointer node) const {
|
||||||
// nothing to do here
|
if (node->getType() == NodeType::EntityServer) {
|
||||||
|
if (!_failedToConnectToEntityServer) {
|
||||||
|
_entityServerConnectionTimer.stop();
|
||||||
|
_entityServerConnectionTimer.setInterval(ENTITY_SERVER_CONNECTION_TIMEOUT);
|
||||||
|
_entityServerConnectionTimer.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::nodeActivated(SharedNodePointer node) {
|
void Application::nodeActivated(SharedNodePointer node) {
|
||||||
|
@ -6658,6 +6678,10 @@ void Application::nodeActivated(SharedNodePointer node) {
|
||||||
if (node->getType() == NodeType::EntityServer) {
|
if (node->getType() == NodeType::EntityServer) {
|
||||||
_queryExpiry = SteadyClock::now();
|
_queryExpiry = SteadyClock::now();
|
||||||
_octreeQuery.incrementConnectionID();
|
_octreeQuery.incrementConnectionID();
|
||||||
|
|
||||||
|
if (!_failedToConnectToEntityServer) {
|
||||||
|
_entityServerConnectionTimer.stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node->getType() == NodeType::AudioMixer && !isInterstitialMode()) {
|
if (node->getType() == NodeType::AudioMixer && !isInterstitialMode()) {
|
||||||
|
|
|
@ -307,6 +307,7 @@ public:
|
||||||
|
|
||||||
bool isServerlessMode() const;
|
bool isServerlessMode() const;
|
||||||
bool isInterstitialMode() const { return _interstitialMode; }
|
bool isInterstitialMode() const { return _interstitialMode; }
|
||||||
|
bool failedToConnectToEntityServer() const { return _failedToConnectToEntityServer; }
|
||||||
|
|
||||||
void replaceDomainContent(const QString& url);
|
void replaceDomainContent(const QString& url);
|
||||||
|
|
||||||
|
@ -460,6 +461,7 @@ private slots:
|
||||||
|
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
void saveSettings() const;
|
void saveSettings() const;
|
||||||
|
void setFailedToConnectToEntityServer() { _failedToConnectToEntityServer = true; }
|
||||||
|
|
||||||
bool acceptSnapshot(const QString& urlString);
|
bool acceptSnapshot(const QString& urlString);
|
||||||
bool askToSetAvatarUrl(const QString& url);
|
bool askToSetAvatarUrl(const QString& url);
|
||||||
|
@ -710,6 +712,7 @@ private:
|
||||||
bool _isForeground = true; // starts out assumed to be in foreground
|
bool _isForeground = true; // starts out assumed to be in foreground
|
||||||
bool _isGLInitialized { false };
|
bool _isGLInitialized { false };
|
||||||
bool _physicsEnabled { false };
|
bool _physicsEnabled { false };
|
||||||
|
bool _failedToConnectToEntityServer { false };
|
||||||
|
|
||||||
bool _reticleClickPressed { false };
|
bool _reticleClickPressed { false };
|
||||||
|
|
||||||
|
@ -756,6 +759,7 @@ private:
|
||||||
QStringList _addAssetToWorldInfoMessages; // Info message
|
QStringList _addAssetToWorldInfoMessages; // Info message
|
||||||
QTimer _addAssetToWorldInfoTimer;
|
QTimer _addAssetToWorldInfoTimer;
|
||||||
QTimer _addAssetToWorldErrorTimer;
|
QTimer _addAssetToWorldErrorTimer;
|
||||||
|
mutable QTimer _entityServerConnectionTimer;
|
||||||
|
|
||||||
FileScriptingInterface* _fileDownload;
|
FileScriptingInterface* _fileDownload;
|
||||||
AudioInjectorPointer _snapshotSoundInjector;
|
AudioInjectorPointer _snapshotSoundInjector;
|
||||||
|
|
|
@ -11,9 +11,7 @@
|
||||||
|
|
||||||
#include "SafeLanding.h"
|
#include "SafeLanding.h"
|
||||||
|
|
||||||
#include <NodeList.h>
|
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
#include <NumericalConstants.h>
|
|
||||||
|
|
||||||
#include "EntityTreeRenderer.h"
|
#include "EntityTreeRenderer.h"
|
||||||
#include "RenderableModelEntityItem.h"
|
#include "RenderableModelEntityItem.h"
|
||||||
|
@ -21,7 +19,6 @@
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
const int SafeLanding::SEQUENCE_MODULO = std::numeric_limits<OCTREE_PACKET_SEQUENCE>::max() + 1;
|
const int SafeLanding::SEQUENCE_MODULO = std::numeric_limits<OCTREE_PACKET_SEQUENCE>::max() + 1;
|
||||||
const quint64 MAX_ELAPSED_TIME = 1000; // msec
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template<typename T> bool lessThanWraparound(int a, int b) {
|
template<typename T> bool lessThanWraparound(int a, int b) {
|
||||||
|
@ -110,9 +107,7 @@ void SafeLanding::noteReceivedsequenceNumber(int sequenceNumber) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SafeLanding::isLoadSequenceComplete() {
|
bool SafeLanding::isLoadSequenceComplete() {
|
||||||
quint64 elapsedTime = (usecTimestampNow() - _startTime) / USECS_PER_MSEC;
|
if ((isEntityLoadingComplete() && isSequenceNumbersComplete()) || qApp->failedToConnectToEntityServer()) {
|
||||||
if ((isEntityLoadingComplete() && isSequenceNumbersComplete()) ||
|
|
||||||
(elapsedTime >= MAX_ELAPSED_TIME && isEntityServerNotRunning() && _sequenceNumbers.empty())) {
|
|
||||||
Locker lock(_lock);
|
Locker lock(_lock);
|
||||||
_initialStart = INVALID_SEQUENCE;
|
_initialStart = INVALID_SEQUENCE;
|
||||||
_initialEnd = INVALID_SEQUENCE;
|
_initialEnd = INVALID_SEQUENCE;
|
||||||
|
@ -124,14 +119,6 @@ bool SafeLanding::isLoadSequenceComplete() {
|
||||||
return !_trackingEntities;
|
return !_trackingEntities;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SafeLanding::isEntityServerNotRunning() {
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
|
||||||
const auto& domainHandler = nodeList->getDomainHandler();
|
|
||||||
auto entityServer = nodeList->soloNodeOfType(NodeType::EntityServer);
|
|
||||||
|
|
||||||
return (domainHandler.isConnected() && !entityServer);
|
|
||||||
}
|
|
||||||
|
|
||||||
float SafeLanding::loadingProgressPercentage() {
|
float SafeLanding::loadingProgressPercentage() {
|
||||||
Locker lock(_lock);
|
Locker lock(_lock);
|
||||||
static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15;
|
static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15;
|
||||||
|
|
|
@ -40,7 +40,6 @@ private:
|
||||||
bool isSequenceNumbersComplete();
|
bool isSequenceNumbersComplete();
|
||||||
void debugDumpSequenceIDs() const;
|
void debugDumpSequenceIDs() const;
|
||||||
bool isEntityLoadingComplete();
|
bool isEntityLoadingComplete();
|
||||||
bool isEntityServerNotRunning();
|
|
||||||
|
|
||||||
std::mutex _lock;
|
std::mutex _lock;
|
||||||
using Locker = std::lock_guard<std::mutex>;
|
using Locker = std::lock_guard<std::mutex>;
|
||||||
|
|
Loading…
Reference in a new issue