mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
require two triggers for API refresh, fix check for ICE domain
This commit is contained in:
parent
f59335ceff
commit
e39c708bf6
2 changed files with 9 additions and 5 deletions
|
@ -166,7 +166,8 @@ void DomainHandler::setSocketAndID(const QString& hostname, quint16 port, const
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainHandler::setIceServerHostnameAndID(const QString& iceServerHostname, const QUuid& id) {
|
void DomainHandler::setIceServerHostnameAndID(const QString& iceServerHostname, const QUuid& id) {
|
||||||
if (_iceServerSockAddr.getAddress().toString() != iceServerHostname && id != _pendingDomainID) {
|
|
||||||
|
if (_iceServerSockAddr.getAddress().toString() != iceServerHostname || id != _pendingDomainID) {
|
||||||
// re-set the domain info to connect to new domain
|
// re-set the domain info to connect to new domain
|
||||||
hardReset();
|
hardReset();
|
||||||
|
|
||||||
|
|
|
@ -356,19 +356,22 @@ void NodeList::sendDomainServerCheckIn() {
|
||||||
_numNoReplyDomainCheckIns++;
|
_numNoReplyDomainCheckIns++;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int NUM_NO_REPLY_CHECKINS_BEFORE_API_REFRESH = 2;
|
static int numTriggersSinceAPIRefresh = 0;
|
||||||
|
|
||||||
if (!_publicSockAddr.isNull()
|
if (!_publicSockAddr.isNull()
|
||||||
&& !_domainHandler.isConnected()
|
&& !_domainHandler.isConnected()
|
||||||
&& _numNoReplyDomainCheckIns > NUM_NO_REPLY_CHECKINS_BEFORE_API_REFRESH
|
|
||||||
&& !_domainHandler.getPendingDomainID().isNull()
|
&& !_domainHandler.getPendingDomainID().isNull()
|
||||||
&& !_domainHandler.wasConnectionRefused()) {
|
&& !_domainHandler.wasConnectionRefused()
|
||||||
|
&& ++numTriggersSinceAPIRefresh > 1) {
|
||||||
|
|
||||||
// if we aren't connected to the domain-server, and we have an ID
|
// if we aren't connected to the domain-server, and we have an ID
|
||||||
// (that we presume belongs to a domain in the HF Metaverse)
|
// (that we presume belongs to a domain in the HF Metaverse)
|
||||||
// we request connection information for the domain every so often to make sure what we have is up to date
|
// we re-request connection information from the AdressManager
|
||||||
|
// every 2 failing check in attempts to make sure what we have is up to date
|
||||||
|
|
||||||
DependencyManager::get<AddressManager>()->refreshPreviousLookup();
|
DependencyManager::get<AddressManager>()->refreshPreviousLookup();
|
||||||
|
numTriggersSinceAPIRefresh = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue