Merge pull request #14196 from sethalves/interstitial-domain-full

go to error-room when failing to connect to a full domain
This commit is contained in:
John Conklin II 2018-10-18 17:49:35 -07:00 committed by GitHub
commit 5095a4e0eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View file

@ -140,8 +140,10 @@ void DomainHandler::hardReset() {
} }
bool DomainHandler::isHardRefusal(int reasonCode) { bool DomainHandler::isHardRefusal(int reasonCode) {
return (reasonCode == (int)ConnectionRefusedReason::ProtocolMismatch || reasonCode == (int)ConnectionRefusedReason::NotAuthorized || return (reasonCode == (int)ConnectionRefusedReason::ProtocolMismatch ||
reasonCode == (int)ConnectionRefusedReason::TimedOut); reasonCode == (int)ConnectionRefusedReason::TooManyUsers ||
reasonCode == (int)ConnectionRefusedReason::NotAuthorized ||
reasonCode == (int)ConnectionRefusedReason::TimedOut);
} }
bool DomainHandler::getInterstitialModeEnabled() const { bool DomainHandler::getInterstitialModeEnabled() const {
@ -473,7 +475,7 @@ bool DomainHandler::reasonSuggestsLogin(ConnectionRefusedReason reasonCode) {
case ConnectionRefusedReason::LoginError: case ConnectionRefusedReason::LoginError:
case ConnectionRefusedReason::NotAuthorized: case ConnectionRefusedReason::NotAuthorized:
return true; return true;
default: default:
case ConnectionRefusedReason::Unknown: case ConnectionRefusedReason::Unknown:
case ConnectionRefusedReason::ProtocolMismatch: case ConnectionRefusedReason::ProtocolMismatch:

View file

@ -5,14 +5,20 @@
"Oops! Protocol version mismatch.", "Oops! Protocol version mismatch.",
"Oops! Not authorized to join domain.", "Oops! Not authorized to join domain.",
"Oops! Connection timed out.", "Oops! Connection timed out.",
"Oops! The domain is full.",
"Oops! Something went wrong." "Oops! Something went wrong."
]; ];
var PROTOCOL_VERSION_MISMATCH = 1; var PROTOCOL_VERSION_MISMATCH = 1;
var NOT_AUTHORIZED = 3; var NOT_AUTHORIZED = 3;
var DOMAIN_FULL = 4;
var TIMEOUT = 5; var TIMEOUT = 5;
var hardRefusalErrors = [PROTOCOL_VERSION_MISMATCH, var hardRefusalErrors = [
NOT_AUTHORIZED, TIMEOUT]; PROTOCOL_VERSION_MISMATCH,
NOT_AUTHORIZED,
TIMEOUT,
DOMAIN_FULL
];
var timer = null; var timer = null;
var isErrorState = false; var isErrorState = false;
@ -26,7 +32,7 @@
return ERROR_MESSAGE_MAP[errorMessageMapIndex]; return ERROR_MESSAGE_MAP[errorMessageMapIndex];
} else { } else {
// some other text. // some other text.
return ERROR_MESSAGE_MAP[4]; return ERROR_MESSAGE_MAP[ERROR_MESSAGE_MAP.length - 1];
} }
}; };