diff --git a/launcher/config.kcfg b/launcher/config.kcfg
index 09ba70f..298b403 100644
--- a/launcher/config.kcfg
+++ b/launcher/config.kcfg
@@ -54,5 +54,11 @@ SPDX-License-Identifier: CC0-1.0
false
+
+
+
+
+ 7000
+
diff --git a/launcher/include/launchercore.h b/launcher/include/launchercore.h
index 1d84aa8..fe5c759 100755
--- a/launcher/include/launchercore.h
+++ b/launcher/include/launchercore.h
@@ -49,7 +49,8 @@ struct LoginAuth {
int maxExpansion = 1;
// if empty, don't set on the client
- QString lobbyhost, frontierHost;
+ QString lobbyHost, frontierHost;
+ int lobbyHostPort;
};
class LauncherCore : public QObject
diff --git a/launcher/include/launchersettings.h b/launcher/include/launchersettings.h
index a0cb2b8..c009689 100644
--- a/launcher/include/launchersettings.h
+++ b/launcher/include/launchersettings.h
@@ -26,6 +26,8 @@ class LauncherSettings : public QObject
Q_PROPERTY(bool argumentsEncrypted READ argumentsEncrypted WRITE setArgumentsEncrypted NOTIFY encryptedArgumentsChanged)
Q_PROPERTY(bool enableRenderDocCapture READ enableRenderDocCapture WRITE setEnableRenderDocCapture NOTIFY enableRenderDocCaptureChanged)
Q_PROPERTY(bool enableSync READ enableSync WRITE setEnableSync NOTIFY enableSyncChanged)
+ Q_PROPERTY(QString customGameServer READ customGameServer WRITE setCustomGameServer NOTIFY customGameServerChanged)
+ Q_PROPERTY(int customGameServerPort READ customGameServerPort WRITE setCustomGameServerPort NOTIFY customGameServerPortChanged)
public:
explicit LauncherSettings(QObject *parent = nullptr);
@@ -74,6 +76,12 @@ public:
[[nodiscard]] bool enableSync() const;
void setEnableSync(bool enabled);
+ [[nodiscard]] QString customGameServer() const;
+ void setCustomGameServer(const QString &value);
+
+ [[nodiscard]] int customGameServerPort() const;
+ void setCustomGameServerPort(int port);
+
Config *config();
Q_SIGNALS:
@@ -89,6 +97,8 @@ Q_SIGNALS:
void encryptedArgumentsChanged();
void enableRenderDocCaptureChanged();
void enableSyncChanged();
+ void customGameServerChanged();
+ void customGameServerPortChanged();
private:
Config *m_config = nullptr;
diff --git a/launcher/src/gamerunner.cpp b/launcher/src/gamerunner.cpp
index 6c34617..998fe37 100644
--- a/launcher/src/gamerunner.cpp
+++ b/launcher/src/gamerunner.cpp
@@ -228,11 +228,11 @@ QString GameRunner::getGameArgs(const Profile &profile, const std::optionallobbyhost.isEmpty()) {
+ if (!auth->lobbyHost.isEmpty()) {
gameArgs.push_back({QStringLiteral("DEV.GMServerHost"), auth->frontierHost});
for (int i = 1; i < 9; i++) {
- gameArgs.push_back({QStringLiteral("DEV.LobbyHost0%1").arg(QString::number(i)), auth->lobbyhost});
- gameArgs.push_back({QStringLiteral("DEV.LobbyPort0%1").arg(QString::number(i)), QString::number(54994)});
+ gameArgs.push_back({QStringLiteral("DEV.LobbyHost0%1").arg(QString::number(i)), auth->lobbyHost});
+ gameArgs.push_back({QStringLiteral("DEV.LobbyPort0%1").arg(QString::number(i)), QString::number(auth->lobbyHostPort)});
}
}
diff --git a/launcher/src/launchersettings.cpp b/launcher/src/launchersettings.cpp
index b9c2807..d6e82d2 100644
--- a/launcher/src/launchersettings.cpp
+++ b/launcher/src/launchersettings.cpp
@@ -214,6 +214,34 @@ void LauncherSettings::setEnableSync(const bool enabled)
}
}
+QString LauncherSettings::customGameServer() const
+{
+ return m_config->customGameServer();
+}
+
+void LauncherSettings::setCustomGameServer(const QString &value)
+{
+ if (m_config->customGameServer() != value) {
+ m_config->setCustomGameServer(value);
+ m_config->save();
+ Q_EMIT customGameServerChanged();
+ }
+}
+
+int LauncherSettings::customGameServerPort() const
+{
+ return m_config->customGameServerPort();
+}
+
+void LauncherSettings::setCustomGameServerPort(const int port)
+{
+ if (m_config->customGameServerPort() != port) {
+ m_config->setCustomGameServerPort(port);
+ m_config->save();
+ Q_EMIT customGameServerPortChanged();
+ }
+}
+
Config *LauncherSettings::config()
{
return m_config;
diff --git a/launcher/src/sapphirelogin.cpp b/launcher/src/sapphirelogin.cpp
index 1b39c6c..de0a524 100644
--- a/launcher/src/sapphirelogin.cpp
+++ b/launcher/src/sapphirelogin.cpp
@@ -40,8 +40,9 @@ QCoro::Task> SapphireLogin::login(const QString &lobbyU
if (!document.isEmpty()) {
LoginAuth auth;
auth.SID = document["sId"_L1].toString();
- auth.lobbyhost = document["lobbyHost"_L1].toString();
+ auth.lobbyHost = document["lobbyHost"_L1].toString();
auth.frontierHost = document["frontierHost"_L1].toString();
+ auth.lobbyHostPort = 54994; // TODO: where did this come from?
auth.region = 3;
co_return auth;
@@ -67,10 +68,10 @@ void SapphireLogin::registerAccount(const QString &lobbyUrl, const LoginInformat
LoginAuth auth;
auth.SID = document["sId"_L1].toString();
- auth.lobbyhost = document["lobbyHost"_L1].toString();
+ auth.lobbyHost = document["lobbyHost"_L1].toString();
auth.frontierHost = document["frontierHost"_L1].toString();
auth.region = 3;
// m_launcher.launchGame(*info.profile, auth);
});
-}
\ No newline at end of file
+}
diff --git a/launcher/src/squareenixlogin.cpp b/launcher/src/squareenixlogin.cpp
index 1507651..36b4acb 100644
--- a/launcher/src/squareenixlogin.cpp
+++ b/launcher/src/squareenixlogin.cpp
@@ -71,6 +71,13 @@ QCoro::Task> SquareEnixLogin::login(LoginInformation *i
co_return std::nullopt;
}
+ // Inject custom game server if set
+ if (!m_launcher.settings()->customGameServer().isEmpty()) {
+ m_auth.frontierHost = m_launcher.settings()->customGameServer();
+ m_auth.lobbyHost = m_launcher.settings()->customGameServer();
+ m_auth.lobbyHostPort = m_launcher.settings()->customGameServerPort();
+ }
+
co_return m_auth;
}
diff --git a/launcher/ui/Settings/DeveloperSettings.qml b/launcher/ui/Settings/DeveloperSettings.qml
index 18488f2..15cd666 100644
--- a/launcher/ui/Settings/DeveloperSettings.qml
+++ b/launcher/ui/Settings/DeveloperSettings.qml
@@ -180,5 +180,33 @@ FormCard.FormCardPage {
text: LauncherCore.settings.mainServer
onTextChanged: LauncherCore.settings.mainServer = text
}
+
+ FormCard.FormDelegateSeparator {
+ above: mainServerDelegate
+ below: gameServerDelegate
+ }
+
+ FormCard.FormTextFieldDelegate {
+ id: gameServerDelegate
+
+ label: i18n("Game Server (leave blank for default)")
+ text: LauncherCore.settings.customGameServer
+ onTextChanged: LauncherCore.settings.customGameServer = text
+ }
+
+ FormCard.FormDelegateSeparator {
+ above: gameServerDelegate
+ below: gameServerPortDelegate
+ }
+
+ FormCard.FormSpinBoxDelegate {
+ id: gameServerPortDelegate
+
+ label: i18n("Game Server Port")
+ value: LauncherCore.settings.customGameServerPort
+ onValueChanged: LauncherCore.settings.customGameServerPort = value
+ from: 1
+ to: 999999
+ }
}
-}
\ No newline at end of file
+}