mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-22 17:03:18 +02:00
Merge pull request #4210 from ctrlaltdavid/20280
CR for Job #20280 - Warn if Interface and Stack have incompatible build level
This commit is contained in:
commit
79b04afaf8
6 changed files with 35 additions and 4 deletions
|
@ -251,7 +251,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
_lastNackTime(usecTimestampNow()),
|
_lastNackTime(usecTimestampNow()),
|
||||||
_lastSendDownstreamAudioStats(usecTimestampNow()),
|
_lastSendDownstreamAudioStats(usecTimestampNow()),
|
||||||
_isVSyncOn(true),
|
_isVSyncOn(true),
|
||||||
_aboutToQuit(false)
|
_aboutToQuit(false),
|
||||||
|
_notifiedPacketVersionMismatchThisDomain(false)
|
||||||
{
|
{
|
||||||
_logger = new FileLogger(this); // After setting organization name in order to get correct directory
|
_logger = new FileLogger(this); // After setting organization name in order to get correct directory
|
||||||
qInstallMessageHandler(messageHandler);
|
qInstallMessageHandler(messageHandler);
|
||||||
|
@ -323,6 +324,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
connect(nodeList.data(), SIGNAL(nodeKilled(SharedNodePointer)), SLOT(nodeKilled(SharedNodePointer)));
|
connect(nodeList.data(), SIGNAL(nodeKilled(SharedNodePointer)), SLOT(nodeKilled(SharedNodePointer)));
|
||||||
connect(nodeList.data(), &NodeList::uuidChanged, _myAvatar, &MyAvatar::setSessionUUID);
|
connect(nodeList.data(), &NodeList::uuidChanged, _myAvatar, &MyAvatar::setSessionUUID);
|
||||||
connect(nodeList.data(), &NodeList::limitOfSilentDomainCheckInsReached, nodeList.data(), &NodeList::reset);
|
connect(nodeList.data(), &NodeList::limitOfSilentDomainCheckInsReached, nodeList.data(), &NodeList::reset);
|
||||||
|
connect(nodeList.data(), &NodeList::packetVersionMismatch, this, &Application::notifyPacketVersionMismatch);
|
||||||
|
|
||||||
// connect to appropriate slots on AccountManager
|
// connect to appropriate slots on AccountManager
|
||||||
AccountManager& accountManager = AccountManager::getInstance();
|
AccountManager& accountManager = AccountManager::getInstance();
|
||||||
|
@ -568,6 +570,7 @@ void Application::initializeGL() {
|
||||||
|
|
||||||
// create thread for parsing of octee data independent of the main network and rendering threads
|
// create thread for parsing of octee data independent of the main network and rendering threads
|
||||||
_octreeProcessor.initialize(_enableProcessOctreeThread);
|
_octreeProcessor.initialize(_enableProcessOctreeThread);
|
||||||
|
connect(&_octreeProcessor, &OctreePacketProcessor::packetVersionMismatch, this, &Application::notifyPacketVersionMismatch);
|
||||||
_entityEditSender.initialize(_enableProcessOctreeThread);
|
_entityEditSender.initialize(_enableProcessOctreeThread);
|
||||||
|
|
||||||
// call our timer function every second
|
// call our timer function every second
|
||||||
|
@ -3194,11 +3197,11 @@ void Application::connectedToDomain(const QString& hostname) {
|
||||||
|
|
||||||
if (accountManager.isLoggedIn() && !domainID.isNull()) {
|
if (accountManager.isLoggedIn() && !domainID.isNull()) {
|
||||||
// update our data-server with the domain-server we're logged in with
|
// update our data-server with the domain-server we're logged in with
|
||||||
|
|
||||||
QString domainPutJsonString = "{\"location\":{\"domain_id\":\"" + uuidStringWithoutCurlyBraces(domainID) + "\"}}";
|
QString domainPutJsonString = "{\"location\":{\"domain_id\":\"" + uuidStringWithoutCurlyBraces(domainID) + "\"}}";
|
||||||
|
|
||||||
accountManager.authenticatedRequest("/api/v1/user/location", QNetworkAccessManager::PutOperation,
|
accountManager.authenticatedRequest("/api/v1/user/location", QNetworkAccessManager::PutOperation,
|
||||||
JSONCallbackParameters(), domainPutJsonString.toUtf8());
|
JSONCallbackParameters(), domainPutJsonString.toUtf8());
|
||||||
|
|
||||||
|
_notifiedPacketVersionMismatchThisDomain = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3964,3 +3967,18 @@ int Application::getRenderAmbientLight() const {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Application::notifyPacketVersionMismatch() {
|
||||||
|
if (!_notifiedPacketVersionMismatchThisDomain) {
|
||||||
|
_notifiedPacketVersionMismatchThisDomain = true;
|
||||||
|
|
||||||
|
QString message = "The location you are visiting is running an incompatible server version.\n";
|
||||||
|
message += "Content may not display properly.";
|
||||||
|
|
||||||
|
QMessageBox msgBox;
|
||||||
|
msgBox.setText(message);
|
||||||
|
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||||
|
msgBox.setIcon(QMessageBox::Warning);
|
||||||
|
msgBox.exec();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -362,6 +362,8 @@ public slots:
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
void saveSettings();
|
void saveSettings();
|
||||||
|
|
||||||
|
void notifyPacketVersionMismatch();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void clearDomainOctreeDetails();
|
void clearDomainOctreeDetails();
|
||||||
void timer();
|
void timer();
|
||||||
|
@ -576,6 +578,8 @@ private:
|
||||||
bool _aboutToQuit;
|
bool _aboutToQuit;
|
||||||
|
|
||||||
Bookmarks* _bookmarks;
|
Bookmarks* _bookmarks;
|
||||||
|
|
||||||
|
bool _notifiedPacketVersionMismatchThisDomain;
|
||||||
|
|
||||||
QThread _settingsThread;
|
QThread _settingsThread;
|
||||||
QTimer _settingsTimer;
|
QTimer _settingsTimer;
|
||||||
|
|
|
@ -68,11 +68,12 @@ void OctreePacketProcessor::processPacket(const SharedNodePointer& sendingNode,
|
||||||
<< senderUUID << "sent" << (int)packetVersion << "but"
|
<< senderUUID << "sent" << (int)packetVersion << "but"
|
||||||
<< (int)expectedVersion << "expected.";
|
<< (int)expectedVersion << "expected.";
|
||||||
|
|
||||||
|
emit packetVersionMismatch();
|
||||||
|
|
||||||
versionDebugSuppressMap.insert(senderUUID, voxelPacketType);
|
versionDebugSuppressMap.insert(senderUUID, voxelPacketType);
|
||||||
}
|
}
|
||||||
return; // bail since piggyback version doesn't match
|
return; // bail since piggyback version doesn't match
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
app->trackIncomingOctreePacket(mutablePacket, sendingNode, wasStatsPacket);
|
app->trackIncomingOctreePacket(mutablePacket, sendingNode, wasStatsPacket);
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,10 @@
|
||||||
/// the user is responsible for reading inbound packets and adding them to the processing queue by calling queueReceivedPacket()
|
/// the user is responsible for reading inbound packets and adding them to the processing queue by calling queueReceivedPacket()
|
||||||
class OctreePacketProcessor : public ReceivedPacketProcessor {
|
class OctreePacketProcessor : public ReceivedPacketProcessor {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void packetVersionMismatch();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void processPacket(const SharedNodePointer& sendingNode, const QByteArray& packet);
|
virtual void processPacket(const SharedNodePointer& sendingNode, const QByteArray& packet);
|
||||||
};
|
};
|
||||||
|
|
|
@ -167,6 +167,8 @@ bool LimitedNodeList::packetVersionAndHashMatch(const QByteArray& packet) {
|
||||||
qDebug() << "Packet version mismatch on" << packetTypeForPacket(packet) << "- Sender"
|
qDebug() << "Packet version mismatch on" << packetTypeForPacket(packet) << "- Sender"
|
||||||
<< uuidFromPacketHeader(packet) << "sent" << qPrintable(QString::number(packet[numPacketTypeBytes])) << "but"
|
<< uuidFromPacketHeader(packet) << "sent" << qPrintable(QString::number(packet[numPacketTypeBytes])) << "but"
|
||||||
<< qPrintable(QString::number(versionForPacketType(mismatchType))) << "expected.";
|
<< qPrintable(QString::number(versionForPacketType(mismatchType))) << "expected.";
|
||||||
|
|
||||||
|
emit packetVersionMismatch();
|
||||||
|
|
||||||
versionDebugSuppressMap.insert(senderUUID, checkType);
|
versionDebugSuppressMap.insert(senderUUID, checkType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,6 +185,8 @@ signals:
|
||||||
|
|
||||||
void dataSent(const quint8 channel_type, const int bytes);
|
void dataSent(const quint8 channel_type, const int bytes);
|
||||||
void dataReceived(const quint8 channel_type, const int bytes);
|
void dataReceived(const quint8 channel_type, const int bytes);
|
||||||
|
|
||||||
|
void packetVersionMismatch();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LimitedNodeList(unsigned short socketListenPort = 0, unsigned short dtlsListenPort = 0);
|
LimitedNodeList(unsigned short socketListenPort = 0, unsigned short dtlsListenPort = 0);
|
||||||
|
|
Loading…
Reference in a new issue