From e48134136a8bee4fd641a03bad52f90bb02bd25c Mon Sep 17 00:00:00 2001 From: u7080498 Date: Sun, 22 Oct 2023 09:58:26 +1100 Subject: [PATCH] GH-5166 Adding refresh during Instance Launch In the login function of LaunchController, added requestRefresh on the current m_accountToUse. This allows the accountState of accountToUse to be updated before running through what login is meant to depending on the accountState. This is to allow for the cases where a device might be back online after launching the Launcher. Putting this in the tryagain while loop also allows to check if a users account is expired during the login process. --- launcher/LaunchController.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index 597eb4c095..fc62c30d2e 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -117,6 +117,11 @@ void LaunchController::login() { while (tryagain) { + // Force account refresh on the account used to launch the instance, + // updating the AccountState everytime between instance launch + auto accounts = APPLICATION->accounts(); + accounts->requestRefresh(m_accountToUse->internalId()); + m_session = std::make_shared(); m_session->wants_online = m_online; m_accountToUse->fillSession(m_session);