From ef80a8bacaab525be21b9beae4992955f5e907d0 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 22 Feb 2019 04:33:21 -0600 Subject: Remove the spoofed NMM version The new API does not require this and it serves no purpose to keep it. --- src/mainwindow.cpp | 3 +-- src/nexusinterface.cpp | 8 +------- src/nexusinterface.h | 7 ------- src/nxmaccessmanager.cpp | 6 ------ src/nxmaccessmanager.h | 3 --- src/organizercore.cpp | 1 - src/settings.cpp | 13 ------------- src/settings.h | 6 ------ src/settingsdialog.ui | 48 ------------------------------------------------ 9 files changed, 2 insertions(+), 93 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 282c9674..602c32df 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1878,6 +1878,7 @@ void MainWindow::processUpdates() { instance.remove("nexus_login"); instance.remove("nexus_api_key"); instance.remove("ask_for_nexuspw"); + instance.remove("nmm_version"); instance.endGroup(); instance.beginGroup("Servers"); instance.remove(""); @@ -4905,8 +4906,6 @@ void MainWindow::on_actionSettings_triggered() activateProxy(settings.useProxy()); } - NexusInterface::instance(&m_PluginContainer)->setNMMVersion(settings.getNMMVersion()); - updateDownloadView(); m_OrganizerCore.updateVFSParams(settings.logLevel(), settings.crashDumpsType(), settings.executablesBlacklist()); diff --git a/src/nexusinterface.cpp b/src/nexusinterface.cpp index ee40be22..23dd7dbe 100644 --- a/src/nexusinterface.cpp +++ b/src/nexusinterface.cpp @@ -156,7 +156,7 @@ QAtomicInt NexusInterface::NXMRequestInfo::s_NextID(0); NexusInterface::NexusInterface(PluginContainer *pluginContainer) - : m_NMMVersion(), m_PluginContainer(pluginContainer), m_RemainingDailyRequests(2500), m_RemainingHourlyRequests(100), m_MaxDailyRequests(2500), m_MaxHourlyRequests(100) + : m_PluginContainer(pluginContainer), m_RemainingDailyRequests(2500), m_RemainingHourlyRequests(100), m_MaxDailyRequests(2500), m_MaxHourlyRequests(100) { m_MOVersion = createVersionInfo(); @@ -187,12 +187,6 @@ void NexusInterface::setCacheDirectory(const QString &directory) m_AccessManager->setCache(m_DiskCache); } -void NexusInterface::setNMMVersion(const QString &nmmVersion) -{ - m_NMMVersion = nmmVersion; - m_AccessManager->setNMMVersion(nmmVersion); -} - void NexusInterface::loginCompleted() { nextRequest(); diff --git a/src/nexusinterface.h b/src/nexusinterface.h index c18c7103..c1f9da41 100644 --- a/src/nexusinterface.h +++ b/src/nexusinterface.h @@ -335,12 +335,6 @@ public: **/ void setCacheDirectory(const QString &directory); - /** - * MO has to send a "Nexus Client Vx.y.z" as part of the user agent to be allowed to use the API - * @param nmmVersion the version of nmm to impersonate - **/ - void setNMMVersion(const QString &nmmVersion); - /** * @brief called when the log-in completes. This was, requests waiting for the log-in can be run */ @@ -485,7 +479,6 @@ private: QQueue m_RequestQueue; MOBase::VersionInfo m_MOVersion; - QString m_NMMVersion; PluginContainer *m_PluginContainer; diff --git a/src/nxmaccessmanager.cpp b/src/nxmaccessmanager.cpp index aca1d785..428aa3f3 100644 --- a/src/nxmaccessmanager.cpp +++ b/src/nxmaccessmanager.cpp @@ -69,11 +69,6 @@ NXMAccessManager::~NXMAccessManager() } } -void NXMAccessManager::setNMMVersion(const QString &nmmVersion) -{ - m_NMMVersion = nmmVersion; -} - QNetworkReply *NXMAccessManager::createRequest( QNetworkAccessManager::Operation operation, const QNetworkRequest &request, QIODevice *device) @@ -202,7 +197,6 @@ QString NXMAccessManager::userAgent(const QString &subModule) const else comments << QSysInfo::kernelType().left(1).toUpper() + QSysInfo::kernelType().mid(1) << QSysInfo::productType().left(1).toUpper() + QSysInfo::kernelType().mid(1) + " " + QSysInfo::productVersion(); - comments << "Nexus Client v" + m_NMMVersion; if (!subModule.isEmpty()) { comments << "module: " + subModule; } diff --git a/src/nxmaccessmanager.h b/src/nxmaccessmanager.h index 7fdb508f..da7736cc 100644 --- a/src/nxmaccessmanager.h +++ b/src/nxmaccessmanager.h @@ -41,8 +41,6 @@ public: ~NXMAccessManager(); - void setNMMVersion(const QString &nmmVersion); - bool validated() const; bool validateAttempted() const; @@ -101,7 +99,6 @@ private: QProgressDialog *m_ProgressDialog { nullptr }; QString m_MOVersion; - QString m_NMMVersion; QString m_ApiKey; diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 2f75439d..caad45c9 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -292,7 +292,6 @@ OrganizerCore::OrganizerCore(const QSettings &initSettings) m_DownloadManager.setPreferredServers(m_Settings.getPreferredServers()); NexusInterface::instance(m_PluginContainer)->setCacheDirectory(m_Settings.getCacheDirectory()); - NexusInterface::instance(m_PluginContainer)->setNMMVersion(m_Settings.getNMMVersion()); MOBase::QuestionBoxMemory::init(initSettings.fileName()); diff --git a/src/settings.cpp b/src/settings.cpp index 67a84c0a..942005f8 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -353,16 +353,6 @@ QString Settings::getOverwriteDirectory(bool resolve) const ToQString(AppConfig::overwritePath()), resolve); } -QString Settings::getNMMVersion() const -{ - static const QString MIN_NMM_VERSION = "0.65.2"; - QString result = m_Settings.value("Settings/nmm_version", MIN_NMM_VERSION).toString(); - if (VersionInfo(result) < VersionInfo(MIN_NMM_VERSION)) { - result = MIN_NMM_VERSION; - } - return result; -} - bool Settings::getNexusApiKey(QString &apiKey) const { QString tempKey = deObfuscate("APIKEY"); @@ -1179,7 +1169,6 @@ Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, : Settings::SettingsTab(m_parent, m_dialog) , m_appIDEdit(m_dialog.findChild("appIDEdit")) , m_mechanismBox(m_dialog.findChild("mechanismBox")) - , m_nmmVersionEdit(m_dialog.findChild("nmmVersionEdit")) , m_hideUncheckedBox(m_dialog.findChild("hideUncheckedBox")) , m_forceEnableBox(m_dialog.findChild("forceEnableBox")) , m_displayForeignBox(m_dialog.findChild("displayForeignBox")) @@ -1214,7 +1203,6 @@ Settings::WorkaroundsTab::WorkaroundsTab(Settings *m_parent, m_mechanismBox->setCurrentIndex(index); - m_nmmVersionEdit->setText(m_parent->getNMMVersion()); m_hideUncheckedBox->setChecked(m_parent->hideUncheckedPlugins()); m_forceEnableBox->setChecked(m_parent->forceEnableCoreFiles()); m_displayForeignBox->setChecked(m_parent->displayForeign()); @@ -1233,7 +1221,6 @@ void Settings::WorkaroundsTab::update() m_Settings.remove("Settings/app_id"); } m_Settings.setValue("Settings/load_mechanism", m_mechanismBox->itemData(m_mechanismBox->currentIndex()).toInt()); - m_Settings.setValue("Settings/nmm_version", m_nmmVersionEdit->text()); m_Settings.setValue("Settings/hide_unchecked_plugins", m_hideUncheckedBox->isChecked()); m_Settings.setValue("Settings/force_enable_core_files", m_forceEnableBox->isChecked()); m_Settings.setValue("Settings/display_foreign", m_displayForeignBox->isChecked()); diff --git a/src/settings.h b/src/settings.h index 2cd3f0b6..3744a493 100644 --- a/src/settings.h +++ b/src/settings.h @@ -152,11 +152,6 @@ public: **/ QString getModDirectory(bool resolve = true) const; - /** - * returns the version of nmm to impersonate when connecting to nexus - **/ - QString getNMMVersion() const; - /** * retrieve the directory where the web cache is stored (with native separators) **/ @@ -525,7 +520,6 @@ private: private: QLineEdit *m_appIDEdit; QComboBox *m_mechanismBox; - QLineEdit *m_nmmVersionEdit; QCheckBox *m_hideUncheckedBox; QCheckBox *m_forceEnableBox; QCheckBox *m_displayForeignBox; diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 127c94c7..e56b3435 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -959,53 +959,6 @@ If you use the Steam version of Oblivion the default will NOT work. In this case - - - - - - NMM Version - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - The Version of Nexus Mod Manager to impersonate. - - - Mod Organizer uses an API provided by the Nexus to provide features like checking for updates and downloading files. Unfortunately this API has not been made available officially to third party tools like MO so we have to impersonate the Nexus Mod Manager to be allowed in. -On top of this Nexus has used the client identification to lock out outdated versions of NMM to force users to update. This means that MO also needs to impersonate the new version of NMM even if MO doesn't need an update. Therefore you can configure the version to identify as here. -Please note that MO does identify itself as MO to the webserver, it's not lying about what it is. It is merely adding a "compatible" NMM version to the user agent. - -tl;dr-version: If Nexus-features don't work, insert the current version number of NMM here and try again. - - - 009.009.009 - - - Qt::AlignCenter - - - - - - - - @@ -1388,7 +1341,6 @@ programs you are intentionally running. pluginBlacklist appIDEdit mechanismBox - nmmVersionEdit bsaDateBtn tabWidget -- cgit v1.3.1