本文整理汇总了C++中IOnlineSessionPtr::AddOnJoinSessionCompleteDelegate_Handle方法的典型用法代码示例。如果您正苦于以下问题:C++ IOnlineSessionPtr::AddOnJoinSessionCompleteDelegate_Handle方法的具体用法?C++ IOnlineSessionPtr::AddOnJoinSessionCompleteDelegate_Handle怎么用?C++ IOnlineSessionPtr::AddOnJoinSessionCompleteDelegate_Handle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOnlineSessionPtr
的用法示例。
在下文中一共展示了IOnlineSessionPtr::AddOnJoinSessionCompleteDelegate_Handle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JoinSession
// Join Session
bool URadeGameInstance::JoinSession(TSharedPtr<const FUniqueNetId> UserId, FName SessionName, const FOnlineSessionSearchResult& SearchResult)
{
// Return bool
bool bSuccessful = false;
// Get OnlineSubsystem we want to work with
IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
if (OnlineSub)
{
// Get SessionInterface from the OnlineSubsystem
IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
if (Sessions.IsValid() && UserId.IsValid())
{
// Set the Handle again
OnJoinSessionCompleteDelegateHandle = Sessions->AddOnJoinSessionCompleteDelegate_Handle(OnJoinSessionCompleteDelegate);
// Call the "JoinSession" Function with the passed "SearchResult". The "SessionSearch->SearchResults" can be used to get such a
// "FOnlineSessionSearchResult" and pass it. Pretty straight forward!
bSuccessful = Sessions->JoinSession(*UserId, SessionName, SearchResult);
}
}
return bSuccessful;
}
示例2: JoinSessionA
bool UtrnetDemoGameInstance::JoinSessionA(TSharedPtr<const FUniqueNetId> UserId, FName SessionName, const FOnlineSessionSearchResult& SearchResult)
{
// Get SessionInterface from the OnlineSubsystem
IOnlineSessionPtr Sessions = GetSession();
if (!Sessions.IsValid() || !UserId.IsValid())
{
return false;
}
// Set the Handle again
OnJoinSessionCompleteDelegateHandle = Sessions->AddOnJoinSessionCompleteDelegate_Handle(OnJoinSessionCompleteDelegate);
// Call the "JoinSession" Function with the passed "SearchResult". The "SessionSearch->SearchResults" can be used to get such a
// "FOnlineSessionSearchResult" and pass it. Pretty straight forward!
isLoading_ = true;
return Sessions->JoinSession(*UserId, SessionName, SearchResult);
}