Exemplo n.º 1
0
//---------------------------------------
void CGameBrowser::Update(const float dt)
{
	if (m_delayedSearchType != eDST_None)
	{
		if (m_searchingTask==CryLobbyInvalidTaskID && !CanStartSearch())
		{
			CryLog("[UI] Activate delayed search %d", m_delayedSearchType);
			if (m_delayedSearchType == eDST_Full)
			{
				StartSearchingForServers();
			}
			else if (m_delayedSearchType == eDST_FavouriteId)
			{
				if (!DoFavouriteIdSearch())
				{
#ifdef USE_C2_FRONTEND
					if (CMPMenuHub *pMPMenu = CMPMenuHub::GetMPMenuHub())
					{
						pMPMenu->SearchComplete();
					}
#endif //#ifdef USE_C2_FRONTEND
				}
			}

			m_delayedSearchType = eDST_None;
		}
	}
}
Exemplo n.º 2
0
void CGameBrowser::StartFavouriteIdSearch( const CGameServerLists::EGameServerLists serverList, uint32 *pFavouriteIds, uint32 numFavouriteIds )
{
	CRY_ASSERT(numFavouriteIds <= CGameServerLists::k_maxServersStoredInList);
	numFavouriteIds = MIN(numFavouriteIds, CGameServerLists::k_maxServersStoredInList);
	if (numFavouriteIds <= CGameServerLists::k_maxServersStoredInList)
	{
		memset(m_searchFavouriteIds, INVALID_SESSION_FAVOURITE_ID, sizeof(m_searchFavouriteIds));

		for (uint32 i=0; i<numFavouriteIds; ++i)
		{
			m_searchFavouriteIds[i] = pFavouriteIds[i];
		}

		m_currentSearchFavouriteIdIndex = 0;
		m_numSearchFavouriteIds = numFavouriteIds;

		if (CanStartSearch())
		{
			CryLog("[UI] Delayed Searching for favId sessions");
			m_delayedSearchType = eDST_FavouriteId;

			NOTIFY_UILOBBY_MP(SearchStarted());
		}
		else
		{
			if (DoFavouriteIdSearch())
			{
				m_currentFavouriteIdSearchType = serverList;

				NOTIFY_UILOBBY_MP(SearchStarted());
			}
		}
	}
}
Exemplo n.º 3
0
//-------------------------------------------------------------------------
void CGameBrowser::FinishedSearch(bool feedback, bool finishedSearch)
{
	CryLog("CGameBrowser::FinishedSearch()");
	m_searchingTask = CryLobbyInvalidTaskID;

#if IMPLEMENT_PC_BLADES
	if (m_bFavouriteIdSearch)
	{
		bool bSearchOver = true;

		if (!finishedSearch && (m_currentSearchFavouriteIdIndex < m_numSearchFavouriteIds))
		{
			if (DoFavouriteIdSearch())
			{
				feedback = false;
				bSearchOver = false;
			}
		}

		if (bSearchOver)	
		{
			for (uint32 i = 0; i < m_numSearchFavouriteIds; ++i)
			{
				if (m_searchFavouriteIds[i] != INVALID_SESSION_FAVOURITE_ID)
				{
					g_pGame->GetGameServerLists()->ServerNotFound(m_currentFavouriteIdSearchType, m_searchFavouriteIds[i]);
				}

				m_searchFavouriteIds[i] = INVALID_SESSION_FAVOURITE_ID;
			}
		}
	}
#endif
		
	if(feedback)
	{
#ifdef USE_C2_FRONTEND
		if (CMPMenuHub *pMPMenu = CMPMenuHub::GetMPMenuHub())
		{
			pMPMenu->SearchComplete();
		}
#endif //#ifdef USE_C2_FRONTEND
	}
}
Exemplo n.º 4
0
void CGameBrowser::StartFavouriteIdSearch( const CGameServerLists::EGameServerLists serverList, uint32 *pFavouriteIds, uint32 numFavouriteIds )
{
	CRY_ASSERT(numFavouriteIds <= CGameServerLists::k_maxServersStoredInList);
	numFavouriteIds = MIN(numFavouriteIds, CGameServerLists::k_maxServersStoredInList);
	if (numFavouriteIds <= CGameServerLists::k_maxServersStoredInList)
	{
		memset(m_searchFavouriteIds, INVALID_SESSION_FAVOURITE_ID, sizeof(m_searchFavouriteIds));

		for (uint32 i=0; i<numFavouriteIds; ++i)
		{
			m_searchFavouriteIds[i] = pFavouriteIds[i];
		}

		m_currentSearchFavouriteIdIndex = 0;
		m_numSearchFavouriteIds = numFavouriteIds;

		if (CanStartSearch())
		{
			CryLog("[UI] Delayed Searching for favId sessions");
			m_delayedSearchType = eDST_FavouriteId;

#ifdef USE_C2_FRONTEND
			if (CMPMenuHub *pMPMenu = CMPMenuHub::GetMPMenuHub())
			{
				pMPMenu->StartSearching();
			}
#endif //#ifdef USE_C2_FRONTEND
		}
		else
		{
			if (DoFavouriteIdSearch())
			{
				m_currentFavouriteIdSearchType = serverList;

#ifdef USE_C2_FRONTEND
				if (CMPMenuHub *pMPMenu = CMPMenuHub::GetMPMenuHub())
				{
					pMPMenu->StartSearching();
				}
#endif //#ifdef USE_C2_FRONTEND
			}
		}
	}
}
Exemplo n.º 5
0
//---------------------------------------
void CGameBrowser::Update(const float dt)
{
	if (m_delayedSearchType != eDST_None)
	{
		if (m_searchingTask==CryLobbyInvalidTaskID && !CanStartSearch())
		{
			CryLog("[UI] Activate delayed search %d", m_delayedSearchType);
			if (m_delayedSearchType == eDST_Full)
			{
				StartSearchingForServers();
			}
			else if (m_delayedSearchType == eDST_FavouriteId)
			{
				if (!DoFavouriteIdSearch())
				{
					NOTIFY_UILOBBY_MP(SearchCompleted());
				}
			}

			m_delayedSearchType = eDST_None;
		}
	}
}