Пример #1
0
/**
 * Destroys an existing session of a given name
 *
 * @param SessionName name of session to destroy
 * @param Delegate delegate to call at session destruction
 */
void UOnlineSessionClient::DestroyExistingSession(FName SessionName, FOnDestroySessionCompleteDelegate& Delegate)
{
	if (SessionInt.IsValid())
	{
		SessionInt->AddOnDestroySessionCompleteDelegate(Delegate);
		SessionInt->DestroySession(SessionName);
	}
	else
	{
		Delegate.ExecuteIfBound(SessionName, true);
	}
}
void UOnlineSessionClient::DestroyExistingSession_Impl(FDelegateHandle& OutResult, FName SessionName, FOnDestroySessionCompleteDelegate& Delegate)
{
	IOnlineSessionPtr SessionInt = GetSessionInt();

	if (SessionInt.IsValid())
	{
		OutResult = SessionInt->AddOnDestroySessionCompleteDelegate_Handle(Delegate);
		SessionInt->DestroySession(SessionName);
	}
	else
	{
		OutResult.Reset();
		Delegate.ExecuteIfBound(SessionName, true);
	}
}