@@ -52,6 +52,9 @@ struct MOTDResponse
5252
5353std::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
7074void 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