From 322f7492e531169aa1ce9251d74c13141d631831 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 23 Mar 2024 12:54:00 -0400 Subject: [PATCH] Only add hashes for files that exist This allows older 32-bit clients to work again, without additional configuration. (cherry picked from commit c8a81af967a4101013c3c7771ff548e57a7f0b61) --- launcher/src/squareenixlogin.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/launcher/src/squareenixlogin.cpp b/launcher/src/squareenixlogin.cpp index d3e99c1..fea12ed 100644 --- a/launcher/src/squareenixlogin.cpp +++ b/launcher/src/squareenixlogin.cpp @@ -18,10 +18,6 @@ #include "launchercore.h" #include "utility.h" -// Support for the 32-bit DX9 client was removed in March 2024 -// TODO: we should probably detect this automatically -#define SUPPORT_32BIT 0 - using namespace Qt::StringLiterals; SquareEnixLogin::SquareEnixLogin(LauncherCore &window, QObject *parent) @@ -336,8 +332,6 @@ QCoro::Task SquareEnixLogin::registerSession() } } - qInfo() << report; - Utility::printRequest(QStringLiteral("POST"), request); const auto reply = m_launcher.mgr()->post(request, report.toUtf8()); @@ -390,19 +384,12 @@ QCoro::Task SquareEnixLogin::registerSession() QCoro::Task SquareEnixLogin::getBootHash() { -#if SUPPORT_32BIT const QList fileList = {QStringLiteral("ffxivboot.exe"), QStringLiteral("ffxivboot64.exe"), QStringLiteral("ffxivlauncher.exe"), QStringLiteral("ffxivlauncher64.exe"), QStringLiteral("ffxivupdater.exe"), QStringLiteral("ffxivupdater64.exe")}; -#else - const QList fileList = {QStringLiteral("ffxivboot.exe"), - QStringLiteral("ffxivboot64.exe"), - QStringLiteral("ffxivlauncher64.exe"), - QStringLiteral("ffxivupdater64.exe")}; -#endif const auto hashFuture = QtConcurrent::mapped(fileList, [this](const auto &filename) -> QString { return getFileHash(m_info->profile->gamePath() + QStringLiteral("/boot/") + filename); @@ -413,10 +400,12 @@ QCoro::Task SquareEnixLogin::getBootHash() QString result; for (int i = 0; i < fileList.count(); i++) { - result += fileList[i] + QStringLiteral("/") + hashes[i]; + if (!hashes[i].isEmpty()) { + result += fileList[i] + QStringLiteral("/") + hashes[i]; - if (i != fileList.length() - 1) - result += QStringLiteral(","); + if (i != fileList.length() - 1) + result += QStringLiteral(","); + } } co_return result;