From e24ff0eae8476d3915bb359527a48c8b37a20e03 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 29 Oct 2023 06:04:13 -0400 Subject: [PATCH 1/3] Account for new Daemon Also better conforms to the exact data the vanilia launcher sends to the mounter. --- CMakeLists.txt | 2 +- app/src/task/t-mount.cpp | 3 ++- app/src/tools/mounter_proxy.cpp | 17 +++++++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9dae556..04dbdce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,7 +79,7 @@ ob_fetch_qx( # Fetch libfp (build and import from source) include(OB/Fetchlibfp) -ob_fetch_libfp("v0.5") +ob_fetch_libfp("e9d857952113e84b3aac2d049b1503c34ff843d7") # Fetch QI-QMP (build and import from source) include(OB/FetchQI-QMP) diff --git a/app/src/task/t-mount.cpp b/app/src/task/t-mount.cpp index 6de84cb..934f471 100644 --- a/app/src/task/t-mount.cpp +++ b/app/src/task/t-mount.cpp @@ -75,7 +75,7 @@ void TMount::perform() //-Setup Mounter(s)------------------------------------ - if(mDaemon == Fp::Daemon::FpProxy) + if(mDaemon == Fp::Daemon::FpProxy || mDaemon == Fp::Daemon::FpGameServer) { initMounter(mMounterProxy); mMounterProxy->setFilePath(mPath); @@ -122,6 +122,7 @@ void TMount::perform() switch(mDaemon) { case Fp::Daemon::FpProxy: + case Fp::Daemon::FpGameServer: mMounterProxy->mount(); break; diff --git a/app/src/tools/mounter_proxy.cpp b/app/src/tools/mounter_proxy.cpp index 3c63caa..1eff247 100644 --- a/app/src/tools/mounter_proxy.cpp +++ b/app/src/tools/mounter_proxy.cpp @@ -4,6 +4,9 @@ // Qt Includes #include #include +#include +#include +#include // Qx Includes #include @@ -96,7 +99,7 @@ quint16 MounterProxy::proxyServerPort() const { return mProxyServerPort; } QString MounterProxy::filePath() const { return mFilePath; } void MounterProxy::setProxyServerPort(quint16 port) { mProxyServerPort = port; } -void MounterProxy::setFilePath(const QString& path) { mFilePath = path; } +void MounterProxy::setFilePath(const QString& path) { mFilePath = QDir::toNativeSeparators(path); } //-Signals & Slots------------------------------------------------------------------------------------------------------------ //Private Slots: @@ -139,9 +142,15 @@ void MounterProxy::mount() // Header mountReq.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); - - // Data (could use QJsonDocument but for such a simple object that's overkill - QByteArray data = "{\"filePath\":\""_ba + mFilePath.toLatin1() + "\"}"_ba; + // These headers are used by the stock launcher, but don't seem to be needed + // + // mountReq.setRawHeader("Connection"_ba, "close"_ba); + // mountReq.setRawHeader("Accept"_ba, "application/json, text/plain, */*"_ba); + // mountReq.setRawHeader("Accept-Encoding"_ba, "gzip, compress, deflate, br"_ba); + + // Data + QJsonDocument jdData(QJsonObject{{u"filePath"_s, mFilePath}}); + QByteArray data = jdData.toJson(QJsonDocument::Compact); //-POST Request--------------------------------- mProxyMountReply = mNam.post(mountReq, data); From 74ab6ee89ec53e5683785d73b12c880b43317153 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 29 Oct 2023 06:05:26 -0400 Subject: [PATCH 2/3] Bump --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04dbdce..9af0253 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ ob_standard_project_setup() # Additional Project Variables set(PROJECT_FORMAL_NAME "CLI Flashpoint") -set(TARGET_FP_VERSION_PREFIX 12.0) +set(TARGET_FP_VERSION_PREFIX 12.1) # Configuration options # Handled by fetched libs, but set this here formally since they aren't part of the main project @@ -79,7 +79,7 @@ ob_fetch_qx( # Fetch libfp (build and import from source) include(OB/Fetchlibfp) -ob_fetch_libfp("e9d857952113e84b3aac2d049b1503c34ff843d7") +ob_fetch_libfp("v0.5.1") # Fetch QI-QMP (build and import from source) include(OB/FetchQI-QMP) From 4a8fafe936fbcc291d4ec91e3bb69ee5e05e6e57 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 29 Oct 2023 06:08:26 -0400 Subject: [PATCH 3/3] Update invalid install tip --- app/src/kernel/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/kernel/driver.h b/app/src/kernel/driver.h index bfbff3a..f57a8e3 100644 --- a/app/src/kernel/driver.h +++ b/app/src/kernel/driver.h @@ -66,7 +66,7 @@ class Driver : public QObject // Error Messages static inline const QString ERR_LAUNCHER_RUNNING_TIP = u"Please close the Launcher first."_s; - static inline const QString ERR_INSTALL_INVALID_TIP = u"Check its location and compatibility with your Flashpoint version."_s; + static inline const QString ERR_INSTALL_INVALID_TIP = u"You may need to update CLIFp."_s; // Logging static inline const QString LOG_EVENT_FLASHPOINT_SEARCH = u"Searching for Flashpoint root..."_s;