mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge pull request #8067 from birarda/api-recheck-on-fail
only signal once on a protocol mismatch with DS
This commit is contained in:
commit
0236af8bcd
2 changed files with 22 additions and 4 deletions
|
@ -118,6 +118,8 @@ void DomainHandler::hardReset() {
|
|||
_hostname = QString();
|
||||
_sockAddr.clear();
|
||||
|
||||
_hasSignalledProtocolMismatch = false;
|
||||
|
||||
_hasCheckedForAccessToken = false;
|
||||
|
||||
// clear any pending path we may have wanted to ask the previous DS about
|
||||
|
@ -405,9 +407,24 @@ void DomainHandler::processDomainServerConnectionDeniedPacket(QSharedPointer<Rec
|
|||
// and check and signal for an access token so that we can make sure they are logged in
|
||||
qCWarning(networking) << "The domain-server denied a connection request: " << reasonMessage;
|
||||
|
||||
if (!_domainConnectionRefusals.contains(reasonMessage)) {
|
||||
_domainConnectionRefusals.append(reasonMessage);
|
||||
emit domainConnectionRefused(reasonMessage, (int)reasonCode);
|
||||
if (!_domainConnectionRefusals.contains(reasonCode)) {
|
||||
_domainConnectionRefusals.append(reasonCode);
|
||||
|
||||
bool shouldSignal = true;
|
||||
|
||||
// only signal once for a protocol mismatch, even between soft resets that will reset the _domainConnectionRefusals
|
||||
if (reasonCode == ConnectionRefusedReason::ProtocolMismatch) {
|
||||
if (_hasSignalledProtocolMismatch) {
|
||||
shouldSignal = false;
|
||||
} else {
|
||||
_hasSignalledProtocolMismatch = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldSignal) {
|
||||
emit domainConnectionRefused(reasonMessage, (int)reasonCode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
|
|
|
@ -144,7 +144,8 @@ private:
|
|||
QString _pendingPath;
|
||||
QTimer _settingsTimer;
|
||||
|
||||
QStringList _domainConnectionRefusals;
|
||||
QList<ConnectionRefusedReason> _domainConnectionRefusals;
|
||||
bool _hasSignalledProtocolMismatch { false };
|
||||
bool _hasCheckedForAccessToken { false };
|
||||
int _connectionDenialsSinceKeypairRegen { 0 };
|
||||
|
||||
|
|
Loading…
Reference in a new issue