本文整理汇总了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");
}
}
示例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);
}
}
示例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");
}
}
示例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;
}
}