mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-23 00:14:24 +00:00
Fix: Issue #18 Update session not finding sessions to update
This commit is contained in:
@@ -29,9 +29,11 @@ UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::Update
|
||||
|
||||
void UUpdateSessionCallbackProxyAdvanced::Activate()
|
||||
{
|
||||
const FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("UpdateSession"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
||||
|
||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||
|
||||
if (Helper.OnlineSub != nullptr)
|
||||
{
|
||||
const auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
||||
if (Sessions.IsValid())
|
||||
{
|
||||
if (Sessions->GetNumSessions() < 1)
|
||||
@@ -94,6 +96,7 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
||||
{
|
||||
FFrame::KismetExecutionMessage(TEXT("Sessions not supported by Online Subsystem"), ELogVerbosity::Warning);
|
||||
}
|
||||
}
|
||||
// Fail immediately
|
||||
OnFailure.Broadcast();
|
||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Sessions not supported"));
|
||||
@@ -101,7 +104,11 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
||||
|
||||
void UUpdateSessionCallbackProxyAdvanced::OnUpdateCompleted(FName SessionName, bool bWasSuccessful)
|
||||
{
|
||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||
const FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("UpdateSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
||||
|
||||
if (Helper.OnlineSub != nullptr)
|
||||
{
|
||||
const auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
||||
if (Sessions.IsValid())
|
||||
{
|
||||
Sessions->ClearOnUpdateSessionCompleteDelegate_Handle(OnUpdateSessionCompleteDelegateHandle);
|
||||
@@ -112,6 +119,7 @@ void UUpdateSessionCallbackProxyAdvanced::OnUpdateCompleted(FName SessionName, b
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bWasSuccessful)
|
||||
{
|
||||
|
Reference in New Issue
Block a user