Beispiel #1
0
void GameSpySupport::PumpTimerCompletion(AsyncOpPtr theOp, RefCountPtr theParam)
{
	if (theOp.get()	== NULL)
		return;

	if (theOp->Killed())
		return;

	GameSpySupport *pThat = (GameSpySupport*)theParam.get();
	pThat->Pump();
}
bool StagingLogic::VerifyPing(LobbyGame *theGame)
{
	if(theGame->GetGameType()!=LobbyGameType_Internet) // don't need to verify pings for non-internet games
		return true;

	if(theGame->GetHadSuccessfulPing())
		return true;

	LobbyConfig *aConfig = LobbyConfig::GetLobbyConfig();
	if(aConfig==NULL || aConfig->mAllowJoinGameWithoutPing)
	{
		// Warn that we haven't been able to ping the game yet
		if(LobbyPersistentData::GetShowConfirmations())
			return LobbyDialog::DoOkCancelDialog(GameStagingLogic_ConnectWarningTitle3_String,GameStagingLogic_ConnectWarningDetails3_String)==ControlId_Ok;
		else
			return true;
	}

	LobbyMisc::QueuePing(theGame,true);
	LobbyEvent::BroadcastEvent(new GameChangedEvent(theGame,LobbyChangeType_Modify));						
	while(theGame->IsPinging())
	{
		AsyncOpPtr anOp = new AsyncOp;
		LobbyDialog::DoStatusOp(anOp,GameStagingLogic_VerifyingPingTitle_String,GameStagingLogic_VerifyingPingDetails_String,CloseStatusDialogType_Any,500);
		if(anOp->Killed())
			return false;
	}
	
	if(!theGame->GetHadSuccessfulPing())
	{
		LobbyDialog::DoErrorDialog(GameStagingLogic_JoinGameErrorTitle_String,GameStagingLogic_NoPingReplyError_String);
		return false;
	}

	return true;

}