Skip to content

Commit 6a80eec

Browse files
committed
- Fix shellmap freeze when failing to login
1 parent 31e16de commit 6a80eec

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,12 @@ void NGMP_WOLLoginMenu_LoginCallback(bool bSuccess)
640640
}
641641
else
642642
{
643-
GSMessageBoxOk(UnicodeString(L"Logging In"), UnicodeString(L"Login failed."), nullptr);
643+
GSMessageBoxOk(UnicodeString(L"Logging In"), UnicodeString(L"Login failed."), []()
644+
{
645+
TheShell->pop();
646+
});
647+
648+
644649
}
645650

646651
}

GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/OnlineServices_Auth.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ struct MOTDResponse
5252

5353
std::string GenerateGamecode()
5454
{
55+
#if _DEBUG
56+
return "ILOVECODE";
57+
#else
5558
std::string result;
5659
const char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
5760
const size_t max_index = sizeof(charset) - 1;
@@ -65,6 +68,7 @@ std::string GenerateGamecode()
6568
}
6669

6770
return result;
71+
#endif
6872
}
6973

7074
void NGMP_OnlineServices_AuthInterface::GoToDetermineNetworkCaps()
@@ -198,7 +202,9 @@ void NGMP_OnlineServices_AuthInterface::BeginLogin()
198202
std::string strURI = std::format("http://www.playgenerals.online/login/?gamecode={}", m_strCode.c_str());
199203
#endif
200204

205+
#if !_DEBUG
201206
ShellExecuteA(NULL, "open", strURI.c_str(), NULL, NULL, SW_SHOWNORMAL);
207+
#endif
202208
}
203209
}
204210
catch (...)
@@ -212,6 +218,7 @@ void NGMP_OnlineServices_AuthInterface::BeginLogin()
212218
{
213219
m_bWaitingLogin = true;
214220
m_lastCheckCode = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::utc_clock::now().time_since_epoch()).count();
221+
215222
m_strCode = GenerateGamecode();
216223

217224
#if defined(USE_TEST_ENV)
@@ -223,9 +230,7 @@ void NGMP_OnlineServices_AuthInterface::BeginLogin()
223230
ClearGSMessageBoxes();
224231
GSMessageBoxNoButtons(UnicodeString(L"Logging In"), UnicodeString(L"Please continue in your web browser"), true);
225232

226-
#if _DEBUG
227-
m_strCode = "ILOVECODE";
228-
#else
233+
#if !_DEBUG
229234
ShellExecuteA(NULL, "open", strURI.c_str(), NULL, NULL, SW_SHOWNORMAL);
230235
#endif
231236

0 commit comments

Comments
 (0)