Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ static Int maxPingEntries = 0;
static Int maxPoints= 100;
static Int minPoints = 0;

static Int matchFoundTimeoutStart = 0;
static const Int lobbyTimeoutMs = 10000;

static const LadderInfo * getLadderInfo();

static Bool isInfoShown()
Expand Down Expand Up @@ -1214,6 +1217,7 @@ void WOLQuickMatchMenuInit( WindowLayout *layout, void *userData )
{
buttonBack->winEnable(FALSE);
buttonStop->winEnable(FALSE);
matchFoundTimeoutStart = timeGetTime();
if (TheAudio)
{
AudioEventRTS evt("GUICommunicatorOpen");
Expand All @@ -1223,6 +1227,7 @@ void WOLQuickMatchMenuInit( WindowLayout *layout, void *userData )

pLobbyInterface->RegisterForMatchmakingStartGameCallback([]()
{
matchFoundTimeoutStart = 0;
NetworkLog(ELogVerbosity::LOG_DEBUG, "[QUICKMATCH] GOT START GAME EVENT");

// Check if TheNGMPGame is initialized before dereferencing it
Expand Down Expand Up @@ -1571,6 +1576,15 @@ void WOLQuickMatchMenuUpdate( WindowLayout * layout, void *userData)
HandleBuddyResponses();
#endif

if (matchFoundTimeoutStart != 0 && timeGetTime() - matchFoundTimeoutStart >= lobbyTimeoutMs)
{
matchFoundTimeoutStart = 0;
buttonBack->winEnable(TRUE);
buttonStop->winEnable(TRUE);
Int index = GadgetListBoxAddEntryText(quickmatchTextWindow, UnicodeString(L"Match setup timed out. You may cancel or continue waiting."), GameMakeColor(255, 194, 25, 255), -1, -1);
GadgetListBoxSetItemData(quickmatchTextWindow, (void*)-1, index);
}

/// @todo: MDC handle disconnects in-game the same way as Custom Match!

if (TheShell->isAnimFinished() && !buttonPushed && TheGameSpyPeerMessageQueue && TheGameSpyInfo)
Expand Down
Loading