diff --git a/Plugins/AdvancedSessionsPlugin-master/.gitattributes b/Plugins/AdvancedSessionsPlugin-master/.gitattributes deleted file mode 100644 index 3373152..0000000 --- a/Plugins/AdvancedSessionsPlugin-master/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -* text=auto -*.bat eol=crlf \ No newline at end of file diff --git a/Plugins/AdvancedSessionsPlugin-master/.gitignore b/Plugins/AdvancedSessionsPlugin-master/.gitignore deleted file mode 100644 index 3cdb673..0000000 --- a/Plugins/AdvancedSessionsPlugin-master/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ - -.hg/ -binaries/ -deriveddatacache/ -.vs/ -build/ -intermediate/ -PACKPLUGIN/ -saved/ -*.orig \ No newline at end of file diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedVoiceLibrary.h b/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedVoiceLibrary.h deleted file mode 100644 index 7f75b6c..0000000 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedVoiceLibrary.h +++ /dev/null @@ -1,99 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. - -#pragma once -#include "CoreMinimal.h" -#include "Kismet/BlueprintFunctionLibrary.h" -#include "BlueprintDataDefinitions.h" -#include "Online.h" -#include "OnlineSubsystem.h" -#include "Interfaces/VoiceInterface.h" -//#include "OnlineFriendsInterface.h" -//#include "OnlineUserInterface.h" -//#include "OnlineMessageInterface.h" -//#include "OnlinePresenceInterface.h" -#include "Engine/GameInstance.h" -//#include "OnlineSessionInterface.h" - -#include "UObject/UObjectIterator.h" - -#include "AdvancedVoiceLibrary.generated.h" - - -//General Advanced Sessions Log -DECLARE_LOG_CATEGORY_EXTERN(AdvancedVoiceLog, Log, All); - - -UCLASS() -class UAdvancedVoiceLibrary : public UBlueprintFunctionLibrary -{ - GENERATED_BODY() -public: - - //********* Voice Library Functions *************// - - // Get if a headset is present for the specified local user - UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo") - static void IsHeadsetPresent(bool & bHasHeadset, uint8 LocalPlayerNum = 0); - - // Starts networked voice, allows push to talk in coordination with StopNetworkedVoice - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice") - static void StartNetworkedVoice(uint8 LocalPlayerNum = 0); - - // Stops networked voice, allows push to talk in coordination with StartNetworkedVoice - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice") - static void StopNetworkedVoice(uint8 LocalPlayerNum = 0); - - // Registers a local player as someone interested in voice data - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice") - static bool RegisterLocalTalker(uint8 LocalPlayerNum = 0); - - // Registers all signed in players as local talkers - // This is already done automatically, only do it manually if you unregistered someone - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice") - static void RegisterAllLocalTalkers(); - - // UnRegisters local player as a local talker - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice") - static void UnRegisterLocalTalker(uint8 LocalPlayerNum = 0); - - // UnRegisters all signed in players as local talkers - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice") - static void UnRegisterAllLocalTalkers(); - - // Registers a remote player as a talker - // This is already done automatically, only do it manually if you unregistered someone - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice") - static bool RegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId); - - // UnRegisters a remote player as a talker - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice") - static bool UnRegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId); - - // UnRegisters all remote players as talkers - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice") - static void RemoveAllRemoteTalkers(); - - // Returns whether a local player is currently talking - UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo") - static bool IsLocalPlayerTalking(uint8 LocalPlayerNum); - - // Returns whether a remote player is currently talking - UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo") - static bool IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNetId); - - // Returns whether a player is muted for the specified local player - UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo") - static bool IsPlayerMuted(uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId); - - // Mutes the player associated with the uniquenetid for the specified local player, if IsSystemWide is true then it will attempt to mute globally for the player - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice") - static bool MuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide = false); - - // UnMutes the player associated with the uniquenetid for the specified local player, if IsSystemWide is true then it will attempt to unmute globally for the player - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice") - static bool UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide = false); - - // Gets the number of local talkers for this system - UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo") - static void GetNumLocalTalkers(int32 & NumLocalTalkers); -}; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp b/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp deleted file mode 100644 index f491524..0000000 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp +++ /dev/null @@ -1,254 +0,0 @@ -// Fill out your copyright notice in the Description page of Project Settings. -#include "AdvancedVoiceLibrary.h" - - -//General Log -DEFINE_LOG_CATEGORY(AdvancedVoiceLog); - -void UAdvancedVoiceLibrary::IsHeadsetPresent(bool & bHasHeadset, uint8 LocalPlayerNum) -{ - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - bHasHeadset = false; - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Check For Headset couldn't get the voice interface!")); - return; - } - - bHasHeadset = VoiceInterface->IsHeadsetPresent(LocalPlayerNum); -} - -void UAdvancedVoiceLibrary::StartNetworkedVoice(uint8 LocalPlayerNum) -{ - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Start Networked Voice couldn't get the voice interface!")); - return; - } - - VoiceInterface->StartNetworkedVoice(LocalPlayerNum); -} - -void UAdvancedVoiceLibrary::StopNetworkedVoice(uint8 LocalPlayerNum) -{ - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Start Networked Voice couldn't get the voice interface!")); - return; - } - - VoiceInterface->StopNetworkedVoice(LocalPlayerNum); -} - -bool UAdvancedVoiceLibrary::RegisterLocalTalker(uint8 LocalPlayerNum) -{ - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Register Local Talker couldn't get the voice interface!")); - return false; - } - - return VoiceInterface->RegisterLocalTalker(LocalPlayerNum); -} - -void UAdvancedVoiceLibrary::RegisterAllLocalTalkers() -{ - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Register Local Talkers couldn't get the voice interface!")); - return; - } - - VoiceInterface->RegisterLocalTalkers(); -} - - -void UAdvancedVoiceLibrary::UnRegisterLocalTalker(uint8 LocalPlayerNum) -{ - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Unregister Local Talker couldn't get the voice interface!")); - return; - } - - VoiceInterface->UnregisterLocalTalker(LocalPlayerNum); -} - -void UAdvancedVoiceLibrary::UnRegisterAllLocalTalkers() -{ - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("UnRegister All Local Talkers couldn't get the voice interface!")); - return; - } - - VoiceInterface->UnregisterLocalTalkers(); -} - -bool UAdvancedVoiceLibrary::RegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId) -{ - if (!UniqueNetId.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Register Remote Talker was passed an invalid unique net id!")); - return false; - } - - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Register Remote Talker couldn't get the voice interface!")); - return false; - } - - return VoiceInterface->RegisterRemoteTalker(*UniqueNetId.GetUniqueNetId()); -} - -bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId) -{ - if (!UniqueNetId.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("UnRegister Remote Talker was passed an invalid unique net id!")); - return false; - } - - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("UnRegister Remote Talker couldn't get the voice interface!")); - return false; - } - - return VoiceInterface->UnregisterRemoteTalker(*UniqueNetId.GetUniqueNetId()); -} - -void UAdvancedVoiceLibrary::RemoveAllRemoteTalkers() -{ - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Remove All Remote Talkers couldn't get the voice interface!")); - return; - } - - VoiceInterface->RemoveAllRemoteTalkers(); -} - -bool UAdvancedVoiceLibrary::IsLocalPlayerTalking(uint8 LocalPlayerNum) -{ - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Local Player Talking couldn't get the voice interface!")); - return false; - } - - return VoiceInterface->IsLocalPlayerTalking(LocalPlayerNum); -} - -bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNetId) -{ - if (!UniqueNetId.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Remote Player Talking was passed an invalid unique net id!")); - return false; - } - - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Remote Player Talking couldn't get the voice interface!")); - return false; - } - - return VoiceInterface->IsRemotePlayerTalking(*UniqueNetId.GetUniqueNetId()); -} - -bool UAdvancedVoiceLibrary::IsPlayerMuted(uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId) -{ - if (!UniqueNetId.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Player Muted was passed an invalid unique net id!")); - return false; - } - - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Player Muted couldn't get the voice interface!")); - return false; - } - - return VoiceInterface->IsMuted(LocalUserNumChecking, *UniqueNetId.GetUniqueNetId()); -} - -bool UAdvancedVoiceLibrary::MuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide) -{ - if (!UniqueNetId.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Mute Remote Talker was passed an invalid unique net id!")); - return false; - } - - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Mute Remote Talker couldn't get the voice interface!")); - return false; - } - - return VoiceInterface->MuteRemoteTalker(LocalUserNum, *UniqueNetId.GetUniqueNetId(), bIsSystemWide); -} - -bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide) -{ - if (!UniqueNetId.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Unmute Remote Talker was passed an invalid unique net id!")); - return false; - } - - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Unmute Remote Talker couldn't get the voice interface!")); - return false; - } - - return VoiceInterface->UnmuteRemoteTalker(LocalUserNum, *UniqueNetId.GetUniqueNetId(), bIsSystemWide); -} - - -void UAdvancedVoiceLibrary::GetNumLocalTalkers(int32 & NumLocalTalkers) -{ - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - - if (!VoiceInterface.IsValid()) - { - NumLocalTalkers = 0; - UE_LOG(AdvancedVoiceLog, Warning, TEXT("Unmute Remote Talker couldn't get the voice interface!")); - return; - } - - NumLocalTalkers = VoiceInterface->GetNumLocalTalkers(); -} \ No newline at end of file diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AutoLoginUserCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AutoLoginUserCallbackProxy.cpp deleted file mode 100644 index c6dee0e..0000000 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AutoLoginUserCallbackProxy.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. - -#include "AutoLoginUserCallbackProxy.h" -#include "Kismet/GameplayStatics.h" - -////////////////////////////////////////////////////////////////////////// -// ULoginUserCallbackProxy - -UAutoLoginUserCallbackProxy::UAutoLoginUserCallbackProxy(const FObjectInitializer& ObjectInitializer) - : Super(ObjectInitializer) - , Delegate(FOnLoginCompleteDelegate::CreateUObject(this, &ThisClass::OnCompleted)) -{ -} - -UAutoLoginUserCallbackProxy* UAutoLoginUserCallbackProxy::AutoLoginUser(UObject* WorldContextObject, int32 LocalUserNum) -{ - UAutoLoginUserCallbackProxy* Proxy = NewObject(); - Proxy->LocalUserNumber = LocalUserNum; - Proxy->WorldContextObject = WorldContextObject; - return Proxy; -} - -void UAutoLoginUserCallbackProxy::Activate() -{ - auto Identity = Online::GetIdentityInterface(); - - if (Identity.IsValid()) - { - DelegateHandle = Identity->AddOnLoginCompleteDelegate_Handle(LocalUserNumber, Delegate); - Identity->AutoLogin(LocalUserNumber); - return; - } - - // Fail immediately - OnFailure.Broadcast(); -} - -void UAutoLoginUserCallbackProxy::OnCompleted(int32 LocalUserNum, bool bWasSuccessful, const FUniqueNetId& UserId, const FString& ErrorVal) -{ - auto Identity = Online::GetIdentityInterface(); - - if (Identity.IsValid()) - { - Identity->ClearOnLoginCompleteDelegate_Handle(LocalUserNum, DelegateHandle); - } - - if(APlayerController* PController = UGameplayStatics::GetPlayerController(WorldContextObject->GetWorld(), LocalUserNum)) - { - ULocalPlayer* Player = Cast(PController->Player); - - FUniqueNetIdRepl uniqueId(UserId.AsShared()); - - if (Player) - { - Player->SetCachedUniqueNetId(uniqueId); - } - - if (APlayerState* State = PController->PlayerState) - { - // Update UniqueId. See also ShowLoginUICallbackProxy.cpp - State->SetUniqueId(uniqueId); - } - } - - - if (bWasSuccessful) - { - OnSuccess.Broadcast(); - } - else - { - OnFailure.Broadcast(); - } -} diff --git a/Plugins/AdvancedSessionsPlugin-master/LICENSE.txt b/Plugins/AdvancedSessionsPlugin-master/LICENSE.txt deleted file mode 100644 index 986c999..0000000 --- a/Plugins/AdvancedSessionsPlugin-master/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright Joshua Statzer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/Plugins/AdvancedSessionsPlugin-master/README.md b/Plugins/AdvancedSessionsPlugin-master/README.md deleted file mode 100644 index c83724b..0000000 --- a/Plugins/AdvancedSessionsPlugin-master/README.md +++ /dev/null @@ -1,7 +0,0 @@ -### How do I use it? ### - -**KantanDocGen Automatic Documentation ([KantanDocGen](http://kantandev.com/free/kantan-doc-gen))** - -**[AdvancedSessions](https://vreue4.com/generated-node-documentation?section=advanced-sessions-plugin)** - -**[AdvancedSteamSessions](https://vreue4.com/generated-node-documentation?section=advanced-steam-sessions-plugin)** diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/AdvancedSessions.uplugin b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/AdvancedSessions.uplugin similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/AdvancedSessions.uplugin rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/AdvancedSessions.uplugin diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Config/FilterPlugin.ini b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Config/FilterPlugin.ini similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Config/FilterPlugin.ini rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Config/FilterPlugin.ini diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Resources/Icon128.png b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Resources/Icon128.png similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Resources/Icon128.png rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Resources/Icon128.png diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/AdvancedSessions.Build.cs b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/AdvancedSessions.Build.cs similarity index 80% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/AdvancedSessions.Build.cs rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/AdvancedSessions.Build.cs index d367fcb..a305151 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/AdvancedSessions.Build.cs +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/AdvancedSessions.Build.cs @@ -13,6 +13,5 @@ public class AdvancedSessions : ModuleRules // PrivateIncludePaths.AddRange(new string[] { "AdvancedSessions/Private"/*, "OnlineSubsystemSteam/Private"*/ }); // PublicIncludePaths.AddRange(new string[] { "AdvancedSessions/Public" }); PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem", "CoreUObject", "OnlineSubsystemUtils", "Networking", "Sockets"/*"Voice", "OnlineSubsystemSteam"*/ }); - PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "Sockets", "Networking", "OnlineSubsystemUtils" /*"Voice", "Steamworks","OnlineSubsystemSteam"*/}); } } \ No newline at end of file diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedExternalUILibrary.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedExternalUILibrary.h similarity index 53% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedExternalUILibrary.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedExternalUILibrary.h index 968f623..6153ed3 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedExternalUILibrary.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedExternalUILibrary.h @@ -32,32 +32,32 @@ public: //********* External UI Functions *************// // Show the UI that handles the Friends list - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result")) - static void ShowFriendsUI(APlayerController *PlayerController, EBlueprintResultSwitch &Result); + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject")) + static void ShowFriendsUI(UObject* WorldContextObject, APlayerController *PlayerController, EBlueprintResultSwitch &Result); // Show the UI that handles inviting people to your game - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result")) - static void ShowInviteUI(APlayerController *PlayerController, EBlueprintResultSwitch &Result); + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject")) + static void ShowInviteUI(UObject* WorldContextObject, APlayerController *PlayerController, EBlueprintResultSwitch &Result); // Show the UI that shows the leaderboard (doesn't work with steam) - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result")) - static void ShowLeaderBoardUI(FString LeaderboardName, EBlueprintResultSwitch &Result); + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject")) + static void ShowLeaderBoardUI(UObject* WorldContextObject, FString LeaderboardName, EBlueprintResultSwitch &Result); // Show the UI that shows a web URL - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", AutoCreateRefTerm = "AllowedDomains")) - static void ShowWebURLUI(FString URLToShow, EBlueprintResultSwitch &Result, TArray& AllowedDomains, bool bEmbedded = false , bool bShowBackground = false, bool bShowCloseButton = false, int32 OffsetX = 0, int32 OffsetY = 0, int32 SizeX = 0, int32 SizeY = 0); + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", AutoCreateRefTerm = "AllowedDomains", WorldContext = "WorldContextObject")) + static void ShowWebURLUI(UObject* WorldContextObject, FString URLToShow, EBlueprintResultSwitch &Result, TArray& AllowedDomains, bool bEmbedded = false , bool bShowBackground = false, bool bShowCloseButton = false, int32 OffsetX = 0, int32 OffsetY = 0, int32 SizeX = 0, int32 SizeY = 0); // Show the UI that shows a web URL - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI") - static void CloseWebURLUI(); + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (WorldContext = "WorldContextObject")) + static void CloseWebURLUI(UObject* WorldContextObject); // Show the UI that shows the profile of a uniquenetid - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result")) - static void ShowProfileUI(const FBPUniqueNetId PlayerViewingProfile, const FBPUniqueNetId PlayerToViewProfileOf, EBlueprintResultSwitch &Result); + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject")) + static void ShowProfileUI(UObject* WorldContextObject, const FBPUniqueNetId PlayerViewingProfile, const FBPUniqueNetId PlayerToViewProfileOf, EBlueprintResultSwitch &Result); // Show the UI that shows the account upgrade UI (doesn't work with steam) - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result")) - static void ShowAccountUpgradeUI(const FBPUniqueNetId PlayerRequestingAccountUpgradeUI, EBlueprintResultSwitch &Result); + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject")) + static void ShowAccountUpgradeUI(UObject* WorldContextObject, const FBPUniqueNetId PlayerRequestingAccountUpgradeUI, EBlueprintResultSwitch &Result); }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsGameInstance.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsGameInstance.h similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsGameInstance.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsGameInstance.h diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsInterface.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsInterface.h similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsInterface.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsInterface.h diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsLibrary.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsLibrary.h similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsLibrary.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsLibrary.h diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedGameSession.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedGameSession.h similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedGameSession.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedGameSession.h diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedIdentityLibrary.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedIdentityLibrary.h similarity index 72% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedIdentityLibrary.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedIdentityLibrary.h index 392ab8c..5f0dc15 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedIdentityLibrary.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedIdentityLibrary.h @@ -28,26 +28,26 @@ public: //********* Identity Functions *************// // Get the login status of a local player - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity", meta = (ExpandEnumAsExecs = "Result")) - static void GetLoginStatus(const FBPUniqueNetId & UniqueNetID, EBPLoginStatus & LoginStatus, EBlueprintResultSwitch &Result); + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject")) + static void GetLoginStatus(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetID, EBPLoginStatus & LoginStatus, EBlueprintResultSwitch &Result); // Get the auth token for a local player - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity", meta = (ExpandEnumAsExecs = "Result")) - static void GetPlayerAuthToken(APlayerController * PlayerController, FString & AuthToken, EBlueprintResultSwitch &Result); + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject")) + static void GetPlayerAuthToken(UObject* WorldContextObject, APlayerController * PlayerController, FString & AuthToken, EBlueprintResultSwitch &Result); // Get a players nickname - UFUNCTION(BlueprintPure, Category = "Online|AdvancedIdentity") - static void GetPlayerNickname(const FBPUniqueNetId & UniqueNetID, FString & PlayerNickname); + UFUNCTION(BlueprintPure, Category = "Online|AdvancedIdentity", meta = (WorldContext = "WorldContextObject")) + static void GetPlayerNickname(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetID, FString & PlayerNickname); //********* User Account Functions *************// // Get a users account - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity|UserAccount", meta = (ExpandEnumAsExecs = "Result")) - static void GetUserAccount(const FBPUniqueNetId & UniqueNetId, FBPUserOnlineAccount & AccountInfo, EBlueprintResultSwitch &Result); + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity|UserAccount", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject")) + static void GetUserAccount(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetId, FBPUserOnlineAccount & AccountInfo, EBlueprintResultSwitch &Result); // Get all known users accounts - UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity|UserAccount", meta = (ExpandEnumAsExecs = "Result")) - static void GetAllUserAccounts(TArray & AccountInfos, EBlueprintResultSwitch &Result); + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity|UserAccount", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject")) + static void GetAllUserAccounts(UObject* WorldContextObject, TArray & AccountInfos, EBlueprintResultSwitch &Result); // Get a user account access token UFUNCTION(BlueprintPure, Category = "Online|AdvancedIdentity|UserAccount") diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessions.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessions.h similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessions.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessions.h diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessionsLibrary.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessionsLibrary.h similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessionsLibrary.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessionsLibrary.h index 54153ae..457bcdd 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessionsLibrary.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessionsLibrary.h @@ -172,6 +172,10 @@ public: UFUNCTION(BlueprintPure, meta = (DisplayName = "Equal Unique Net ID", CompactNodeTitle = "==", Keywords = "== equal"), Category = "Online|AdvancedSessions|PlayerInfo|PlayerID") static bool EqualEqual_UNetIDUnetID(const FBPUniqueNetId &A, const FBPUniqueNetId &B); + /** Converts a FBPUniqueNetID into a FUniqueNetID_Repl */ + UFUNCTION(BlueprintPure, meta = (DisplayName = "ToUniqueNetIDRepl (Unique Net ID)", CompactNodeTitle = "->", BlueprintAutocast), Category = "Online|AdvancedSessions|PlayerInfo|PlayerID") + static FUniqueNetIdRepl Conv_BPUniqueIDToUniqueNetIDRepl(const FBPUniqueNetId& InUniqueID); + // Check if a UniqueNetId is a friend UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|UniqueNetId") static void UniqueNetIdToString(const FBPUniqueNetId &UniqueNetId, FString &String); diff --git a/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedVoiceLibrary.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedVoiceLibrary.h new file mode 100644 index 0000000..da1128d --- /dev/null +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedVoiceLibrary.h @@ -0,0 +1,99 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "BlueprintDataDefinitions.h" +#include "Online.h" +#include "OnlineSubsystem.h" +#include "Interfaces/VoiceInterface.h" +//#include "OnlineFriendsInterface.h" +//#include "OnlineUserInterface.h" +//#include "OnlineMessageInterface.h" +//#include "OnlinePresenceInterface.h" +#include "Engine/GameInstance.h" +//#include "OnlineSessionInterface.h" + +#include "UObject/UObjectIterator.h" + +#include "AdvancedVoiceLibrary.generated.h" + + +//General Advanced Sessions Log +DECLARE_LOG_CATEGORY_EXTERN(AdvancedVoiceLog, Log, All); + + +UCLASS() +class UAdvancedVoiceLibrary : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() +public: + + //********* Voice Library Functions *************// + + // Get if a headset is present for the specified local user + UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo", meta = (WorldContext = "WorldContextObject")) + static void IsHeadsetPresent(UObject* WorldContextObject, bool & bHasHeadset, uint8 LocalPlayerNum = 0); + + // Starts networked voice, allows push to talk in coordination with StopNetworkedVoice + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject")) + static void StartNetworkedVoice(UObject* WorldContextObject, uint8 LocalPlayerNum = 0); + + // Stops networked voice, allows push to talk in coordination with StartNetworkedVoice + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject")) + static void StopNetworkedVoice(UObject* WorldContextObject, uint8 LocalPlayerNum = 0); + + // Registers a local player as someone interested in voice data + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject")) + static bool RegisterLocalTalker(UObject* WorldContextObject, uint8 LocalPlayerNum = 0); + + // Registers all signed in players as local talkers + // This is already done automatically, only do it manually if you unregistered someone + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject")) + static void RegisterAllLocalTalkers(UObject* WorldContextObject); + + // UnRegisters local player as a local talker + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject")) + static void UnRegisterLocalTalker(UObject* WorldContextObject, uint8 LocalPlayerNum = 0); + + // UnRegisters all signed in players as local talkers + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject")) + static void UnRegisterAllLocalTalkers(UObject* WorldContextObject); + + // Registers a remote player as a talker + // This is already done automatically, only do it manually if you unregistered someone + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject")) + static bool RegisterRemoteTalker(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId); + + // UnRegisters a remote player as a talker + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject")) + static bool UnRegisterRemoteTalker(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId); + + // UnRegisters all remote players as talkers + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject")) + static void RemoveAllRemoteTalkers(UObject* WorldContextObject); + + // Returns whether a local player is currently talking + UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo", meta = (WorldContext = "WorldContextObject")) + static bool IsLocalPlayerTalking(UObject* WorldContextObject, uint8 LocalPlayerNum); + + // Returns whether a remote player is currently talking + UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo", meta = (WorldContext = "WorldContextObject")) + static bool IsRemotePlayerTalking(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId); + + // Returns whether a player is muted for the specified local player + UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo", meta = (WorldContext = "WorldContextObject")) + static bool IsPlayerMuted(UObject* WorldContextObject, uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId); + + // Mutes the player associated with the uniquenetid for the specified local player, if IsSystemWide is true then it will attempt to mute globally for the player + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject")) + static bool MuteRemoteTalker(UObject* WorldContextObject, uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide = false); + + // UnMutes the player associated with the uniquenetid for the specified local player, if IsSystemWide is true then it will attempt to unmute globally for the player + UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject")) + static bool UnMuteRemoteTalker(UObject* WorldContextObject, uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide = false); + + // Gets the number of local talkers for this system + UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo", meta = (WorldContext = "WorldContextObject")) + static void GetNumLocalTalkers(UObject* WorldContextObject, int32 & NumLocalTalkers); +}; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AutoLoginUserCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AutoLoginUserCallbackProxy.h similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AutoLoginUserCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AutoLoginUserCallbackProxy.h index dc91cff..d07a666 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/AutoLoginUserCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AutoLoginUserCallbackProxy.h @@ -51,5 +51,5 @@ private: FDelegateHandle DelegateHandle; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/BlueprintDataDefinitions.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/BlueprintDataDefinitions.h similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/BlueprintDataDefinitions.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/BlueprintDataDefinitions.h diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/CancelFindSessionsCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CancelFindSessionsCallbackProxy.h similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/CancelFindSessionsCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CancelFindSessionsCallbackProxy.h index 59ebff3..58d2ea0 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/CancelFindSessionsCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CancelFindSessionsCallbackProxy.h @@ -42,5 +42,5 @@ private: FDelegateHandle DelegateHandle; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/CreateSessionCallbackProxyAdvanced.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CreateSessionCallbackProxyAdvanced.h similarity index 99% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/CreateSessionCallbackProxyAdvanced.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CreateSessionCallbackProxyAdvanced.h index 013ff0b..04ae6d1 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/CreateSessionCallbackProxyAdvanced.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CreateSessionCallbackProxyAdvanced.h @@ -102,6 +102,6 @@ private: TArray ExtraSettings; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/EndSessionCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/EndSessionCallbackProxy.h similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/EndSessionCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/EndSessionCallbackProxy.h index 756c645..e527c58 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/EndSessionCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/EndSessionCallbackProxy.h @@ -45,5 +45,5 @@ private: FDelegateHandle DelegateHandle; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/FindFriendSessionCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindFriendSessionCallbackProxy.h similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/FindFriendSessionCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindFriendSessionCallbackProxy.h index 6876995..58ef8f5 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/FindFriendSessionCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindFriendSessionCallbackProxy.h @@ -46,6 +46,6 @@ private: FDelegateHandle FindFriendSessionCompleteDelegateHandle; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h similarity index 98% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h index a998ba3..e610277 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h @@ -105,5 +105,5 @@ private: int MinSlotsAvailable; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/GetFriendsCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetFriendsCallbackProxy.h similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/GetFriendsCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetFriendsCallbackProxy.h index 57be8f7..844bef6 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/GetFriendsCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetFriendsCallbackProxy.h @@ -44,6 +44,6 @@ private: //EBPFriendsLists FriendListToGet; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/GetRecentPlayersCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetRecentPlayersCallbackProxy.h similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/GetRecentPlayersCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetRecentPlayersCallbackProxy.h index d0d7af4..2b12c9f 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/GetRecentPlayersCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetRecentPlayersCallbackProxy.h @@ -44,6 +44,6 @@ private: FOnQueryRecentPlayersCompleteDelegate QueryRecentPlayersCompleteDelegate; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/GetUserPrivilegeCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetUserPrivilegeCallbackProxy.h similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/GetUserPrivilegeCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetUserPrivilegeCallbackProxy.h index 448ab59..f47d2a5 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/GetUserPrivilegeCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetUserPrivilegeCallbackProxy.h @@ -41,5 +41,5 @@ private: EBPUserPrivileges UserPrivilege; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/LoginUserCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LoginUserCallbackProxy.h similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/LoginUserCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LoginUserCallbackProxy.h index 08bfd4c..ba65b68 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/LoginUserCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LoginUserCallbackProxy.h @@ -51,5 +51,5 @@ private: FDelegateHandle DelegateHandle; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/LogoutUserCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LogoutUserCallbackProxy.h similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/LogoutUserCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LogoutUserCallbackProxy.h index 9907095..5f85b0a 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/LogoutUserCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LogoutUserCallbackProxy.h @@ -43,5 +43,5 @@ private: FDelegateHandle DelegateHandle; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/OnlineSubSystemHeader.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/OnlineSubSystemHeader.h similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/OnlineSubSystemHeader.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/OnlineSubSystemHeader.h diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/SendFriendInviteCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/SendFriendInviteCallbackProxy.h similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/SendFriendInviteCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/SendFriendInviteCallbackProxy.h index ca5c352..e878f51 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/SendFriendInviteCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/SendFriendInviteCallbackProxy.h @@ -44,6 +44,6 @@ private: FOnSendInviteComplete OnSendInviteCompleteDelegate; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/StartSessionCallbackProxyAdvanced.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/StartSessionCallbackProxyAdvanced.h similarity index 94% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/StartSessionCallbackProxyAdvanced.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/StartSessionCallbackProxyAdvanced.h index 246fc50..e82cce8 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/StartSessionCallbackProxyAdvanced.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/StartSessionCallbackProxyAdvanced.h @@ -25,7 +25,7 @@ class UStartSessionCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase , meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject") , Category = "Online|AdvancedSessions" ) - static UStartSessionCallbackProxyAdvanced* StartAdvancedSession(const UObject* WorldContextObject); + static UStartSessionCallbackProxyAdvanced* StartAdvancedSession(UObject* WorldContextObject); // UOnlineBlueprintCallProxyBase interface virtual void Activate() override; @@ -42,5 +42,5 @@ private: FDelegateHandle StartCompleteDelegateHandle; // The world context object in which this call is taking place - const UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; \ No newline at end of file diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/UpdateSessionCallbackProxyAdvanced.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/UpdateSessionCallbackProxyAdvanced.h similarity index 85% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/UpdateSessionCallbackProxyAdvanced.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/UpdateSessionCallbackProxyAdvanced.h index a8a68b6..afdc181 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Classes/UpdateSessionCallbackProxyAdvanced.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/UpdateSessionCallbackProxyAdvanced.h @@ -21,7 +21,7 @@ class UUpdateSessionCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase // Creates a session with the default online subsystem with advanced optional inputs, you MUST fill in all categories or it will pass in values that you didn't want as default values UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject",AutoCreateRefTerm="ExtraSettings"), Category = "Online|AdvancedSessions") - static UUpdateSessionCallbackProxyAdvanced* UpdateSession(UObject* WorldContextObject, const TArray &ExtraSettings, int32 PublicConnections = 100, int32 PrivateConnections = 0, bool bUseLAN = false, bool bAllowInvites = false, bool bAllowJoinInProgress = false, bool bRefreshOnlineData = true, bool bIsDedicatedServer = false); + static UUpdateSessionCallbackProxyAdvanced* UpdateSession(UObject* WorldContextObject, const TArray &ExtraSettings, int32 PublicConnections = 100, int32 PrivateConnections = 0, bool bUseLAN = false, bool bAllowInvites = false, bool bAllowJoinInProgress = false, bool bRefreshOnlineData = true, bool bIsDedicatedServer = false, bool bShouldAdvertise = true); // UOnlineBlueprintCallProxyBase interface virtual void Activate() override; @@ -38,30 +38,32 @@ private: FDelegateHandle OnUpdateSessionCompleteDelegateHandle; // Number of public connections - int NumPublicConnections; + int NumPublicConnections = 100; // Number of private connections - int NumPrivateConnections; + int NumPrivateConnections = 0; // Whether or not to search LAN - bool bUseLAN; + bool bUseLAN = false; // Whether or not to allow invites - bool bAllowInvites; + bool bAllowInvites = true; // Store extra settings TArray ExtraSettings; // Whether to update the online data - bool bRefreshOnlineData; + bool bRefreshOnlineData = true; // Allow joining in progress - bool bAllowJoinInProgress; + bool bAllowJoinInProgress = true; // Update whether this is a dedicated server or not - bool bDedicatedServer; + bool bDedicatedServer = false; + + bool bShouldAdvertise = true; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedExternalUILibrary.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedExternalUILibrary.cpp similarity index 61% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedExternalUILibrary.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedExternalUILibrary.cpp index f4b1766..a1792a1 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedExternalUILibrary.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedExternalUILibrary.cpp @@ -6,9 +6,17 @@ //General Log DEFINE_LOG_CATEGORY(AdvancedExternalUILog); -void UAdvancedExternalUILibrary::ShowAccountUpgradeUI(const FBPUniqueNetId PlayerRequestingAccountUpgradeUI, EBlueprintResultSwitch &Result) +void UAdvancedExternalUILibrary::ShowAccountUpgradeUI(UObject* WorldContextObject, const FBPUniqueNetId PlayerRequestingAccountUpgradeUI, EBlueprintResultSwitch &Result) { - IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + Result = EBlueprintResultSwitch::OnFailure; + return; + } + + IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World); if (!ExternalUIInterface.IsValid()) { @@ -21,10 +29,17 @@ void UAdvancedExternalUILibrary::ShowAccountUpgradeUI(const FBPUniqueNetId Playe Result = EBlueprintResultSwitch::OnSuccess; } -void UAdvancedExternalUILibrary::ShowProfileUI(const FBPUniqueNetId PlayerViewingProfile, const FBPUniqueNetId PlayerToViewProfileOf, EBlueprintResultSwitch &Result) +void UAdvancedExternalUILibrary::ShowProfileUI(UObject* WorldContextObject, const FBPUniqueNetId PlayerViewingProfile, const FBPUniqueNetId PlayerToViewProfileOf, EBlueprintResultSwitch &Result) { - IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + Result = EBlueprintResultSwitch::OnFailure; + return; + } + + IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World); if (!ExternalUIInterface.IsValid()) { @@ -39,9 +54,16 @@ void UAdvancedExternalUILibrary::ShowProfileUI(const FBPUniqueNetId PlayerViewin -void UAdvancedExternalUILibrary::ShowWebURLUI(FString URLToShow, EBlueprintResultSwitch &Result, TArray& AllowedDomains, bool bEmbedded, bool bShowBackground, bool bShowCloseButton, int32 OffsetX, int32 OffsetY, int32 SizeX, int32 SizeY) +void UAdvancedExternalUILibrary::ShowWebURLUI(UObject* WorldContextObject, FString URLToShow, EBlueprintResultSwitch &Result, TArray& AllowedDomains, bool bEmbedded, bool bShowBackground, bool bShowCloseButton, int32 OffsetX, int32 OffsetY, int32 SizeX, int32 SizeY) { - IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + Result = EBlueprintResultSwitch::OnFailure; + return; + } + + IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World); if (!ExternalUIInterface.IsValid()) { @@ -67,9 +89,15 @@ void UAdvancedExternalUILibrary::ShowWebURLUI(FString URLToShow, EBlueprintResul Result = EBlueprintResultSwitch::OnSuccess; } -void UAdvancedExternalUILibrary::CloseWebURLUI() +void UAdvancedExternalUILibrary::CloseWebURLUI(UObject* WorldContextObject) { - IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World); if (!ExternalUIInterface.IsValid()) { @@ -80,9 +108,16 @@ void UAdvancedExternalUILibrary::CloseWebURLUI() ExternalUIInterface->CloseWebURL(); } -void UAdvancedExternalUILibrary::ShowLeaderBoardUI(FString LeaderboardName, EBlueprintResultSwitch &Result) +void UAdvancedExternalUILibrary::ShowLeaderBoardUI(UObject* WorldContextObject, FString LeaderboardName, EBlueprintResultSwitch &Result) { - IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + Result = EBlueprintResultSwitch::OnFailure; + return; + } + + IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World); if (!ExternalUIInterface.IsValid()) { @@ -97,7 +132,7 @@ void UAdvancedExternalUILibrary::ShowLeaderBoardUI(FString LeaderboardName, EBlu } -void UAdvancedExternalUILibrary::ShowInviteUI(APlayerController *PlayerController, EBlueprintResultSwitch &Result) +void UAdvancedExternalUILibrary::ShowInviteUI(UObject* WorldContextObject, APlayerController *PlayerController, EBlueprintResultSwitch &Result) { if (!PlayerController) { @@ -106,7 +141,14 @@ void UAdvancedExternalUILibrary::ShowInviteUI(APlayerController *PlayerControlle return; } - IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + Result = EBlueprintResultSwitch::OnFailure; + return; + } + + IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World); if (!ExternalUIInterface.IsValid()) { @@ -128,7 +170,7 @@ void UAdvancedExternalUILibrary::ShowInviteUI(APlayerController *PlayerControlle Result = EBlueprintResultSwitch::OnSuccess; } -void UAdvancedExternalUILibrary::ShowFriendsUI(APlayerController *PlayerController, EBlueprintResultSwitch &Result) +void UAdvancedExternalUILibrary::ShowFriendsUI(UObject* WorldContextObject, APlayerController *PlayerController, EBlueprintResultSwitch &Result) { if (!PlayerController) { @@ -137,7 +179,14 @@ void UAdvancedExternalUILibrary::ShowFriendsUI(APlayerController *PlayerControll return; } - IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + Result = EBlueprintResultSwitch::OnFailure; + return; + } + + IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World); if (!ExternalUIInterface.IsValid()) { diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsGameInstance.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsGameInstance.cpp similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsGameInstance.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsGameInstance.cpp diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsInterface.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsInterface.cpp similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsInterface.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsInterface.cpp diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedIdentityLibrary.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedIdentityLibrary.cpp similarity index 78% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedIdentityLibrary.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedIdentityLibrary.cpp index a44d5ae..47a554b 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedIdentityLibrary.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedIdentityLibrary.cpp @@ -5,7 +5,7 @@ DEFINE_LOG_CATEGORY(AdvancedIdentityLog); -void UAdvancedIdentityLibrary::GetPlayerAuthToken(APlayerController * PlayerController, FString & AuthToken, EBlueprintResultSwitch &Result) +void UAdvancedIdentityLibrary::GetPlayerAuthToken(UObject* WorldContextObject, APlayerController * PlayerController, FString & AuthToken, EBlueprintResultSwitch &Result) { if (!PlayerController) { @@ -23,7 +23,14 @@ void UAdvancedIdentityLibrary::GetPlayerAuthToken(APlayerController * PlayerCont return; } - IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + Result = EBlueprintResultSwitch::OnFailure; + return; + } + + IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(World); if (!IdentityInterface.IsValid()) { @@ -36,15 +43,21 @@ void UAdvancedIdentityLibrary::GetPlayerAuthToken(APlayerController * PlayerCont Result = EBlueprintResultSwitch::OnSuccess; } -void UAdvancedIdentityLibrary::GetPlayerNickname(const FBPUniqueNetId & UniqueNetID, FString & PlayerNickname) -{ +void UAdvancedIdentityLibrary::GetPlayerNickname(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetID, FString & PlayerNickname) +{ if (!UniqueNetID.IsValid()) { UE_LOG(AdvancedIdentityLog, Warning, TEXT("GetPlayerNickname was passed a bad player uniquenetid!")); return; } - IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(World); if (!IdentityInterface.IsValid()) { @@ -55,7 +68,7 @@ void UAdvancedIdentityLibrary::GetPlayerNickname(const FBPUniqueNetId & UniqueNe } -void UAdvancedIdentityLibrary::GetLoginStatus(const FBPUniqueNetId & UniqueNetID, EBPLoginStatus & LoginStatus, EBlueprintResultSwitch &Result) +void UAdvancedIdentityLibrary::GetLoginStatus(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetID, EBPLoginStatus & LoginStatus, EBlueprintResultSwitch &Result) { if (!UniqueNetID.IsValid()) { @@ -64,7 +77,14 @@ void UAdvancedIdentityLibrary::GetLoginStatus(const FBPUniqueNetId & UniqueNetID return; } - IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + Result = EBlueprintResultSwitch::OnFailure; + return; + } + + IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(World); if (!IdentityInterface.IsValid()) { @@ -78,9 +98,17 @@ void UAdvancedIdentityLibrary::GetLoginStatus(const FBPUniqueNetId & UniqueNetID } -void UAdvancedIdentityLibrary::GetAllUserAccounts(TArray & AccountInfos, EBlueprintResultSwitch &Result) +void UAdvancedIdentityLibrary::GetAllUserAccounts(UObject* WorldContextObject, TArray & AccountInfos, EBlueprintResultSwitch &Result) { - IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + Result = EBlueprintResultSwitch::OnFailure; + return; + } + + IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(World); if (!IdentityInterface.IsValid()) { @@ -99,9 +127,17 @@ void UAdvancedIdentityLibrary::GetAllUserAccounts(TArray & Result = EBlueprintResultSwitch::OnSuccess; } -void UAdvancedIdentityLibrary::GetUserAccount(const FBPUniqueNetId & UniqueNetId, FBPUserOnlineAccount & AccountInfo, EBlueprintResultSwitch &Result) +void UAdvancedIdentityLibrary::GetUserAccount(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetId, FBPUserOnlineAccount & AccountInfo, EBlueprintResultSwitch &Result) { - IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + Result = EBlueprintResultSwitch::OnFailure; + return; + } + + IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(World); if(!UniqueNetId.IsValid()) { diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessions.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessions.cpp similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessions.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessions.cpp diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessionsLibrary.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessionsLibrary.cpp similarity index 98% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessionsLibrary.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessionsLibrary.cpp index 9b2b6bf..a5453d1 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessionsLibrary.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessionsLibrary.cpp @@ -477,6 +477,11 @@ bool UAdvancedSessionsLibrary::EqualEqual_UNetIDUnetID(const FBPUniqueNetId &A, return ((A.IsValid() && B.IsValid()) && (*A.GetUniqueNetId() == *B.GetUniqueNetId())); } +FUniqueNetIdRepl UAdvancedSessionsLibrary::Conv_BPUniqueIDToUniqueNetIDRepl(const FBPUniqueNetId& InUniqueID) +{ + return FUniqueNetIdRepl(InUniqueID.GetUniqueNetId()->AsShared()); +} + void UAdvancedSessionsLibrary::SetPlayerName(APlayerController *PlayerController, FString PlayerName) { if (!PlayerController) diff --git a/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp new file mode 100644 index 0000000..f6321c1 --- /dev/null +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp @@ -0,0 +1,359 @@ +// Fill out your copyright notice in the Description page of Project Settings. +#include "AdvancedVoiceLibrary.h" + + +//General Log +DEFINE_LOG_CATEGORY(AdvancedVoiceLog); + +void UAdvancedVoiceLibrary::IsHeadsetPresent(UObject* WorldContextObject, bool & bHasHeadset, uint8 LocalPlayerNum) +{ + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + bHasHeadset = false; + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Check For Headset couldn't get the voice interface!")); + return; + } + + bHasHeadset = VoiceInterface->IsHeadsetPresent(LocalPlayerNum); +} + +void UAdvancedVoiceLibrary::StartNetworkedVoice(UObject* WorldContextObject, uint8 LocalPlayerNum) +{ + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Start Networked Voice couldn't get the voice interface!")); + return; + } + + VoiceInterface->StartNetworkedVoice(LocalPlayerNum); +} + +void UAdvancedVoiceLibrary::StopNetworkedVoice(UObject* WorldContextObject, uint8 LocalPlayerNum) +{ + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Start Networked Voice couldn't get the voice interface!")); + return; + } + + VoiceInterface->StopNetworkedVoice(LocalPlayerNum); +} + +bool UAdvancedVoiceLibrary::RegisterLocalTalker(UObject* WorldContextObject, uint8 LocalPlayerNum) +{ + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Register Local Talker couldn't get the voice interface!")); + return false; + } + + return VoiceInterface->RegisterLocalTalker(LocalPlayerNum); +} + +void UAdvancedVoiceLibrary::RegisterAllLocalTalkers(UObject* WorldContextObject) +{ + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Register Local Talkers couldn't get the voice interface!")); + return; + } + + VoiceInterface->RegisterLocalTalkers(); +} + + +void UAdvancedVoiceLibrary::UnRegisterLocalTalker(UObject* WorldContextObject, uint8 LocalPlayerNum) +{ + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Unregister Local Talker couldn't get the voice interface!")); + return; + } + + VoiceInterface->UnregisterLocalTalker(LocalPlayerNum); +} + +void UAdvancedVoiceLibrary::UnRegisterAllLocalTalkers(UObject* WorldContextObject) +{ + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("UnRegister All Local Talkers couldn't get the voice interface!")); + return; + } + + VoiceInterface->UnregisterLocalTalkers(); +} + +bool UAdvancedVoiceLibrary::RegisterRemoteTalker(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId) +{ + if (!UniqueNetId.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Register Remote Talker was passed an invalid unique net id!")); + return false; + } + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Register Remote Talker couldn't get the voice interface!")); + return false; + } + + return VoiceInterface->RegisterRemoteTalker(*UniqueNetId.GetUniqueNetId()); +} + +bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId) +{ + if (!UniqueNetId.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("UnRegister Remote Talker was passed an invalid unique net id!")); + return false; + } + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("UnRegister Remote Talker couldn't get the voice interface!")); + return false; + } + + return VoiceInterface->UnregisterRemoteTalker(*UniqueNetId.GetUniqueNetId()); +} + +void UAdvancedVoiceLibrary::RemoveAllRemoteTalkers(UObject* WorldContextObject) +{ + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Remove All Remote Talkers couldn't get the voice interface!")); + return; + } + + VoiceInterface->RemoveAllRemoteTalkers(); +} + +bool UAdvancedVoiceLibrary::IsLocalPlayerTalking(UObject* WorldContextObject, uint8 LocalPlayerNum) +{ + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Local Player Talking couldn't get the voice interface!")); + return false; + } + + return VoiceInterface->IsLocalPlayerTalking(LocalPlayerNum); +} + +bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId) +{ + if (!UniqueNetId.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Remote Player Talking was passed an invalid unique net id!")); + return false; + } + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Remote Player Talking couldn't get the voice interface!")); + return false; + } + + return VoiceInterface->IsRemotePlayerTalking(*UniqueNetId.GetUniqueNetId()); +} + +bool UAdvancedVoiceLibrary::IsPlayerMuted(UObject* WorldContextObject, uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId) +{ + if (!UniqueNetId.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Player Muted was passed an invalid unique net id!")); + return false; + } + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Is Player Muted couldn't get the voice interface!")); + return false; + } + + return VoiceInterface->IsMuted(LocalUserNumChecking, *UniqueNetId.GetUniqueNetId()); +} + +bool UAdvancedVoiceLibrary::MuteRemoteTalker(UObject* WorldContextObject, uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide) +{ + if (!UniqueNetId.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Mute Remote Talker was passed an invalid unique net id!")); + return false; + } + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Mute Remote Talker couldn't get the voice interface!")); + return false; + } + + return VoiceInterface->MuteRemoteTalker(LocalUserNum, *UniqueNetId.GetUniqueNetId(), bIsSystemWide); +} + +bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(UObject* WorldContextObject, uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide) +{ + if (!UniqueNetId.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Unmute Remote Talker was passed an invalid unique net id!")); + return false; + } + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Unmute Remote Talker couldn't get the voice interface!")); + return false; + } + + return VoiceInterface->UnmuteRemoteTalker(LocalUserNum, *UniqueNetId.GetUniqueNetId(), bIsSystemWide); +} + + +void UAdvancedVoiceLibrary::GetNumLocalTalkers(UObject* WorldContextObject, int32 & NumLocalTalkers) +{ + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); + + if (!VoiceInterface.IsValid()) + { + NumLocalTalkers = 0; + UE_LOG(AdvancedVoiceLog, Warning, TEXT("Unmute Remote Talker couldn't get the voice interface!")); + return; + } + + NumLocalTalkers = VoiceInterface->GetNumLocalTalkers(); +} \ No newline at end of file diff --git a/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AutoLoginUserCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AutoLoginUserCallbackProxy.cpp new file mode 100644 index 0000000..9046773 --- /dev/null +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AutoLoginUserCallbackProxy.cpp @@ -0,0 +1,89 @@ +// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. + +#include "AutoLoginUserCallbackProxy.h" +#include "Kismet/GameplayStatics.h" + +#include "Online.h" + +////////////////////////////////////////////////////////////////////////// +// ULoginUserCallbackProxy + +UAutoLoginUserCallbackProxy::UAutoLoginUserCallbackProxy(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) + , Delegate(FOnLoginCompleteDelegate::CreateUObject(this, &ThisClass::OnCompleted)) +{ +} + +UAutoLoginUserCallbackProxy* UAutoLoginUserCallbackProxy::AutoLoginUser(UObject* WorldContextObject, int32 LocalUserNum) +{ + UAutoLoginUserCallbackProxy* Proxy = NewObject(); + Proxy->LocalUserNumber = LocalUserNum; + Proxy->WorldContextObject = WorldContextObject; + return Proxy; +} + +void UAutoLoginUserCallbackProxy::Activate() +{ + + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("AutoLoginUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + + if (Helper.OnlineSub != nullptr) + { + auto Identity = Helper.OnlineSub->GetIdentityInterface(); + + if (Identity.IsValid()) + { + DelegateHandle = Identity->AddOnLoginCompleteDelegate_Handle(LocalUserNumber, Delegate); + Identity->AutoLogin(LocalUserNumber); + return; + } + } + + // Fail immediately + OnFailure.Broadcast(); +} + +void UAutoLoginUserCallbackProxy::OnCompleted(int32 LocalUserNum, bool bWasSuccessful, const FUniqueNetId& UserId, const FString& ErrorVal) +{ + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("AutoLoginUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + + if (Helper.OnlineSub != nullptr) + { + auto Identity = Helper.OnlineSub->GetIdentityInterface(); + + if (Identity.IsValid()) + { + Identity->ClearOnLoginCompleteDelegate_Handle(LocalUserNum, DelegateHandle); + } + + if (APlayerController* PController = UGameplayStatics::GetPlayerController(WorldContextObject->GetWorld(), LocalUserNum)) + { + ULocalPlayer* Player = Cast(PController->Player); + + FUniqueNetIdRepl uniqueId(UserId.AsShared()); + + if (Player) + { + Player->SetCachedUniqueNetId(uniqueId); + } + + if (APlayerState* State = PController->PlayerState) + { + // Update UniqueId. See also ShowLoginUICallbackProxy.cpp + State->SetUniqueId(uniqueId); + } + } + + + if (bWasSuccessful) + { + OnSuccess.Broadcast(); + } + else + { + OnFailure.Broadcast(); + } + } + + OnFailure.Broadcast(); +} diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/CancelFindSessionsCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CancelFindSessionsCallbackProxy.cpp similarity index 92% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/CancelFindSessionsCallbackProxy.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CancelFindSessionsCallbackProxy.cpp index 7d29f5f..600187e 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/CancelFindSessionsCallbackProxy.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CancelFindSessionsCallbackProxy.cpp @@ -21,7 +21,7 @@ UCancelFindSessionsCallbackProxy* UCancelFindSessionsCallbackProxy::CancelFindSe void UCancelFindSessionsCallbackProxy::Activate() { - FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); if (Helper.IsValid()) @@ -47,7 +47,7 @@ void UCancelFindSessionsCallbackProxy::Activate() void UCancelFindSessionsCallbackProxy::OnCompleted(bool bWasSuccessful) { - FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); if (Helper.IsValid()) diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp index 71a7d85..1ff10c1 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp @@ -38,7 +38,7 @@ UCreateSessionCallbackProxyAdvanced* UCreateSessionCallbackProxyAdvanced::Create void UCreateSessionCallbackProxyAdvanced::Activate() { - FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSession"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSession"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); if (PlayerControllerWeakPtr.IsValid() ) Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); @@ -121,7 +121,7 @@ void UCreateSessionCallbackProxyAdvanced::Activate() void UCreateSessionCallbackProxyAdvanced::OnCreateCompleted(FName SessionName, bool bWasSuccessful) { - FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); //Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); if (Helper.OnlineSub != nullptr) @@ -159,7 +159,7 @@ void UCreateSessionCallbackProxyAdvanced::OnCreateCompleted(FName SessionName, b void UCreateSessionCallbackProxyAdvanced::OnStartCompleted(FName SessionName, bool bWasSuccessful) { - FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("StartSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("StartSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); //Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); if (Helper.OnlineSub != nullptr) diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/EndSessionCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/EndSessionCallbackProxy.cpp similarity index 90% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/EndSessionCallbackProxy.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/EndSessionCallbackProxy.cpp index 0276399..ddb248c 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/EndSessionCallbackProxy.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/EndSessionCallbackProxy.cpp @@ -21,7 +21,7 @@ UEndSessionCallbackProxy* UEndSessionCallbackProxy::EndSession(UObject* WorldCon void UEndSessionCallbackProxy::Activate() { - FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSession"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSession"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); if (Helper.IsValid()) @@ -55,7 +55,7 @@ void UEndSessionCallbackProxy::Activate() void UEndSessionCallbackProxy::OnCompleted(FName SessionName, bool bWasSuccessful) { - FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); if (Helper.IsValid()) diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/FindFriendSessionCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindFriendSessionCallbackProxy.cpp similarity index 64% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/FindFriendSessionCallbackProxy.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindFriendSessionCallbackProxy.cpp index 79b25de..019255c 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/FindFriendSessionCallbackProxy.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindFriendSessionCallbackProxy.cpp @@ -41,7 +41,18 @@ void UFindFriendSessionCallbackProxy::Activate() return; } - IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld()); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); + + if (!Helper.IsValid()) + { + // Fail immediately + TArray EmptyResult; + OnFailure.Broadcast(EmptyResult); + return; + } + + IOnlineSessionPtr Sessions = Helper.OnlineSub->GetSessionInterface(); if (Sessions.IsValid()) { @@ -71,31 +82,43 @@ void UFindFriendSessionCallbackProxy::Activate() void UFindFriendSessionCallbackProxy::OnFindFriendSessionCompleted(int32 LocalPlayer, bool bWasSuccessful, const TArray& SessionInfo) { - IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld()); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); - if (Sessions.IsValid()) - Sessions->ClearOnFindFriendSessionCompleteDelegate_Handle(LocalPlayer, FindFriendSessionCompleteDelegateHandle); + if (Helper.IsValid()) + { + IOnlineSessionPtr Sessions = Helper.OnlineSub->GetSessionInterface(); - if ( bWasSuccessful ) - { - TArray Result; + if (Sessions.IsValid()) + Sessions->ClearOnFindFriendSessionCompleteDelegate_Handle(LocalPlayer, FindFriendSessionCompleteDelegateHandle); - for (auto& Sesh : SessionInfo) + if (bWasSuccessful) { - if (Sesh.IsValid()) + TArray Result; + + for (auto& Sesh : SessionInfo) { - FBlueprintSessionResult BSesh; - BSesh.OnlineResult = Sesh; - Result.Add(BSesh); + if (Sesh.IsValid()) + { + FBlueprintSessionResult BSesh; + BSesh.OnlineResult = Sesh; + Result.Add(BSesh); + } + } + + if (Result.Num() > 0) + OnSuccess.Broadcast(Result); + else + { + UE_LOG(AdvancedFindFriendSessionLog, Warning, TEXT("FindFriendSession Failed, returned an invalid session.")); + OnFailure.Broadcast(Result); } } - - if(Result.Num() > 0) - OnSuccess.Broadcast(Result); else { - UE_LOG(AdvancedFindFriendSessionLog, Warning, TEXT("FindFriendSession Failed, returned an invalid session.")); - OnFailure.Broadcast(Result); + UE_LOG(AdvancedFindFriendSessionLog, Warning, TEXT("FindFriendSession Failed")); + TArray EmptyResult; + OnFailure.Broadcast(EmptyResult); } } else diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp similarity index 97% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp index 5b03b31..16f3721 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp @@ -1,6 +1,7 @@ // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #include "FindSessionsCallbackProxyAdvanced.h" +#include "Online/OnlineSessionNames.h" ////////////////////////////////////////////////////////////////////////// // UFindSessionsCallbackProxyAdvanced @@ -34,7 +35,7 @@ UFindSessionsCallbackProxyAdvanced* UFindSessionsCallbackProxyAdvanced::FindSess void UFindSessionsCallbackProxyAdvanced::Activate() { - FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); if (Helper.IsValid()) @@ -171,9 +172,16 @@ void UFindSessionsCallbackProxyAdvanced::Activate() void UFindSessionsCallbackProxyAdvanced::OnCompleted(bool bSuccess) { - FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); + if (!Helper.IsValid()) + { + // Fail immediately + OnFailure.Broadcast(SessionSearchResults); + return; + } + if (!bRunSecondSearch && Helper.IsValid()) { auto Sessions = Helper.OnlineSub->GetSessionInterface(); diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/GetFriendsCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetFriendsCallbackProxy.cpp similarity index 71% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/GetFriendsCallbackProxy.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetFriendsCallbackProxy.cpp index 80b6682..8886fef 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/GetFriendsCallbackProxy.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetFriendsCallbackProxy.cpp @@ -1,6 +1,9 @@ // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #include "GetFriendsCallbackProxy.h" +#include "Online.h" +#include "Interfaces/OnlineFriendsInterface.h" +#include "Interfaces/OnlinePresenceInterface.h" ////////////////////////////////////////////////////////////////////////// // UGetFriendsCallbackProxy @@ -31,18 +34,23 @@ void UGetFriendsCallbackProxy::Activate() return; } - IOnlineFriendsPtr Friends = Online::GetFriendsInterface(); - if (Friends.IsValid()) - { - ULocalPlayer* Player = Cast(PlayerControllerWeakPtr->Player); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetFriends"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); - Friends->ReadFriendsList(Player->GetControllerId(), EFriendsLists::ToString((EFriendsLists::Default)), FriendListReadCompleteDelegate); - return; + if (Helper.IsValid()) + { + IOnlineFriendsPtr Friends = Helper.OnlineSub->GetFriendsInterface(); + if (Friends.IsValid()) + { + ULocalPlayer* Player = Cast(PlayerControllerWeakPtr->Player); + + Friends->ReadFriendsList(Player->GetControllerId(), EFriendsLists::ToString((EFriendsLists::Default)), FriendListReadCompleteDelegate); + return; + } } // Fail immediately TArray EmptyArray; - OnFailure.Broadcast(EmptyArray); } @@ -50,7 +58,17 @@ void UGetFriendsCallbackProxy::OnReadFriendsListCompleted(int32 LocalUserNum, bo { if (bWasSuccessful) { - IOnlineFriendsPtr Friends = Online::GetFriendsInterface(); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetFriends"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get()); + + if (!Helper.IsValid()) + { + TArray EmptyArray; + OnFailure.Broadcast(EmptyArray); + return; + } + + auto Friends = Helper.OnlineSub->GetFriendsInterface(); if (Friends.IsValid()) { // Not actually needed anymore, plus was not being validated and causing a crash diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/GetRecentPlayersCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetRecentPlayersCallbackProxy.cpp similarity index 77% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/GetRecentPlayersCallbackProxy.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetRecentPlayersCallbackProxy.cpp index 0765a10..84bdcec 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/GetRecentPlayersCallbackProxy.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetRecentPlayersCallbackProxy.cpp @@ -1,6 +1,7 @@ // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #include "GetRecentPlayersCallbackProxy.h" +#include "Online.h" ////////////////////////////////////////////////////////////////////////// // UGetRecentPlayersCallbackProxy @@ -31,7 +32,16 @@ void UGetRecentPlayersCallbackProxy::Activate() return; } - IOnlineFriendsPtr Friends = Online::GetFriendsInterface(); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetRecentPlayers"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + + if (!Helper.OnlineSub) + { + TArray EmptyArray; + OnFailure.Broadcast(EmptyArray); + return; + } + + IOnlineFriendsPtr Friends = Helper.OnlineSub->GetFriendsInterface(); if (Friends.IsValid()) { DelegateHandle = Friends->AddOnQueryRecentPlayersCompleteDelegate_Handle(QueryRecentPlayersCompleteDelegate); @@ -48,7 +58,16 @@ void UGetRecentPlayersCallbackProxy::Activate() void UGetRecentPlayersCallbackProxy::OnQueryRecentPlayersCompleted(const FUniqueNetId &UserID, const FString &Namespace, bool bWasSuccessful, const FString& ErrorString) { - IOnlineFriendsPtr Friends = Online::GetFriendsInterface(); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetRecentPlayers"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + + if (!Helper.OnlineSub) + { + TArray EmptyArray; + OnFailure.Broadcast(EmptyArray); + return; + } + + IOnlineFriendsPtr Friends = Helper.OnlineSub->GetFriendsInterface(); if (Friends.IsValid()) Friends->ClearOnQueryRecentPlayersCompleteDelegate_Handle(DelegateHandle); diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/GetUserPrivilegeCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetUserPrivilegeCallbackProxy.cpp similarity index 81% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/GetUserPrivilegeCallbackProxy.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetUserPrivilegeCallbackProxy.cpp index 5a42020..7b1ef39 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/GetUserPrivilegeCallbackProxy.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetUserPrivilegeCallbackProxy.cpp @@ -2,6 +2,7 @@ #include "GetUserPrivilegeCallbackProxy.h" +#include "Online.h" ////////////////////////////////////////////////////////////////////////// // UGetUserPrivilegeCallbackProxy @@ -22,7 +23,14 @@ UGetUserPrivilegeCallbackProxy* UGetUserPrivilegeCallbackProxy::GetUserPrivilege void UGetUserPrivilegeCallbackProxy::Activate() { - auto Identity = Online::GetIdentityInterface(); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetUserPrivilege"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + + if (!Helper.OnlineSub) + { + OnFailure.Broadcast(); + return; + } + auto Identity = Helper.OnlineSub->GetIdentityInterface(); if (Identity.IsValid()) { diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp similarity index 79% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp index 4f08f1f..584edc5 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp @@ -2,6 +2,7 @@ #include "LoginUserCallbackProxy.h" +#include "Online.h" ////////////////////////////////////////////////////////////////////////// // ULoginUserCallbackProxy @@ -40,8 +41,15 @@ void ULoginUserCallbackProxy::Activate() return; } - auto Identity = Online::GetIdentityInterface(); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("LoginUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + if (!Helper.OnlineSub) + { + OnFailure.Broadcast(); + return; + } + + auto Identity = Helper.OnlineSub->GetIdentityInterface(); if (Identity.IsValid()) { // Fallback to default AuthType if nothing is specified @@ -69,8 +77,15 @@ void ULoginUserCallbackProxy::OnCompleted(int32 LocalUserNum, bool bWasSuccessfu if (Player) { - auto Identity = Online::GetIdentityInterface(); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetUserPrivilege"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + if (!Helper.OnlineSub) + { + OnFailure.Broadcast(); + return; + } + + auto Identity = Helper.OnlineSub->GetIdentityInterface(); if (Identity.IsValid()) { Identity->ClearOnLoginCompleteDelegate_Handle(Player->GetControllerId(), DelegateHandle); diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/LogoutUserCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LogoutUserCallbackProxy.cpp similarity index 73% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/LogoutUserCallbackProxy.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LogoutUserCallbackProxy.cpp index 9dfae02..07bc666 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/LogoutUserCallbackProxy.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LogoutUserCallbackProxy.cpp @@ -2,6 +2,7 @@ #include "LogoutUserCallbackProxy.h" +#include "Online.h" ////////////////////////////////////////////////////////////////////////// // ULogoutUserCallbackProxy @@ -29,7 +30,6 @@ void ULogoutUserCallbackProxy::Activate() return; } - ULocalPlayer* Player = Cast(PlayerControllerWeakPtr->Player); if (!Player) @@ -38,7 +38,14 @@ void ULogoutUserCallbackProxy::Activate() return; } - auto Identity = Online::GetIdentityInterface(); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("LogoutUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + + if (!Helper.OnlineSub) + { + OnFailure.Broadcast(); + return; + } + auto Identity = Helper.OnlineSub->GetIdentityInterface(); if (Identity.IsValid()) { @@ -60,7 +67,14 @@ void ULogoutUserCallbackProxy::OnCompleted(int LocalUserNum, bool bWasSuccessful if (Player) { - auto Identity = Online::GetIdentityInterface(); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("LogoutUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + + if (!Helper.OnlineSub) + { + OnFailure.Broadcast(); + return; + } + auto Identity = Helper.OnlineSub->GetIdentityInterface(); if (Identity.IsValid()) { diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/SendFriendInviteCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/SendFriendInviteCallbackProxy.cpp similarity index 88% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/SendFriendInviteCallbackProxy.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/SendFriendInviteCallbackProxy.cpp index b5e36fd..7c407c4 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/SendFriendInviteCallbackProxy.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/SendFriendInviteCallbackProxy.cpp @@ -1,6 +1,7 @@ // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #include "SendFriendInviteCallbackProxy.h" +#include "Online.h" ////////////////////////////////////////////////////////////////////////// // UGetRecentPlayersCallbackProxy @@ -39,7 +40,15 @@ void USendFriendInviteCallbackProxy::Activate() return; } - IOnlineFriendsPtr Friends = Online::GetFriendsInterface(); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("SendFriendInvite"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + + if (!Helper.OnlineSub) + { + OnFailure.Broadcast(); + return; + } + + auto Friends = Helper.OnlineSub->GetFriendsInterface(); if (Friends.IsValid()) { ULocalPlayer* Player = Cast(PlayerControllerWeakPtr->Player); diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/StartSessionCallbackProxyAdvanced.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/StartSessionCallbackProxyAdvanced.cpp similarity index 75% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/StartSessionCallbackProxyAdvanced.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/StartSessionCallbackProxyAdvanced.cpp index 3831384..d41e428 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/StartSessionCallbackProxyAdvanced.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/StartSessionCallbackProxyAdvanced.cpp @@ -7,7 +7,7 @@ UStartSessionCallbackProxyAdvanced::UStartSessionCallbackProxyAdvanced(const FOb } UStartSessionCallbackProxyAdvanced* UStartSessionCallbackProxyAdvanced::StartAdvancedSession( - const UObject* WorldContextObject) + UObject* WorldContextObject) { UStartSessionCallbackProxyAdvanced* Proxy = NewObject(); Proxy->WorldContextObject = WorldContextObject; @@ -16,9 +16,7 @@ UStartSessionCallbackProxyAdvanced* UStartSessionCallbackProxyAdvanced::StartAdv void UStartSessionCallbackProxyAdvanced::Activate() { - const FOnlineSubsystemBPCallHelperAdvanced Helper( - TEXT("StartSession"), - GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + const FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("StartSession"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); if (Helper.OnlineSub != nullptr) { @@ -38,13 +36,11 @@ void UStartSessionCallbackProxyAdvanced::Activate() void UStartSessionCallbackProxyAdvanced::OnStartCompleted(FName SessionName, bool bWasSuccessful) { - const FOnlineSubsystemBPCallHelperAdvanced Helper( - TEXT("StartSessionCallback"), - GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("StartSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); if (Helper.OnlineSub != nullptr) { - const auto Sessions = Helper.OnlineSub->GetSessionInterface(); + auto Sessions = Helper.OnlineSub->GetSessionInterface(); if (Sessions.IsValid()) { Sessions->ClearOnStartSessionCompleteDelegate_Handle(StartCompleteDelegateHandle); diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/UpdateSessionCallbackProxyAdvanced.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/UpdateSessionCallbackProxyAdvanced.cpp similarity index 93% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/UpdateSessionCallbackProxyAdvanced.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/UpdateSessionCallbackProxyAdvanced.cpp index 0155c64..31aa9d9 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSessions/Source/AdvancedSessions/Private/UpdateSessionCallbackProxyAdvanced.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/UpdateSessionCallbackProxyAdvanced.cpp @@ -12,7 +12,7 @@ UUpdateSessionCallbackProxyAdvanced::UUpdateSessionCallbackProxyAdvanced(const F { } -UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::UpdateSession(UObject* WorldContextObject, const TArray &ExtraSettings, int32 PublicConnections, int32 PrivateConnections, bool bUseLAN, bool bAllowInvites, bool bAllowJoinInProgress, bool bRefreshOnlineData, bool bIsDedicatedServer) +UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::UpdateSession(UObject* WorldContextObject, const TArray &ExtraSettings, int32 PublicConnections, int32 PrivateConnections, bool bUseLAN, bool bAllowInvites, bool bAllowJoinInProgress, bool bRefreshOnlineData, bool bIsDedicatedServer, bool bShouldAdvertise) { UUpdateSessionCallbackProxyAdvanced* Proxy = NewObject(); Proxy->NumPublicConnections = PublicConnections; @@ -24,12 +24,13 @@ UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::Update Proxy->bRefreshOnlineData = bRefreshOnlineData; Proxy->bAllowJoinInProgress = bAllowJoinInProgress; Proxy->bDedicatedServer = bIsDedicatedServer; + Proxy->bShouldAdvertise = bShouldAdvertise; return Proxy; } void UUpdateSessionCallbackProxyAdvanced::Activate() { - const FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("UpdateSession"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + const FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("UpdateSession"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); if (Helper.OnlineSub != nullptr) { @@ -60,7 +61,7 @@ void UUpdateSessionCallbackProxyAdvanced::Activate() //Settings->BuildUniqueId = GetBuildUniqueId(); Settings->NumPublicConnections = NumPublicConnections; Settings->NumPrivateConnections = NumPrivateConnections; - //Settings->bShouldAdvertise = true; + Settings->bShouldAdvertise = bShouldAdvertise; Settings->bAllowJoinInProgress = bAllowJoinInProgress; Settings->bIsLANMatch = bUseLAN; //Settings->bUsesPresence = true; @@ -104,7 +105,7 @@ void UUpdateSessionCallbackProxyAdvanced::Activate() void UUpdateSessionCallbackProxyAdvanced::OnUpdateCompleted(FName SessionName, bool bWasSuccessful) { - const FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("UpdateSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull)); + const FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("UpdateSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); if (Helper.OnlineSub != nullptr) { diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/AdvancedSteamSessions.uplugin b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/AdvancedSteamSessions.uplugin similarity index 76% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/AdvancedSteamSessions.uplugin rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/AdvancedSteamSessions.uplugin index 0e21d6d..049c61d 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/AdvancedSteamSessions.uplugin +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/AdvancedSteamSessions.uplugin @@ -11,11 +11,11 @@ "Modules" : [ - { - "Name" : "AdvancedSteamSessions", - "Type" : "RunTime", - "LoadingPhase" : "PreDefault" - } + { + "Name": "AdvancedSteamSessions", + "Type": "RunTime", + "LoadingPhase": "Default" + } ], "Plugins": [ { @@ -30,10 +30,6 @@ "Name": "OnlineSubsystemUtils", "Enabled": true }, - { - "Name": "OnlineSubsystemSteam", - "Enabled": true - }, { "Name": "SteamShared", "Enabled": true diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Config/FilterPlugin.ini b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Config/FilterPlugin.ini similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Config/FilterPlugin.ini rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Config/FilterPlugin.ini diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Resources/Icon128.png b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Resources/Icon128.png similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Resources/Icon128.png rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Resources/Icon128.png diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/AdvancedSteamSessions.Build.cs b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/AdvancedSteamSessions.Build.cs similarity index 77% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/AdvancedSteamSessions.Build.cs rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/AdvancedSteamSessions.Build.cs index 6e62e47..366cc07 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/AdvancedSteamSessions.Build.cs +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/AdvancedSteamSessions.Build.cs @@ -15,8 +15,10 @@ public class AdvancedSteamSessions : ModuleRules if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Linux) || (Target.Platform == UnrealTargetPlatform.Mac)) { - PublicDependencyModuleNames.AddRange(new string[] { "Steamworks",/*"Voice",*/ "OnlineSubsystemSteam" }); - PublicIncludePaths.AddRange(new string[] { "../Plugins/Online/OnlineSubsystemSteam/Source/Private" });// This is dumb but it isn't very open + PublicDependencyModuleNames.AddRange(new string[] { "SteamShared", "Steamworks"/*, "OnlineSubsystemSteam"*/ }); + //PublicIncludePaths.AddRange(new string[] { "../Plugins/Online/OnlineSubsystemSteam/Source/Private" });// This is dumb but it isn't very open } + + AddEngineThirdPartyPrivateStaticDependencies(Target, "Steamworks"); } } \ No newline at end of file diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamFriendsLibrary.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamFriendsLibrary.h similarity index 98% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamFriendsLibrary.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamFriendsLibrary.h index 7d8cead..ddf5562 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamFriendsLibrary.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamFriendsLibrary.h @@ -25,7 +25,7 @@ #pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on.... #endif -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) #pragma push_macro("ARRAY_COUNT") #undef ARRAY_COUNT @@ -267,7 +267,9 @@ enum class ESteamUserOverlayType : uint8 /*Opens the overlay in minimal mode prompting the user to accept an incoming friend invite.*/ friendrequestaccept, /*Opens the overlay in minimal mode prompting the user to ignore an incoming friend invite.*/ - friendrequestignore + friendrequestignore, + /*Opens the invite overlay, invitations sent from this dialog will be for the provided lobby*/ + invitetolobby }; static FString EnumToString(const FString& enumName, uint8 value) diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamSessions.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamSessions.h similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamSessions.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamSessions.h diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamWorkshopLibrary.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamWorkshopLibrary.h similarity index 98% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamWorkshopLibrary.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamWorkshopLibrary.h index 64c5d76..bfb6893 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamWorkshopLibrary.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamWorkshopLibrary.h @@ -6,7 +6,7 @@ #include "Kismet/BlueprintFunctionLibrary.h" #include "Online.h" #include "OnlineSubsystem.h" -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) #include "steam/isteamugc.h" #include "steam/isteamremotestorage.h" #endif @@ -21,7 +21,7 @@ #pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on.... #endif -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) #pragma push_macro("ARRAY_COUNT") #undef ARRAY_COUNT @@ -223,7 +223,7 @@ public: bTagsTruncated = false; } -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) FBPSteamWorkshopItemDetails(SteamUGCDetails_t &hUGCDetails) { ResultOfRequest = (FBPSteamResult)hUGCDetails.m_eResult; diff --git a/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamNotificationsSubsystem.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamNotificationsSubsystem.h new file mode 100644 index 0000000..364ea3d --- /dev/null +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamNotificationsSubsystem.h @@ -0,0 +1,87 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Subsystems/GameInstanceSubsystem.h" + +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) + +#include + +#endif + +#include "SteamNotificationsSubsystem.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSteamOverlayActivated, bool, bOverlayState); + +UCLASS() +class ADVANCEDSTEAMSESSIONS_API USteamNotificationsSubsystem : public UGameInstanceSubsystem +{ + GENERATED_BODY() + +public: + + // Event thrown when the steam overlay switches states + UPROPERTY(BlueprintAssignable, Category = "SteamEvents") + FOnSteamOverlayActivated OnSteamOverlayActivated_Bind; + + USteamNotificationsSubsystem() : Super() + { + + } + + class cSteamEventsStore + { + public: + USteamNotificationsSubsystem* ParentSubsystem = nullptr; + void Initialize(USteamNotificationsSubsystem* MyParent) + { + ParentSubsystem = MyParent; + } + +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) + cSteamEventsStore() : + OnExternalUITriggeredCallback(this, &cSteamEventsStore::OnExternalUITriggered) + { + + } +#else + //cSteamEventsStore() + //{ + + //} +#endif + + //~cSteamEventsStore(){} + + private: +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) + STEAM_CALLBACK(cSteamEventsStore, OnExternalUITriggered, GameOverlayActivated_t, OnExternalUITriggeredCallback); +#endif + }; + + cSteamEventsStore MyEvents; + + /** Implement this for initialization of instances of the system */ + virtual void Initialize(FSubsystemCollectionBase& Collection) override + { + MyEvents.Initialize(this); + } + + /** Implement this for deinitialization of instances of the system */ + virtual void Deinitialize() override + { + + } +}; + +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) +void USteamNotificationsSubsystem::cSteamEventsStore::OnExternalUITriggered(GameOverlayActivated_t* CallbackData) +{ + if (ParentSubsystem) + { + ParentSubsystem->OnSteamOverlayActivated_Bind.Broadcast((bool)CallbackData->m_bActive); + } +} +#endif \ No newline at end of file diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamRequestGroupOfficersCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamRequestGroupOfficersCallbackProxy.h similarity index 93% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamRequestGroupOfficersCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamRequestGroupOfficersCallbackProxy.h index 85197ca..adad4ac 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamRequestGroupOfficersCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamRequestGroupOfficersCallbackProxy.h @@ -15,9 +15,9 @@ #pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on.... #endif -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) -#include "OnlineSubsystemSteam.h" +//#include "OnlineSubsystemSteam.h" #pragma push_macro("ARRAY_COUNT") #undef ARRAY_COUNT @@ -87,7 +87,7 @@ class USteamRequestGroupOfficersCallbackProxy : public UOnlineBlueprintCallProxy private: -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) void OnRequestGroupOfficerDetails( ClanOfficerListResponse_t *pResult, bool bIOFailure); CCallResult m_callResultGroupOfficerRequestDetails; diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamWSRequestUGCDetailsCallbackProxy.h b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamWSRequestUGCDetailsCallbackProxy.h similarity index 92% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamWSRequestUGCDetailsCallbackProxy.h rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamWSRequestUGCDetailsCallbackProxy.h index 8b3b4ca..fcfaa2f 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamWSRequestUGCDetailsCallbackProxy.h +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamWSRequestUGCDetailsCallbackProxy.h @@ -16,9 +16,9 @@ #pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on.... #endif -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) -#include "OnlineSubsystemSteam.h" +//#include "OnlineSubsystemSteam.h" #pragma push_macro("ARRAY_COUNT") #undef ARRAY_COUNT @@ -72,7 +72,7 @@ class USteamWSRequestUGCDetailsCallbackProxy : public UOnlineBlueprintCallProxyB private: -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) // Internal callback when the operation completes, calls out to the public success/failure callbacks void OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure); diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamFriendsLibrary.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamFriendsLibrary.cpp similarity index 86% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamFriendsLibrary.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamFriendsLibrary.cpp index 10620db..d884bf0 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamFriendsLibrary.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamFriendsLibrary.cpp @@ -10,7 +10,7 @@ DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog); /*int32 UAdvancedSteamFriendsLibrary::GetFriendSteamLevel(const FBPUniqueNetId UniqueNetId) { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM) { UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!")); @@ -59,7 +59,7 @@ DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog); void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray & SteamGroups) { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (SteamAPI_Init()) { @@ -90,7 +90,7 @@ void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray & St void UAdvancedSteamFriendsLibrary::GetSteamFriendGamePlayed(const FBPUniqueNetId UniqueNetId, EBlueprintResultSwitch &Result/*, FString & GameName*/, int32 & AppID) { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM) { UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendGamePlayed Had a bad UniqueNetId!")); @@ -132,7 +132,7 @@ void UAdvancedSteamFriendsLibrary::GetSteamFriendGamePlayed(const FBPUniqueNetId int32 UAdvancedSteamFriendsLibrary::GetFriendSteamLevel(const FBPUniqueNetId UniqueNetId) { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM) { UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!")); @@ -153,7 +153,7 @@ int32 UAdvancedSteamFriendsLibrary::GetFriendSteamLevel(const FBPUniqueNetId Uni FString UAdvancedSteamFriendsLibrary::GetSteamPersonaName(const FBPUniqueNetId UniqueNetId) { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM) { UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamPersonaName Had a bad UniqueNetId!")); @@ -175,7 +175,7 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FStri { FBPUniqueNetId netId; -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (!(SteamID64.Len() > 0)) { UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("CreateSteamIDFromString Had a bad UniqueNetId!")); @@ -200,7 +200,7 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::GetLocalSteamIDFromSteam() { FBPUniqueNetId netId; -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (SteamAPI_Init()) { TSharedPtr SteamID(new const FUniqueNetIdSteam2(SteamUser()->GetSteamID())); @@ -213,7 +213,7 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::GetLocalSteamIDFromSteam() bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly) { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM) { UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("RequestSteamFriendInfo Had a bad UniqueNetId!")); @@ -235,7 +235,7 @@ bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId U bool UAdvancedSteamFriendsLibrary::OpenSteamUserOverlay(const FBPUniqueNetId UniqueNetId, ESteamUserOverlayType DialogType) { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM) { UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("OpenSteamUserOverlay Had a bad UniqueNetId!")); @@ -245,8 +245,15 @@ bool UAdvancedSteamFriendsLibrary::OpenSteamUserOverlay(const FBPUniqueNetId Uni if (SteamAPI_Init()) { uint64 id = *((uint64*)UniqueNetId.UniqueNetId->GetBytes()); - FString DialogName = EnumToString("ESteamUserOverlayType", (uint8)DialogType); - SteamFriends()->ActivateGameOverlayToUser(TCHAR_TO_ANSI(*DialogName), id); + if (DialogType == ESteamUserOverlayType::invitetolobby) + { + SteamFriends()->ActivateGameOverlayInviteDialog(id); + } + else + { + FString DialogName = EnumToString("ESteamUserOverlayType", (uint8)DialogType); + SteamFriends()->ActivateGameOverlayToUser(TCHAR_TO_ANSI(*DialogName), id); + } return true; } #endif @@ -257,7 +264,7 @@ bool UAdvancedSteamFriendsLibrary::OpenSteamUserOverlay(const FBPUniqueNetId Uni bool UAdvancedSteamFriendsLibrary::IsOverlayEnabled() { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (SteamAPI_Init()) { return SteamUtils()->IsOverlayEnabled(); @@ -270,7 +277,7 @@ bool UAdvancedSteamFriendsLibrary::IsOverlayEnabled() UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueNetId UniqueNetId, EBlueprintAsyncResultSwitch &Result, SteamAvatarSize AvatarSize) { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM) { UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendAvatar Had a bad UniqueNetId!")); @@ -339,16 +346,15 @@ UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueN FMemory::Memcpy(MipData, (void*)oAvatarRGBA, Height * Width * 4); PlatformData->Mips[0].BulkData.Unlock(); - // Original implementation was missing this!! - // the hell man...... - delete[] oAvatarRGBA; - //Setting some Parameters for the Texture and finally returning it PlatformData->SetNumSlices(1); Avatar->NeverStream = true; //Avatar->CompressionSettings = TC_EditorIcon; } + // Free RGBA buffer regardless of whether it was used or not + delete[] oAvatarRGBA; + Avatar->UpdateResource(); Result = EBlueprintAsyncResultSwitch::OnSuccess; @@ -371,7 +377,7 @@ UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueN bool UAdvancedSteamFriendsLibrary::InitTextFiltering() { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (SteamAPI_Init()) { @@ -385,7 +391,7 @@ bool UAdvancedSteamFriendsLibrary::InitTextFiltering() bool UAdvancedSteamFriendsLibrary::FilterText(FString TextToFilter, EBPTextFilteringContext Context, const FBPUniqueNetId TextSourceID, FString& FilteredText) { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (SteamAPI_Init()) { @@ -399,18 +405,7 @@ bool UAdvancedSteamFriendsLibrary::FilterText(FString TextToFilter, EBPTextFilte id = *((uint64*)TextSourceID.UniqueNetId->GetBytes()); } - // MAC is bugged with current steam version according to epic, they forced it to be the old steam ver -#if PLATFORM_MAC - // Filters the provided input message and places the filtered result into pchOutFilteredText. - // pchOutFilteredText is where the output will be placed, even if no filtering or censoring is performed - // nByteSizeOutFilteredText is the size (in bytes) of pchOutFilteredText - // pchInputText is the input string that should be filtered, which can be ASCII or UTF-8 - // bLegalOnly should be false if you want profanity and legally required filtering (where required) and true if you want legally required filtering only - // Returns the number of characters (not bytes) filtered. - int FilterCount = SteamUtils()->FilterText(OutText, BufferLen, TCHAR_TO_ANSI(*TextToFilter), Context == EBPTextFilteringContext::FContext_GameContent); -#else int FilterCount = SteamUtils()->FilterText((ETextFilteringContext)Context, id, TCHAR_TO_ANSI(*TextToFilter), OutText, BufferLen); -#endif if (FilterCount > 0) { @@ -430,7 +425,7 @@ bool UAdvancedSteamFriendsLibrary::FilterText(FString TextToFilter, EBPTextFilte bool UAdvancedSteamFriendsLibrary::IsSteamInBigPictureMode() { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (SteamAPI_Init()) { diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamSessions.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamSessions.cpp similarity index 100% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamSessions.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamSessions.cpp diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamWorkshopLibrary.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamWorkshopLibrary.cpp similarity index 91% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamWorkshopLibrary.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamWorkshopLibrary.cpp index 497f2b0..3bd2089 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamWorkshopLibrary.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamWorkshopLibrary.cpp @@ -8,7 +8,7 @@ DEFINE_LOG_CATEGORY(AdvancedSteamWorkshopLog); void UAdvancedSteamWorkshopLibrary::GetNumSubscribedWorkshopItems(int32 & NumberOfItems) { NumberOfItems = 0; -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (SteamAPI_Init()) { @@ -31,7 +31,7 @@ TArray UAdvancedSteamWorkshopLibrary::GetSubscribedWorkshopI TArray outArray; NumberOfItems = 0; -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (SteamAPI_Init()) { diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamRequestGroupOfficersCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamRequestGroupOfficersCallbackProxy.cpp similarity index 80% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamRequestGroupOfficersCallbackProxy.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamRequestGroupOfficersCallbackProxy.cpp index 973ae02..9d56b9a 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamRequestGroupOfficersCallbackProxy.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamRequestGroupOfficersCallbackProxy.cpp @@ -4,7 +4,7 @@ #include "Online/CoreOnline.h" #include "AdvancedSteamFriendsLibrary.h" #include "OnlineSubSystemHeader.h" -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) #include "steam/isteamfriends.h" #endif //#include "OnlineSubsystemSteamTypes.h" @@ -31,7 +31,7 @@ USteamRequestGroupOfficersCallbackProxy* USteamRequestGroupOfficersCallbackProxy void USteamRequestGroupOfficersCallbackProxy::Activate() { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (SteamAPI_Init()) { uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes()); @@ -45,22 +45,22 @@ void USteamRequestGroupOfficersCallbackProxy::Activate() OnFailure.Broadcast(EmptyArray); } -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanOfficerListResponse_t *pResult, bool bIOFailure) { TArray OfficerArray; - FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM)); + //FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM)); if (bIOFailure || !pResult || !pResult->m_bSuccess) { - if (SteamSubsystem != nullptr) + //if (SteamSubsystem != nullptr) { - SteamSubsystem->ExecuteNextTick([this]() - { + // SteamSubsystem->ExecuteNextTick([this]() + //{ TArray FailureArray; OnFailure.Broadcast(FailureArray); - }); + //}); } //OnFailure.Broadcast(OfficerArray); return; @@ -91,26 +91,26 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO OfficerArray.Add(Officer); } - if (SteamSubsystem != nullptr) - { - SteamSubsystem->ExecuteNextTick([OfficerArray, this]() - { + //if (SteamSubsystem != nullptr) + //{ + //SteamSubsystem->ExecuteNextTick([OfficerArray, this]() + //{ OnSuccess.Broadcast(OfficerArray); - }); - } + //}); + //} //OnSuccess.Broadcast(OfficerArray); return; } else { - if (SteamSubsystem != nullptr) + //if (SteamSubsystem != nullptr) { - SteamSubsystem->ExecuteNextTick([this]() - { + //SteamSubsystem->ExecuteNextTick([this]() + //{ TArray FailureArray; OnFailure.Broadcast(FailureArray); - }); + //}); } } diff --git a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamWSRequestUGCDetailsCallbackProxy.cpp b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamWSRequestUGCDetailsCallbackProxy.cpp similarity index 78% rename from Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamWSRequestUGCDetailsCallbackProxy.cpp rename to Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamWSRequestUGCDetailsCallbackProxy.cpp index 9be98ca..f3eefd5 100644 --- a/Plugins/AdvancedSessionsPlugin-master/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamWSRequestUGCDetailsCallbackProxy.cpp +++ b/Plugins/AdvancedSessionsPlugin/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamWSRequestUGCDetailsCallbackProxy.cpp @@ -2,7 +2,7 @@ #include "SteamWSRequestUGCDetailsCallbackProxy.h" #include "OnlineSubSystemHeader.h" -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) #include "steam/isteamugc.h" #endif @@ -25,7 +25,7 @@ USteamWSRequestUGCDetailsCallbackProxy* USteamWSRequestUGCDetailsCallbackProxy:: void USteamWSRequestUGCDetailsCallbackProxy::Activate() { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) if (SteamAPI_Init()) { // #TODO: Support arrays instead in the future? @@ -49,19 +49,19 @@ void USteamWSRequestUGCDetailsCallbackProxy::Activate() OnFailure.Broadcast(FBPSteamWorkshopItemDetails()); } -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if STEAM_SDK_INSTALLED && (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure) { - FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM)); + //FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM)); if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0) { - if (SteamSubsystem != nullptr) + //if (SteamSubsystem != nullptr) { - SteamSubsystem->ExecuteNextTick([this]() - { + // SteamSubsystem->ExecuteNextTick([this]() + //{ OnFailure.Broadcast(FBPSteamWorkshopItemDetails()); - }); + //}); } //OnFailure.Broadcast(FBPSteamWorkshopItemDetails()); return; @@ -71,12 +71,12 @@ void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQuer SteamUGCDetails_t Details; if (SteamUGC()->GetQueryUGCResult(pResult->m_handle, 0, &Details)) { - if (SteamSubsystem != nullptr) + //if (SteamSubsystem != nullptr) { - SteamSubsystem->ExecuteNextTick([Details, this]() - { + //SteamSubsystem->ExecuteNextTick([Details, this]() + //{ OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details)); - }); + //}); } //OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details)); @@ -85,12 +85,12 @@ void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQuer } else { - if (SteamSubsystem != nullptr) + //if (SteamSubsystem != nullptr) { - SteamSubsystem->ExecuteNextTick([this]() - { + //SteamSubsystem->ExecuteNextTick([this]() + //{ OnFailure.Broadcast(FBPSteamWorkshopItemDetails()); - }); + //}); } } diff --git a/Plugins/AdvancedSessionsPlugin/ExampleBlueprints/ExampleAdvancedSessionsFunctionsChar.uasset b/Plugins/AdvancedSessionsPlugin/ExampleBlueprints/ExampleAdvancedSessionsFunctionsChar.uasset new file mode 100644 index 0000000..8f3369b Binary files /dev/null and b/Plugins/AdvancedSessionsPlugin/ExampleBlueprints/ExampleAdvancedSessionsFunctionsChar.uasset differ