5454#include " WWDownload/Registry.h"
5555#include " WWDownload/urlBuilder.h"
5656#include " ../OnlineServices_Init.h"
57+ #include " Common/GameEngine.h"
5758
5859#ifdef _INTERNAL
5960// for occasional debugging...
@@ -772,6 +773,9 @@ void StopAsyncDNSCheck( void )
772773
773774void StartPatchCheck ( void )
774775{
776+ // GENERALS ONLINE
777+ InitGeneralsOnline ();
778+
775779 checkingForPatchBeforeGameSpy = TRUE ;
776780 cantConnectBeforeOnline = FALSE ;
777781 timeThroughOnline++;
@@ -784,23 +788,43 @@ void StartPatchCheck( void )
784788 // TODO_NGMP: Uninit this when leaving MP, waste of resources and cycles
785789 NGMP_OnlineServicesManager::GetInstance ()->Init ();
786790
787- NGMP_OnlineServicesManager::GetInstance ()->StartVersionCheck ([](bool bNeedsUpdate)
791+ NGMP_OnlineServicesManager::GetInstance ()->StartVersionCheck ([](bool bSuccess, bool bNeedsUpdate)
788792 {
789- if (!bNeedsUpdate)
790- {
791- startOnline ();
792- }
793- else
793+ cantConnectBeforeOnline = !bSuccess;
794+ mustDownloadPatch = bNeedsUpdate;
795+
796+ if (!bSuccess)
794797 {
795- // TODO_NGMP: Later we should allow in-game updates
796798 if (onlineCancelWindow)
797799 {
798800 TheWindowManager->winDestroy (onlineCancelWindow);
799801 onlineCancelWindow = NULL ;
800802 }
801803
802- onlineCancelWindow = MessageBoxOk (TheGameText->fetch (" GUI:PatchAvailable" ),
803- UnicodeString (L" An update is required.\n\n Please visit www.playgenerals.online to download the latest update" ), CancelPatchCheckCallbackAndReopenDropdown);
804+ TearDownGeneralsOnline ();
805+
806+ MessageBoxOk (TheGameText->fetch (" GUI:CannotConnectToServservTitle" ),
807+ TheGameText->fetch (" GUI:CannotConnectToServserv" ),
808+ noPatchBeforeOnlineCallback);
809+ }
810+ else
811+ {
812+ if (!bNeedsUpdate)
813+ {
814+ startOnline ();
815+ }
816+ else
817+ {
818+ // TODO_NGMP: Later we should allow in-game updates
819+ if (onlineCancelWindow)
820+ {
821+ TheWindowManager->winDestroy (onlineCancelWindow);
822+ onlineCancelWindow = NULL ;
823+ }
824+
825+ onlineCancelWindow = MessageBoxOk (TheGameText->fetch (" GUI:PatchAvailable" ),
826+ UnicodeString (L" An update is required.\n\n Please visit www.playgenerals.online to download the latest update" ), CancelPatchCheckCallbackAndReopenDropdown);
827+ }
804828 }
805829 });
806830
0 commit comments