From 64a65a7f7a47529798f661e8e37bc4abf0cedcc1 Mon Sep 17 00:00:00 2001 From: IceToast Date: Thu, 10 Sep 2026 14:07:25 +0200 Subject: [PATCH] feat: Add retry mechanism for thin/code --- Launcher/src/auth/nostaleauth.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Launcher/src/auth/nostaleauth.cpp b/Launcher/src/auth/nostaleauth.cpp index b0f378d..ab89a54 100644 --- a/Launcher/src/auth/nostaleauth.cpp +++ b/Launcher/src/auth/nostaleauth.cpp @@ -226,18 +226,17 @@ QString NostaleAuth::getToken(const QString &accountId) return {}; } - // This sleep is a MUST, otherwise the request to thin/codes will fail - QThread::sleep(std::chrono::seconds(1)); + for (int attempt = 0; attempt < 3; ++attempt) { + // This sleep is a MUST, otherwise the request to thin/codes will fail + QThread::sleep(std::chrono::seconds(1)); + QString code = sendThinCodes(accountId); - // if (!sendGameLaunch(accountId)) { - // return {}; - // } - - // if (!sendGameStarted(accountId)) { - // return {}; - // } + if (!code.isEmpty()) { + return code; + } + } - return sendThinCodes(accountId); + return {}; } QChar NostaleAuth::getFirstNumber(QString uuid)