本文整理汇总了C++中IOnlineSessionPtr::ClearOnDestroySessionCompleteDelegate_Handle方法的典型用法代码示例。如果您正苦于以下问题:C++ IOnlineSessionPtr::ClearOnDestroySessionCompleteDelegate_Handle方法的具体用法?C++ IOnlineSessionPtr::ClearOnDestroySessionCompleteDelegate_Handle怎么用?C++ IOnlineSessionPtr::ClearOnDestroySessionCompleteDelegate_Handle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOnlineSessionPtr
的用法示例。
在下文中一共展示了IOnlineSessionPtr::ClearOnDestroySessionCompleteDelegate_Handle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDestroyForJoinSessionComplete
void UOnlineSessionClient::OnDestroyForJoinSessionComplete(FName SessionName, bool bWasSuccessful)
{
UE_LOG(LogOnline, Verbose, TEXT("OnDestroyForJoinSessionComplete %s bSuccess: %d"), *SessionName.ToString(), bWasSuccessful);
IOnlineSessionPtr SessionInt = GetSessionInt();
if (SessionInt.IsValid())
{
SessionInt->ClearOnDestroySessionCompleteDelegate_Handle(OnDestroyForJoinSessionCompleteDelegateHandle);
}
if (bWasSuccessful)
{
JoinSession(SessionName, CachedSessionResult);
}
bHandlingDisconnect = false;
}
示例2: OnDestroyForMainMenuComplete
void UOnlineSessionClient::OnDestroyForMainMenuComplete(FName SessionName, bool bWasSuccessful)
{
UE_LOG(LogOnline, Verbose, TEXT("OnDestroyForMainMenuComplete %s bSuccess: %d"), *SessionName.ToString(), bWasSuccessful);
IOnlineSessionPtr SessionInt = GetSessionInt();
if (SessionInt.IsValid())
{
SessionInt->ClearOnDestroySessionCompleteDelegate_Handle(OnDestroyForMainMenuCompleteDelegateHandle);
}
UWorld* World = GetWorld();
UNetDriver* NetDriver = World ? World->GetNetDriver() : nullptr;
// Call disconnect to force us back to the menu level
GEngine->HandleDisconnect(World, NetDriver);
bHandlingDisconnect = false;
}
示例3: OnDestroySessionComplete
void UtrnetDemoGameInstance::OnDestroySessionComplete(FName SessionName, bool bWasSuccessful)
{
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Red, FString::Printf(TEXT("OnDestroySessionComplete %s, %d"), *SessionName.ToString(), bWasSuccessful));
// Get the SessionInterface from the OnlineSubsystem
IOnlineSessionPtr Sessions = GetSession();
if (!Sessions.IsValid())
{
return;
}
// Clear the Delegate
Sessions->ClearOnDestroySessionCompleteDelegate_Handle(OnDestroySessionCompleteDelegateHandle);
// If it was successful, we just load another level (could be a MainMenu!)
if (bWasSuccessful)
{
UGameplayStatics::OpenLevel(GetWorld(), "Startup", true);
}
}
示例4: OnDestroySessionComplete
// Destroy Session And return to Start Map
void URadeGameInstance::OnDestroySessionComplete(FName SessionName, bool bWasSuccessful)
{
// Get the OnlineSubsystem we want to work with
IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
if (OnlineSub)
{
// Get the SessionInterface from the OnlineSubsystem
IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
if (Sessions.IsValid())
{
// Clear the Delegate
Sessions->ClearOnDestroySessionCompleteDelegate_Handle(OnDestroySessionCompleteDelegateHandle);
// If it was successful, we just load another level (could be a MainMenu!)
if (bWasSuccessful)
{
UGameplayStatics::OpenLevel(GetWorld(), "SelectMap", true);
}
}
}
}