当前位置: 首页>>代码示例>>C++>>正文


C++ IOnlineSessionPtr::ClearOnStartSessionCompleteDelegate_Handle方法代码示例

本文整理汇总了C++中IOnlineSessionPtr::ClearOnStartSessionCompleteDelegate_Handle方法的典型用法代码示例。如果您正苦于以下问题:C++ IOnlineSessionPtr::ClearOnStartSessionCompleteDelegate_Handle方法的具体用法?C++ IOnlineSessionPtr::ClearOnStartSessionCompleteDelegate_Handle怎么用?C++ IOnlineSessionPtr::ClearOnStartSessionCompleteDelegate_Handle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IOnlineSessionPtr的用法示例。


在下文中一共展示了IOnlineSessionPtr::ClearOnStartSessionCompleteDelegate_Handle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnStartOnlineGameComplete

/**
*	Delegate fired when a session start request has completed
*
*	@param SessionName the name of the session this callback is for
*	@param bWasSuccessful true if the async action completed without error, false if there was an error
*/
void URadeGameInstance::OnStartOnlineGameComplete(FName SessionName, bool bWasSuccessful)
{
	//GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Red, FString::Printf(TEXT("OnStartSessionComplete %s, %d"), *SessionName.ToString(), bWasSuccessful));

	// Get the Online Subsystem so we can get the Session Interface
	IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
	if (OnlineSub)
	{
		// Get the Session Interface to clear the Delegate
		IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
		if (Sessions.IsValid())
		{
			// Clear the delegate, since we are done with this call
			Sessions->ClearOnStartSessionCompleteDelegate_Handle(OnStartSessionCompleteDelegateHandle);
		}
	}


	// If the start was successful, we can open a NewMap if we want. Make sure to use "listen" as a parameter!
	if (bWasSuccessful)
	{
		
		//BattleArena
		UGameplayStatics::OpenLevel(GetWorld(), *TheMapName, true, "listen");
	}
}
开发者ID:ZioYuri78,项目名称:Rade,代码行数:32,代码来源:RadeGameInstance.cpp

示例2: OnStartSessionComplete

void UOnlineSessionClient::OnStartSessionComplete(FName SessionName, bool bWasSuccessful)
{
	UE_LOG(LogOnline, Verbose, TEXT("OnStartSessionComplete %s bSuccess: %d"), *SessionName.ToString(), bWasSuccessful);

	IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());
	if (SessionInterface.IsValid())
	{
		SessionInterface->ClearOnStartSessionCompleteDelegate_Handle(StartSessionCompleteHandle);
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:10,代码来源:OnlineSessionClient.cpp

示例3: OnStartOnlineGameComplete

void UtrnetDemoGameInstance::OnStartOnlineGameComplete(FName SessionName, bool bWasSuccessful)
{
	GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Red, FString::Printf(TEXT("OnStartSessionComplete %s, %s"), *SessionName.ToString(), bWasSuccessful ? TEXT("sucess"): TEXT("fail")));

    // Get the Session Interface to clear the Delegate
    IOnlineSessionPtr Sessions = GetSession();
    if (Sessions.IsValid())
    {
        // Clear the delegate, since we are done with this call
        Sessions->ClearOnStartSessionCompleteDelegate_Handle(OnStartSessionCompleteDelegateHandle);
    }

	// If the start was successful, we can open a NewMap if we want. Make sure to use "listen" as a parameter!
	if (bWasSuccessful)
	{
		UGameplayStatics::OpenLevel(GetWorld(), "ThirdPersonExampleMap", true, "listen");
	}
}
开发者ID:erichen,项目名称:trnetdemo,代码行数:18,代码来源:trnetDemoGameInstance.cpp

示例4: OnStartOnlineGameComplete

void UUModGameInstance::OnStartOnlineGameComplete(FName SessionName, bool bWasSuccessful)
{
	GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Red, FString::Printf(TEXT("OnStartSessionComplete %s, %d"), *SessionName.ToString(), bWasSuccessful));

	IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
	if (OnlineSub)
	{
		IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
		if (Sessions.IsValid())
		{
			Sessions->ClearOnStartSessionCompleteDelegate_Handle(OnStartSessionCompleteDelegateHandle);
		}
	}
	
	if (bWasSuccessful)
	{
		DelayedRunMap = true;
	}	
}
开发者ID:mrG7,项目名称:UMod,代码行数:19,代码来源:UModGameInstance.cpp


注:本文中的IOnlineSessionPtr::ClearOnStartSessionCompleteDelegate_Handle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。