From 253fd5f10fe2ba9857f5643ef3858b0f9f92576f Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 9 Nov 2024 14:30:10 -0500 Subject: [PATCH] Refactor out the platform, boot, game update channels --- launcher/src/squareenixlogin.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/launcher/src/squareenixlogin.cpp b/launcher/src/squareenixlogin.cpp index 5a5b337..d6b2328 100644 --- a/launcher/src/squareenixlogin.cpp +++ b/launcher/src/squareenixlogin.cpp @@ -18,6 +18,10 @@ #include "launchercore.h" #include "utility.h" +const QString platform = QStringLiteral("win32"); +const QString bootUpdateChannel = QStringLiteral("ffxivneo_release_boot"); +const QString gameUpdateChannel = QStringLiteral("win32"); + using namespace Qt::StringLiterals; SquareEnixLogin::SquareEnixLogin(LauncherCore &window, QObject *parent) @@ -158,7 +162,7 @@ QCoro::Task SquareEnixLogin::checkBootUpdates() QUrl url; url.setScheme(QStringLiteral("http")); url.setHost(QStringLiteral("patch-bootver.%1").arg(m_launcher.settings()->squareEnixServer())); - url.setPath(QStringLiteral("/http/win32/ffxivneo_release_boot/%1/").arg(m_info->profile->bootVersion())); + url.setPath(QStringLiteral("/http/%1/%2/%3/").arg(platform, gameUpdateChannel, m_info->profile->bootVersion())); url.setQuery(query); auto request = QNetworkRequest(url); @@ -346,7 +350,7 @@ QCoro::Task SquareEnixLogin::registerSession() QUrl url; url.setScheme(m_launcher.settings()->preferredProtocol()); url.setHost(QStringLiteral("patch-gamever.%1").arg(m_launcher.settings()->squareEnixServer())); - url.setPath(QStringLiteral("/http/win32/ffxivneo_release_game/%1/%2").arg(m_info->profile->baseGameVersion(), m_SID)); + url.setPath(QStringLiteral("/http/%1/%2/%3/%4").arg(platform, gameUpdateChannel, m_info->profile->baseGameVersion(), m_SID)); auto request = QNetworkRequest(url); Utility::setSSL(request); @@ -459,4 +463,4 @@ QString SquareEnixLogin::getFileHash(const QString &file) return QStringLiteral("%1/%2").arg(QString::number(f.size()), QString::fromUtf8(hash.result().toHex())); } -#include "moc_squareenixlogin.cpp" \ No newline at end of file +#include "moc_squareenixlogin.cpp"