mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-16 01:59:15 +02:00
fix infinate loading if entity server is not running
This commit is contained in:
parent
6bd08325ec
commit
10d045b11b
4 changed files with 17 additions and 2 deletions
|
@ -5705,6 +5705,7 @@ void Application::update(float deltaTime) {
|
|||
quint64 now = usecTimestampNow();
|
||||
if (isServerlessMode() || _octreeProcessor.isLoadSequenceComplete()) {
|
||||
bool enableInterstitial = DependencyManager::get<NodeList>()->getDomainHandler().getInterstitialModeEnabled();
|
||||
|
||||
if (gpuTextureMemSizeStable() || !enableInterstitial) {
|
||||
// we've received a new full-scene octree stats packet, or it's been long enough to try again anyway
|
||||
_lastPhysicsCheckTime = now;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "SafeLanding.h"
|
||||
|
||||
#include <NodeList.h>
|
||||
#include <SharedUtil.h>
|
||||
|
||||
#include "EntityTreeRenderer.h"
|
||||
|
@ -19,6 +20,8 @@
|
|||
#include "Application.h"
|
||||
|
||||
const int SafeLanding::SEQUENCE_MODULO = std::numeric_limits<OCTREE_PACKET_SEQUENCE>::max() + 1;
|
||||
const quint64 MAX_ELAPSED_TIME = 1000; // msec
|
||||
const quint64 MICRO_TO_MILI_SECONDS = 1000;
|
||||
|
||||
namespace {
|
||||
template<typename T> bool lessThanWraparound(int a, int b) {
|
||||
|
@ -107,7 +110,9 @@ void SafeLanding::noteReceivedsequenceNumber(int sequenceNumber) {
|
|||
}
|
||||
|
||||
bool SafeLanding::isLoadSequenceComplete() {
|
||||
if (isEntityLoadingComplete() && isSequenceNumbersComplete()) {
|
||||
quint64 elapsedTime = (usecTimestampNow() - _startTime) / MICRO_TO_MILI_SECONDS;
|
||||
if ((isEntityLoadingComplete() && isSequenceNumbersComplete()) ||
|
||||
(elapsedTime >= MAX_ELAPSED_TIME && isEntityServerNotRunning() && _sequenceNumbers.empty())) {
|
||||
Locker lock(_lock);
|
||||
_initialStart = INVALID_SEQUENCE;
|
||||
_initialEnd = INVALID_SEQUENCE;
|
||||
|
@ -119,6 +124,14 @@ bool SafeLanding::isLoadSequenceComplete() {
|
|||
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() {
|
||||
Locker lock(_lock);
|
||||
static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15;
|
||||
|
|
|
@ -40,6 +40,7 @@ private:
|
|||
bool isSequenceNumbersComplete();
|
||||
void debugDumpSequenceIDs() const;
|
||||
bool isEntityLoadingComplete();
|
||||
bool isEntityServerNotRunning();
|
||||
|
||||
std::mutex _lock;
|
||||
using Locker = std::lock_guard<std::mutex>;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
(function() {
|
||||
Script.include("/~/system/libraries/Xform.js");
|
||||
Script.include("/~/system/libraries/globals.js");
|
||||
var DEBUG = false;
|
||||
var DEBUG = true;
|
||||
var TOTAL_LOADING_PROGRESS = 3.7;
|
||||
var EPSILON = 0.05;
|
||||
var TEXTURE_EPSILON = 0.01;
|
||||
|
|
Loading…
Reference in a new issue