mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 19:16:56 +02:00
Merge pull request #15582 from howard-stearns/put-DomainServerCheckIn-on-NodeList-thread
put DomainServerCheckIn on NodeList thread
This commit is contained in:
commit
5fbb788492
2 changed files with 5 additions and 11 deletions
|
@ -1190,13 +1190,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
|
|
||||||
// setup a timer for domain-server check ins
|
// setup a timer for domain-server check ins
|
||||||
QTimer* domainCheckInTimer = new QTimer(this);
|
QTimer* domainCheckInTimer = new QTimer(this);
|
||||||
QWeakPointer<NodeList> nodeListWeak = nodeList;
|
connect(domainCheckInTimer, &QTimer::timeout, nodeList.data(), &NodeList::sendDomainServerCheckIn);
|
||||||
connect(domainCheckInTimer, &QTimer::timeout, [this, nodeListWeak] {
|
|
||||||
auto nodeList = nodeListWeak.lock();
|
|
||||||
if (!isServerlessMode() && nodeList) {
|
|
||||||
nodeList->sendDomainServerCheckIn();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
domainCheckInTimer->start(DOMAIN_SERVER_CHECK_IN_MSECS);
|
domainCheckInTimer->start(DOMAIN_SERVER_CHECK_IN_MSECS);
|
||||||
connect(this, &QCoreApplication::aboutToQuit, [domainCheckInTimer] {
|
connect(this, &QCoreApplication::aboutToQuit, [domainCheckInTimer] {
|
||||||
domainCheckInTimer->stop();
|
domainCheckInTimer->stop();
|
||||||
|
@ -3886,6 +3880,7 @@ void Application::setIsInterstitialMode(bool interstitialMode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::setIsServerlessMode(bool serverlessDomain) {
|
void Application::setIsServerlessMode(bool serverlessDomain) {
|
||||||
|
DependencyManager::get<NodeList>()->setSendDomainServerCheckInEnabled(!serverlessDomain);
|
||||||
auto tree = getEntities()->getTree();
|
auto tree = getEntities()->getTree();
|
||||||
if (tree) {
|
if (tree) {
|
||||||
tree->setIsServerlessMode(serverlessDomain);
|
tree->setIsServerlessMode(serverlessDomain);
|
||||||
|
@ -5439,9 +5434,7 @@ void Application::init() {
|
||||||
qCDebug(interfaceapp) << "Loaded settings";
|
qCDebug(interfaceapp) << "Loaded settings";
|
||||||
|
|
||||||
// fire off an immediate domain-server check in now that settings are loaded
|
// fire off an immediate domain-server check in now that settings are loaded
|
||||||
if (!isServerlessMode()) {
|
QMetaObject::invokeMethod(DependencyManager::get<NodeList>().data(), "sendDomainServerCheckIn");
|
||||||
DependencyManager::get<NodeList>()->sendDomainServerCheckIn();
|
|
||||||
}
|
|
||||||
|
|
||||||
// This allows collision to be set up properly for shape entities supported by GeometryCache.
|
// This allows collision to be set up properly for shape entities supported by GeometryCache.
|
||||||
// This is before entity setup to ensure that it's ready for whenever instance collision is initialized.
|
// This is before entity setup to ensure that it's ready for whenever instance collision is initialized.
|
||||||
|
|
|
@ -292,7 +292,8 @@ void NodeList::addSetOfNodeTypesToNodeInterestSet(const NodeSet& setOfNodeTypes)
|
||||||
|
|
||||||
void NodeList::sendDomainServerCheckIn() {
|
void NodeList::sendDomainServerCheckIn() {
|
||||||
|
|
||||||
// This function is called by the server check-in timer thread
|
// On ThreadedAssignments (assignment clients), this function
|
||||||
|
// is called by the server check-in timer thread
|
||||||
// not the NodeList thread. Calling it on the NodeList thread
|
// not the NodeList thread. Calling it on the NodeList thread
|
||||||
// resulted in starvation of the server check-in function.
|
// resulted in starvation of the server check-in function.
|
||||||
// be VERY CAREFUL modifying this code as members of NodeList
|
// be VERY CAREFUL modifying this code as members of NodeList
|
||||||
|
|
Loading…
Reference in a new issue