Showing the changes to interface/src/Application.cpp (1 of 6 files). Show all
Unified · Split
| @@ -221,7 +221,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 220 unmodified lines | |||
| 221 | _lastNackTime(usecTimestampNow()), | 221 | _lastNackTime(usecTimestampNow()), |
| 222 | _lastSendDownstreamAudioStats(usecTimestampNow()), | 222 | _lastSendDownstreamAudioStats(usecTimestampNow()), |
| 223 | _isVSyncOn(true), | 223 | _isVSyncOn(true), |
| 224 | _aboutToQuit(false) | 224 | _aboutToQuit(false), |
| 225 | _notifiedPacketVersionMismatchThisDomain(false) | ||
| 225 | { | 226 | { |
| 226 | auto glCanvas = DependencyManager::get<GLCanvas>(); | 227 | auto glCanvas = DependencyManager::get<GLCanvas>(); |
| 227 | auto nodeList = DependencyManager::get<NodeList>(); | 228 | auto nodeList = DependencyManager::get<NodeList>(); |
| @@ -305,6 +306,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 77 unmodified lines | |||
| 305 | connect(nodeList.data(), SIGNAL(nodeKilled(SharedNodePointer)), SLOT(nodeKilled(SharedNodePointer))); | 306 | connect(nodeList.data(), SIGNAL(nodeKilled(SharedNodePointer)), SLOT(nodeKilled(SharedNodePointer))); |
| 306 | connect(nodeList.data(), &NodeList::uuidChanged, _myAvatar, &MyAvatar::setSessionUUID); | 307 | connect(nodeList.data(), &NodeList::uuidChanged, _myAvatar, &MyAvatar::setSessionUUID); |
| 307 | connect(nodeList.data(), &NodeList::limitOfSilentDomainCheckInsReached, nodeList.data(), &NodeList::reset); | 308 | connect(nodeList.data(), &NodeList::limitOfSilentDomainCheckInsReached, nodeList.data(), &NodeList::reset); |
| 309 | connect(nodeList.data(), &NodeList::packetVersionMismatch, this, &Application::notifyPacketVersionMismatch); | ||
| 308 | 310 | ||
| 309 | // connect to appropriate slots on AccountManager | 311 | // connect to appropriate slots on AccountManager |
| 310 | AccountManager& accountManager = AccountManager::getInstance(); | 312 | AccountManager& accountManager = AccountManager::getInstance(); |
| @@ -576,6 +578,7 @@ void Application::initializeGL() { · 265 unmodified lines | |||
| 576 | 578 | ||
| 577 | // create thread for parsing of octee data independent of the main network and rendering threads | 579 | // create thread for parsing of octee data independent of the main network and rendering threads |
| 578 | _octreeProcessor.initialize(_enableProcessOctreeThread); | 580 | _octreeProcessor.initialize(_enableProcessOctreeThread); |
| 581 | connect(&_octreeProcessor, &OctreePacketProcessor::packetVersionMismatch, this, &Application::notifyPacketVersionMismatch); | ||
| 579 | _entityEditSender.initialize(_enableProcessOctreeThread); | 582 | _entityEditSender.initialize(_enableProcessOctreeThread); |
| 580 | 583 | ||
| 581 | // call our timer function every second | 584 | // call our timer function every second |
| @@ -3218,11 +3221,11 @@ void Application::connectedToDomain(const QString& hostname) { · 2636 unmodified lines | |||
| 3218 | 3221 | ||
| 3219 | if (accountManager.isLoggedIn() && !domainID.isNull()) { | 3222 | if (accountManager.isLoggedIn() && !domainID.isNull()) { |
| 3220 | // update our data-server with the domain-server we're logged in with | 3223 | // update our data-server with the domain-server we're logged in with |
| 3221 | |||
| 3222 | QString domainPutJsonString = "{\"location\":{\"domain_id\":\"" + uuidStringWithoutCurlyBraces(domainID) + "\"}}"; | 3224 | QString domainPutJsonString = "{\"location\":{\"domain_id\":\"" + uuidStringWithoutCurlyBraces(domainID) + "\"}}"; |
| 3223 | |||
| 3224 | accountManager.authenticatedRequest("/api/v1/user/location", QNetworkAccessManager::PutOperation, | 3225 | accountManager.authenticatedRequest("/api/v1/user/location", QNetworkAccessManager::PutOperation, |
| 3225 | JSONCallbackParameters(), domainPutJsonString.toUtf8()); | 3226 | JSONCallbackParameters(), domainPutJsonString.toUtf8()); |
| 3227 | |||
| 3228 | _notifiedPacketVersionMismatchThisDomain = false; | ||
| 3226 | } | 3229 | } |
| 3227 | } | 3230 | } |
| 3228 | 3231 | ||
| @@ -3988,3 +3991,18 @@ int Application::getRenderAmbientLight() const { · 759 unmodified lines | |||
| 3988 | return -1; | 3991 | return -1; |
| 3989 | } | 3992 | } |
| 3990 | } | 3993 | } |
| 3994 | |||
| 3995 | void Application::notifyPacketVersionMismatch() { | ||
| 3996 | if (!_notifiedPacketVersionMismatchThisDomain) { | ||
| 3997 | _notifiedPacketVersionMismatchThisDomain = true; | ||
| 3998 | |||
| 3999 | QString message = "The location you are visiting is running an incompatible server version.\n"; | ||
| 4000 | message += "Content may not display properly."; | ||
| 4001 | |||
| 4002 | QMessageBox msgBox; | ||
| 4003 | msgBox.setText(message); | ||
| 4004 | msgBox.setStandardButtons(QMessageBox::Ok); | ||
| 4005 | msgBox.setIcon(QMessageBox::Warning); | ||
| 4006 | msgBox.exec(); | ||
| 4007 | } | ||
| 4008 | } | ||