default the auto stuff to false already

This commit is contained in:
Joshua (MordenTral) Statzer
2025-11-17 19:13:30 -05:00
parent 31aab9f75e
commit 50c38e90ae
2 changed files with 12 additions and 1 deletions

View File

@@ -44,10 +44,15 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = AdvancedVoiceInterface)
bool bEnableTalkingStatusDelegate;
// If true we will auto join a session we have accepted in the overlay.
// This can get in the way of Beacon Sessions, you may want to disable it.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = AdvancedFriendsInterface)
bool bAutoJoinSessionOnAcceptedUserInviteReceived = false;
// If true we will auto travel to a game session when an invite is received.
// This can get in the way of Beacon Sessions, you may want to disable it.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = AdvancedFriendsInterface)
bool bAutoTravelOnAcceptedUserInviteReceived = true;
bool bAutoTravelOnAcceptedUserInviteReceived = false;
//virtual void PostLoad() override;
virtual void Shutdown() override;

View File

@@ -22,9 +22,15 @@ UAdvancedFriendsGameInstance::UAdvancedFriendsGameInstance(const FObjectInitiali
void UAdvancedFriendsGameInstance::OnSessionUserInviteAccepted(const bool bWasSuccessful, const int32 ControllerId, FUniqueNetIdPtr UserId, const FOnlineSessionSearchResult& InviteResult)
{
if (!bAutoJoinSessionOnAcceptedUserInviteReceived)
return;
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());
if (SessionInterface.IsValid())
{
// Eventually call this?, would need another call back to run through
//SessionInterface->DestroySession(NAME_GameSession);
SessionInterface->ClearOnJoinSessionCompleteDelegate_Handle(OnJoinSessionCompleteDelegateHandle);
OnJoinSessionCompleteDelegateHandle = SessionInterface->AddOnJoinSessionCompleteDelegate_Handle(
FOnJoinSessionCompleteDelegate::CreateUObject(this, &UAdvancedFriendsGameInstance::OnJoinSessionComplete));