mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 18:36:45 +02:00
put DomainServerCheckIn on NodeList thread
This commit is contained in:
parent
024dfbf8b7
commit
f1e8343b30
2 changed files with 3 additions and 16 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,12 +292,6 @@ void NodeList::addSetOfNodeTypesToNodeInterestSet(const NodeSet& setOfNodeTypes)
|
||||||
|
|
||||||
void NodeList::sendDomainServerCheckIn() {
|
void NodeList::sendDomainServerCheckIn() {
|
||||||
|
|
||||||
// This function is called by the server check-in timer thread
|
|
||||||
// not the NodeList thread. Calling it on the NodeList thread
|
|
||||||
// resulted in starvation of the server check-in function.
|
|
||||||
// be VERY CAREFUL modifying this code as members of NodeList
|
|
||||||
// may be called by multiple threads.
|
|
||||||
|
|
||||||
if (!_sendDomainServerCheckInEnabled) {
|
if (!_sendDomainServerCheckInEnabled) {
|
||||||
qCDebug(networking_ice) << "Refusing to send a domain-server check in while it is disabled.";
|
qCDebug(networking_ice) << "Refusing to send a domain-server check in while it is disabled.";
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue