pop up warning if domain over capacity

This commit is contained in:
Brad Hefta-Gaub 2016-05-24 16:07:57 -07:00
parent 5668db9e4a
commit 183f38e4f0
2 changed files with 16 additions and 4 deletions

View file

@ -1065,8 +1065,20 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
}
void Application::domainConnectionRefused(const QString& reasonMessage, int reasonCode) {
if (static_cast<DomainHandler::ConnectionRefusedReason>(reasonCode) == DomainHandler::ConnectionRefusedReason::ProtocolMismatch) {
notifyPacketVersionMismatch();
switch (static_cast<DomainHandler::ConnectionRefusedReason>(reasonCode)) {
case DomainHandler::ConnectionRefusedReason::ProtocolMismatch:
notifyPacketVersionMismatch();
break;
case DomainHandler::ConnectionRefusedReason::TooManyUsers:
case DomainHandler::ConnectionRefusedReason::Unknown: {
QString message = "Unable to connect to the location you are visiting.\n";
message += reasonMessage;
OffscreenUi::warning("", message);
break;
}
default:
// nothing to do.
break;
}
}