Refuse to stream if Moonlight is known incompatible with the host GFE version

This commit is contained in:
Cameron Gutman
2021-04-30 20:05:38 -05:00
parent b50e5ed7e6
commit 2fbb320539
11 changed files with 164 additions and 3 deletions

View File

@@ -146,7 +146,8 @@ private:
ComputerManager::ComputerManager(QObject *parent)
: QObject(parent),
m_PollingRef(0),
m_MdnsBrowser(nullptr)
m_MdnsBrowser(nullptr),
m_CompatFetcher(nullptr)
{
QSettings settings;
@@ -159,6 +160,9 @@ ComputerManager::ComputerManager(QObject *parent)
}
settings.endArray();
// Fetch latest compatibility data asynchronously
m_CompatFetcher.start();
// To quit in a timely manner, we must block additional requests
// after we receive the aboutToQuit() signal. This is neccessary
// because NvHTTP uses aboutToQuit() to abort requests in progres

View File

@@ -2,6 +2,7 @@
#include "nvcomputer.h"
#include "nvpairingmanager.h"
#include "settings/compatfetcher.h"
#include <qmdnsengine/server.h>
#include <qmdnsengine/cache.h>
@@ -214,4 +215,5 @@ private:
QMdnsEngine::Browser* m_MdnsBrowser;
QMdnsEngine::Cache m_MdnsCache;
QVector<MdnsPendingComputer*> m_PendingResolution;
CompatFetcher m_CompatFetcher;
};

View File

@@ -1,5 +1,6 @@
#include "nvcomputer.h"
#include "nvapp.h"
#include "settings/compatfetcher.h"
#include <QUdpSocket>
#include <QHostInfo>
@@ -50,6 +51,7 @@ NvComputer::NvComputer(QSettings& settings)
this->serverCodecModeSupport = 0;
this->pendingQuit = false;
this->gpuModel = nullptr;
this->isSupportedServerVersion = true;
}
void NvComputer::serialize(QSettings& settings) const
@@ -143,6 +145,7 @@ NvComputer::NvComputer(QString address, QString serverInfo, QSslCertificate serv
this->activeAddress = address;
this->state = NvComputer::CS_ONLINE;
this->pendingQuit = false;
this->isSupportedServerVersion = CompatFetcher::isGfeVersionSupported(this->gfeVersion);
}
bool NvComputer::wake()
@@ -408,6 +411,7 @@ bool NvComputer::update(NvComputer& that)
ASSIGN_IF_CHANGED(state);
ASSIGN_IF_CHANGED(gfeVersion);
ASSIGN_IF_CHANGED(appVersion);
ASSIGN_IF_CHANGED(isSupportedServerVersion);
ASSIGN_IF_CHANGED(maxLumaPixelsHEVC);
ASSIGN_IF_CHANGED(gpuModel);
ASSIGN_IF_CHANGED_AND_NONNULL(serverCert);

View File

@@ -65,6 +65,7 @@ public:
int maxLumaPixelsHEVC;
int serverCodecModeSupport;
QString gpuModel;
bool isSupportedServerVersion;
// Persisted traits
QString localAddress;