From 621864b9b00ba7a9ae0fceb0a7db3ace6d4906b9 Mon Sep 17 00:00:00 2001 From: Bottinator22 Date: Fri, 25 Apr 2025 00:27:10 -0700 Subject: allow forcing legacy connections --- source/client/StarClientApplication.cpp | 11 ++++++++--- source/client/StarClientApplication.hpp | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'source/client') diff --git a/source/client/StarClientApplication.cpp b/source/client/StarClientApplication.cpp index a86a574..f79226e 100644 --- a/source/client/StarClientApplication.cpp +++ b/source/client/StarClientApplication.cpp @@ -73,7 +73,8 @@ Json const AdditionalDefaultConfiguration = Json::parseJson(R"JSON( "title" : { "multiPlayerAddress" : "", "multiPlayerPort" : "", - "multiPlayerAccount" : "" + "multiPlayerAccount" : "", + "multiPlayerForceLegacy" : false }, "bindings" : { @@ -638,6 +639,7 @@ void ClientApplication::changeState(MainAppState newState) { m_titleScreen->setMultiPlayerAddress(toString(address->address())); m_titleScreen->setMultiPlayerPort(toString(address->port())); m_titleScreen->setMultiPlayerAccount(configuration->getPath("title.multiPlayerAccount").toString()); + m_titleScreen->setMultiPlayerForceLegacy(configuration->getPath("title.multiPlayerForceLegacy").optBool().value(false)); m_titleScreen->goToMultiPlayerSelectCharacter(false); } else { m_titleScreen->goToMultiPlayerSelectCharacter(true); @@ -646,6 +648,7 @@ void ClientApplication::changeState(MainAppState newState) { m_titleScreen->setMultiPlayerAddress(configuration->getPath("title.multiPlayerAddress").toString()); m_titleScreen->setMultiPlayerPort(configuration->getPath("title.multiPlayerPort").toString()); m_titleScreen->setMultiPlayerAccount(configuration->getPath("title.multiPlayerAccount").toString()); + m_titleScreen->setMultiPlayerForceLegacy(configuration->getPath("title.multiPlayerForceLegacy").optBool().value(false)); } } @@ -710,7 +713,7 @@ void ClientApplication::changeState(MainAppState newState) { bool allowAssetsMismatch = m_root->configuration()->get("allowAssetsMismatch").toBool(); if (auto errorMessage = m_universeClient->connect(UniverseConnection(std::move(packetSocket)), allowAssetsMismatch, - multiPlayerConnection.account, multiPlayerConnection.password)) { + multiPlayerConnection.account, multiPlayerConnection.password, multiPlayerConnection.forceLegacy)) { setError(*errorMessage); return; } @@ -882,13 +885,15 @@ void ClientApplication::updateTitle(float dt) { m_pendingMultiPlayerConnection = PendingMultiPlayerConnection{ address.right(), m_titleScreen->multiPlayerAccount(), - m_titleScreen->multiPlayerPassword() + m_titleScreen->multiPlayerPassword(), + m_titleScreen->multiPlayerForceLegacy() }; auto configuration = m_root->configuration(); configuration->setPath("title.multiPlayerAddress", m_titleScreen->multiPlayerAddress()); configuration->setPath("title.multiPlayerPort", m_titleScreen->multiPlayerPort()); configuration->setPath("title.multiPlayerAccount", m_titleScreen->multiPlayerAccount()); + configuration->setPath("title.multiPlayerForceLegacy", m_titleScreen->multiPlayerForceLegacy()); changeState(MainAppState::MultiPlayer); } diff --git a/source/client/StarClientApplication.hpp b/source/client/StarClientApplication.hpp index 2fcddb7..8824ea0 100644 --- a/source/client/StarClientApplication.hpp +++ b/source/client/StarClientApplication.hpp @@ -57,6 +57,7 @@ private: Variant server; String account; String password; + bool forceLegacy; }; struct PostProcessGroup { -- cgit v1.2.3