From 42ed1baf08ba9235d7942f77354382139ae07687 Mon Sep 17 00:00:00 2001 From: Simeon Wallrath Date: Wed, 18 Sep 2024 16:39:46 +0200 Subject: [PATCH] Updated to UE 5.4. as well as VRE and AdvancedSessions to latest --- .../Config/DefaultEngine.ini | 3 +- .../Character/BP_Teleport_Controller.uasset | 4 +- .../VRE/Core/Character/BP_VRCharacter.uasset | 4 +- .../Mannequins/Meshes/BP_Cabinet_Manny.uasset | 4 +- .../Mannequins/Rigs/PA_Mannequin.uasset | 4 +- .../GraspingHands/GraspingHandManny.uasset | 4 +- .../HandDuplicate/HandTest_Physics.uasset | 4 +- .../VRE/ExampleMap/MotionControllerMap.umap | 4 +- .../Misc/Examples/Potion/PotionActor.uasset | 4 +- .../AdvancedSessions/AdvancedSessions.uplugin | 4 +- .../Classes/AdvancedExternalUILibrary.h | 28 +-- .../Classes/AdvancedIdentityLibrary.h | 20 +-- .../Classes/AdvancedSessionsLibrary.h | 4 + .../Classes/AdvancedVoiceLibrary.h | 64 +++---- .../Classes/AutoLoginUserCallbackProxy.h | 2 +- .../Classes/CancelFindSessionsCallbackProxy.h | 2 +- .../CreateSessionCallbackProxyAdvanced.h | 2 +- .../Classes/EndSessionCallbackProxy.h | 2 +- .../Classes/FindFriendSessionCallbackProxy.h | 2 +- .../FindSessionsCallbackProxyAdvanced.h | 2 +- .../Classes/GetFriendsCallbackProxy.h | 2 +- .../Classes/GetRecentPlayersCallbackProxy.h | 2 +- .../Classes/GetUserPrivilegeCallbackProxy.h | 2 +- .../Classes/LoginUserCallbackProxy.h | 2 +- .../Classes/LogoutUserCallbackProxy.h | 2 +- .../Classes/SendFriendInviteCallbackProxy.h | 2 +- .../StartSessionCallbackProxyAdvanced.h | 4 +- .../UpdateSessionCallbackProxyAdvanced.h | 2 +- .../Private/AdvancedExternalUILibrary.cpp | 77 ++++++-- .../Private/AdvancedFriendsLibrary.cpp | 49 ++--- .../Private/AdvancedIdentityLibrary.cpp | 58 ++++-- .../Private/AdvancedSessionsLibrary.cpp | 5 + .../Private/AdvancedVoiceLibrary.cpp | 169 ++++++++++++++---- .../Private/AutoLoginUserCallbackProxy.cpp | 73 ++++---- .../CancelFindSessionsCallbackProxy.cpp | 4 +- .../CreateSessionCallbackProxyAdvanced.cpp | 6 +- .../Private/EndSessionCallbackProxy.cpp | 4 +- .../FindFriendSessionCallbackProxy.cpp | 57 ++++-- .../FindSessionsCallbackProxyAdvanced.cpp | 17 +- .../Private/GetFriendsCallbackProxy.cpp | 72 +++++--- .../Private/GetRecentPlayersCallbackProxy.cpp | 22 ++- .../Private/GetUserPrivilegeCallbackProxy.cpp | 9 +- .../Private/LoginUserCallbackProxy.cpp | 18 +- .../Private/LogoutUserCallbackProxy.cpp | 19 +- .../Private/SendFriendInviteCallbackProxy.cpp | 10 +- .../StartSessionCallbackProxyAdvanced.cpp | 12 +- .../UpdateSessionCallbackProxyAdvanced.cpp | 4 +- .../AdvancedSteamSessions.uplugin | 18 +- .../AdvancedSteamSessions.Build.cs | 2 +- .../Classes/AdvancedSteamFriendsLibrary.h | 6 +- .../Classes/AdvancedSteamWorkshopLibrary.h | 6 +- .../Classes/SteamNotificationsSubsystem.h | 11 +- .../SteamRequestGroupOfficersCallbackProxy.h | 4 +- .../SteamWSRequestUGCDetailsCallbackProxy.h | 4 +- .../Private/AdvancedSteamFriendsLibrary.cpp | 46 ++--- .../Private/AdvancedSteamWorkshopLibrary.cpp | 12 +- ...SteamRequestGroupOfficersCallbackProxy.cpp | 6 +- .../SteamWSRequestUGCDetailsCallbackProxy.cpp | 6 +- .../VRExpPluginExample.uproject | 17 +- 59 files changed, 671 insertions(+), 337 deletions(-) diff --git a/VIRTUOS_ExpansionPluginTests/Config/DefaultEngine.ini b/VIRTUOS_ExpansionPluginTests/Config/DefaultEngine.ini index 4cc00bc..3b08d45 100644 --- a/VIRTUOS_ExpansionPluginTests/Config/DefaultEngine.ini +++ b/VIRTUOS_ExpansionPluginTests/Config/DefaultEngine.ini @@ -163,6 +163,7 @@ bSendAnonymousUsageDataToEpic=False +Profiles=(Name="Ragdoll",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="PhysicsBody",CustomResponses=((Channel="Pawn",Response=ECR_Ignore)),HelpMessage="Simulating Skeletal Mesh Component. All other channels will be set to default.") +Profiles=(Name="Vehicle",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="Vehicle",CustomResponses=,HelpMessage="Vehicle object that blocks Vehicle, WorldStatic, and WorldDynamic. All other channels will be set to default.") +Profiles=(Name="UI",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility"),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ") ++Profiles=(Name="WaterBodyCollision",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="",CustomResponses=((Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="Default Water Collision Profile (Created by Water Plugin)") +DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,DefaultResponse=ECR_Block,bTraceType=True,bStaticObject=False,Name="VRTraceChannel") +DefaultChannelResponses=(Channel=ECC_GameTraceChannel2,DefaultResponse=ECR_Ignore,bTraceType=True,bStaticObject=False,Name="FloorTrace") +DefaultChannelResponses=(Channel=ECC_GameTraceChannel3,DefaultResponse=ECR_Ignore,bTraceType=False,bStaticObject=False,Name="PawnWalking") @@ -309,7 +310,7 @@ bEnableUniversalAPK=False bBundleABISplit=True bBundleLanguageSplit=True bBundleDensitySplit=True -ExtraApplicationSettings= +ExtraApplicationSettings= ExtraActivitySettings= bAndroidVoiceEnabled=False bEnableMulticastSupport=False diff --git a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/BP_Teleport_Controller.uasset b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/BP_Teleport_Controller.uasset index 0a1202b..efbb126 100644 --- a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/BP_Teleport_Controller.uasset +++ b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/BP_Teleport_Controller.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04b3307e5214b82e1b2ad882086dc9b4a9061a19c61a3bc5d4b6b286d66b3ac7 -size 2022116 +oid sha256:ee1222dc96a02d15b0c035151da81aba0c3961b1b26d7bc1e020af78bd48622e +size 2085215 diff --git a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/BP_VRCharacter.uasset b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/BP_VRCharacter.uasset index 9e043ca..cfdb8be 100644 --- a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/BP_VRCharacter.uasset +++ b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/BP_VRCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:425f4490f5782173b3a78d788db3aef191da4516fba7d6cfaf4c98fdf630e1ed -size 5512796 +oid sha256:0d721deeb9dee08a4f504d19cbac516764f925d2ef3b8ead3f5f953527941012 +size 5680149 diff --git a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/Mannequins/Meshes/BP_Cabinet_Manny.uasset b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/Mannequins/Meshes/BP_Cabinet_Manny.uasset index 594a108..3ad624b 100644 --- a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/Mannequins/Meshes/BP_Cabinet_Manny.uasset +++ b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/Mannequins/Meshes/BP_Cabinet_Manny.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:46d9094d75113658f8642368c872309fa5e8386be5d6523946ed7277047b9660 -size 61589 +oid sha256:a7392bcb4bb6e5af1aebad02cc6743af6e491de20213fdd461a540df103c6e69 +size 65350 diff --git a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/Mannequins/Rigs/PA_Mannequin.uasset b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/Mannequins/Rigs/PA_Mannequin.uasset index 116e267..dbb5352 100644 --- a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/Mannequins/Rigs/PA_Mannequin.uasset +++ b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/Character/Mannequins/Rigs/PA_Mannequin.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:87b29191d54fc003a515de686fffa1480a127a5950645df613fc12bd99a140fb -size 304429 +oid sha256:2e6a67da7ec7e7ac485fe843984d66af1d201499ed9f87c08213438761425841 +size 311591 diff --git a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/GraspingHands/GraspingHandManny.uasset b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/GraspingHands/GraspingHandManny.uasset index d3f0391..07b1d10 100644 --- a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/GraspingHands/GraspingHandManny.uasset +++ b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/GraspingHands/GraspingHandManny.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6e3f3d0445192dc7978ac16cb6a2fb89d0a8a4f6437a5495a3bc20bd33e3471d -size 2450041 +oid sha256:9f3e9fda659ae4689ba10c258c58ae3d79f3bbefe94330bf01f5a0c8210d15fa +size 2493568 diff --git a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/GraspingHands/VRHandMeshes/Meshes/HandDuplicate/HandTest_Physics.uasset b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/GraspingHands/VRHandMeshes/Meshes/HandDuplicate/HandTest_Physics.uasset index 353b8d5..ce5aeef 100644 --- a/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/GraspingHands/VRHandMeshes/Meshes/HandDuplicate/HandTest_Physics.uasset +++ b/VIRTUOS_ExpansionPluginTests/Content/VRE/Core/GraspingHands/VRHandMeshes/Meshes/HandDuplicate/HandTest_Physics.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7ab721abe3b48a4bf9b6e3644e457e8a90befe21ecc31b550990ae9110db48e6 -size 69987 +oid sha256:d5a9b26b8d24774f47a6fb0338d77f0eb27626e9948f2639b27d850a387af344 +size 70083 diff --git a/VIRTUOS_ExpansionPluginTests/Content/VRE/ExampleMap/MotionControllerMap.umap b/VIRTUOS_ExpansionPluginTests/Content/VRE/ExampleMap/MotionControllerMap.umap index bff7436..ec29bc4 100644 --- a/VIRTUOS_ExpansionPluginTests/Content/VRE/ExampleMap/MotionControllerMap.umap +++ b/VIRTUOS_ExpansionPluginTests/Content/VRE/ExampleMap/MotionControllerMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7559c7c99328a07b0ec62ee79d31b17983ab6ab937a28659ff111d7c57b8cd9b -size 890701 +oid sha256:e712b0e1cddf9c5753b7789c7b2c15ed4708807a99d94bbd94ac25a419fd219d +size 923673 diff --git a/VIRTUOS_ExpansionPluginTests/Content/VRE/Grippables/Misc/Examples/Potion/PotionActor.uasset b/VIRTUOS_ExpansionPluginTests/Content/VRE/Grippables/Misc/Examples/Potion/PotionActor.uasset index 80e30b8..b6e6c8f 100644 --- a/VIRTUOS_ExpansionPluginTests/Content/VRE/Grippables/Misc/Examples/Potion/PotionActor.uasset +++ b/VIRTUOS_ExpansionPluginTests/Content/VRE/Grippables/Misc/Examples/Potion/PotionActor.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7c7707a9c9a3b38513dd0eeda2704e3c55cdaf4a18087923ae92607404d6bffc -size 316300 +oid sha256:cceaf9070fa540d894cb910c0c0f8d75e1f7316304217419dd65c2e62b5bf379 +size 323618 diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/AdvancedSessions.uplugin b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/AdvancedSessions.uplugin index 594ee8f..7dc2e3a 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/AdvancedSessions.uplugin +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/AdvancedSessions.uplugin @@ -1,8 +1,8 @@ { "FileVersion": 3, "FriendlyName": "Advanced Sessions", - "Version": 5.1, - "VersionName": "5.1", + "Version": 5.4, + "VersionName": "5.4", "Description": "Adds new blueprint functions to handle more advanced session operations.", "Category": "Advanced Sessions Plugin", "CreatedBy": "Joshua Statzer", diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedExternalUILibrary.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedExternalUILibrary.h index 968f623..6153ed3 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedExternalUILibrary.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedIdentityLibrary.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedIdentityLibrary.h index 392ab8c..5f0dc15 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedIdentityLibrary.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessionsLibrary.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessionsLibrary.h index 54153ae..457bcdd 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedSessionsLibrary.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedVoiceLibrary.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedVoiceLibrary.h index 7f75b6c..da1128d 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedVoiceLibrary.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedVoiceLibrary.h @@ -32,68 +32,68 @@ 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); + 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") - static void StartNetworkedVoice(uint8 LocalPlayerNum = 0); + 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") - static void StopNetworkedVoice(uint8 LocalPlayerNum = 0); + 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") - static bool RegisterLocalTalker(uint8 LocalPlayerNum = 0); + 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") - static void RegisterAllLocalTalkers(); + 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") - static void UnRegisterLocalTalker(uint8 LocalPlayerNum = 0); + 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") - static void UnRegisterAllLocalTalkers(); + 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") - static bool RegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId); + 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") - static bool UnRegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId); + 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") - static void RemoveAllRemoteTalkers(); + 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") - static bool IsLocalPlayerTalking(uint8 LocalPlayerNum); + 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") - static bool IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNetId); + 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") - static bool IsPlayerMuted(uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId); + 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") - static bool MuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide = false); + 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") - static bool UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide = false); + 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") - static void GetNumLocalTalkers(int32 & NumLocalTalkers); + UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo", meta = (WorldContext = "WorldContextObject")) + static void GetNumLocalTalkers(UObject* WorldContextObject, int32 & NumLocalTalkers); }; diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AutoLoginUserCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AutoLoginUserCallbackProxy.h index dc91cff..d07a666 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/AutoLoginUserCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CancelFindSessionsCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CancelFindSessionsCallbackProxy.h index 59ebff3..58d2ea0 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CancelFindSessionsCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CreateSessionCallbackProxyAdvanced.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CreateSessionCallbackProxyAdvanced.h index 013ff0b..04ae6d1 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/CreateSessionCallbackProxyAdvanced.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/EndSessionCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/EndSessionCallbackProxy.h index 756c645..e527c58 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/EndSessionCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindFriendSessionCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindFriendSessionCallbackProxy.h index 6876995..58ef8f5 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindFriendSessionCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h index a998ba3..e610277 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/FindSessionsCallbackProxyAdvanced.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetFriendsCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetFriendsCallbackProxy.h index 57be8f7..844bef6 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetFriendsCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetRecentPlayersCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetRecentPlayersCallbackProxy.h index d0d7af4..2b12c9f 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetRecentPlayersCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetUserPrivilegeCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetUserPrivilegeCallbackProxy.h index 448ab59..f47d2a5 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/GetUserPrivilegeCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LoginUserCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LoginUserCallbackProxy.h index 08bfd4c..ba65b68 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LoginUserCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LogoutUserCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LogoutUserCallbackProxy.h index 9907095..5f85b0a 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/LogoutUserCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/SendFriendInviteCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/SendFriendInviteCallbackProxy.h index ca5c352..e878f51 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/SendFriendInviteCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/StartSessionCallbackProxyAdvanced.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/StartSessionCallbackProxyAdvanced.h index 246fc50..e82cce8 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/StartSessionCallbackProxyAdvanced.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/UpdateSessionCallbackProxyAdvanced.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/UpdateSessionCallbackProxyAdvanced.h index bd549a9..afdc181 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/UpdateSessionCallbackProxyAdvanced.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Classes/UpdateSessionCallbackProxyAdvanced.h @@ -64,6 +64,6 @@ private: bool bShouldAdvertise = true; // The world context object in which this call is taking place - UObject* WorldContextObject; + TWeakObjectPtr WorldContextObject; }; diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedExternalUILibrary.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedExternalUILibrary.cpp index f4b1766..a1792a1 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedExternalUILibrary.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp index 1af7a5b..5df1a94 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp @@ -138,7 +138,7 @@ void UAdvancedFriendsLibrary::GetFriend(APlayerController *PlayerController, con TSharedPtr fr = FriendsInterface->GetFriend(Player->GetControllerId(), *FriendUniqueNetId.GetUniqueNetId(), EFriendsLists::ToString(EFriendsLists::Default)); if (fr.IsValid()) { - FOnlineUserPresence pres = fr->GetPresence(); + const FOnlineUserPresence& pres = fr->GetPresence(); Friend.DisplayName = fr->GetDisplayName(); Friend.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State)); Friend.RealName = fr->GetRealName(); @@ -151,7 +151,8 @@ void UAdvancedFriendsLibrary::GetFriend(APlayerController *PlayerController, con Friend.PresenceInfo.bIsPlaying = pres.bIsPlaying; Friend.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame; Friend.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State)); - Friend.PresenceInfo.StatusString = pres.Status.StatusStr; + // #TODO: Check back in on this in shipping, epic is missing the UTF8_TO_TCHAR call on converting this and its making an invalid string + //Friend.PresenceInfo.StatusString = pres.Status.StatusStr; } } @@ -247,28 +248,34 @@ void UAdvancedFriendsLibrary::GetStoredFriendsList(APlayerController *PlayerCont TArray< TSharedRef > FriendList; - FriendsInterface->GetFriendsList(Player->GetControllerId(), EFriendsLists::ToString((EFriendsLists::Default)), FriendList); - - for (int32 i = 0; i < FriendList.Num(); i++) + if (FriendsInterface->GetFriendsList(Player->GetControllerId(), EFriendsLists::ToString((EFriendsLists::Default)), FriendList)) { - TSharedRef Friend = FriendList[i]; - FBPFriendInfo BPF; - FOnlineUserPresence pres = Friend->GetPresence(); + for (int32 i = 0; i < FriendList.Num(); i++) + { + FBPFriendInfo BPF; + const FOnlineUserPresence& pres = FriendList[i]->GetPresence(); - BPF.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State)); - BPF.DisplayName = Friend->GetDisplayName(); - BPF.RealName = Friend->GetRealName(); - BPF.UniqueNetId.SetUniqueNetId(Friend->GetUserId()); - BPF.bIsPlayingSameGame = pres.bIsPlayingThisGame; + BPF.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State)); + BPF.DisplayName = FriendList[i]->GetDisplayName(); + BPF.RealName = FriendList[i]->GetRealName(); + BPF.UniqueNetId.SetUniqueNetId(FriendList[i]->GetUserId()); + BPF.bIsPlayingSameGame = pres.bIsPlayingThisGame; - BPF.PresenceInfo.bIsOnline = pres.bIsOnline; - BPF.PresenceInfo.bHasVoiceSupport = pres.bHasVoiceSupport; - BPF.PresenceInfo.bIsPlaying = pres.bIsPlaying; - BPF.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State)); - BPF.PresenceInfo.StatusString = pres.Status.StatusStr; - BPF.PresenceInfo.bIsJoinable = pres.bIsJoinable; - BPF.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame; + BPF.PresenceInfo.bIsOnline = pres.bIsOnline; + BPF.PresenceInfo.bHasVoiceSupport = pres.bHasVoiceSupport; + BPF.PresenceInfo.bIsPlaying = pres.bIsPlaying; + BPF.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State)); + // #TODO: Check back in on this in shipping, epic is missing the UTF8_TO_TCHAR call on converting this and its making an invalid string + //BPF.PresenceInfo.StatusString = pres.Status.StatusStr; + BPF.PresenceInfo.bIsJoinable = pres.bIsJoinable; + BPF.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame; - FriendsList.Add(BPF); + FriendsList.Add(BPF); + } + + return; } + + UE_LOG(AdvancedFriendsLog, Warning, TEXT("GetFriendsList Failed to get any friends!")); + return; } \ No newline at end of file diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedIdentityLibrary.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedIdentityLibrary.cpp index a44d5ae..47a554b 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedIdentityLibrary.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessionsLibrary.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessionsLibrary.cpp index 9b2b6bf..a5453d1 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedSessionsLibrary.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp index f491524..f6321c1 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp @@ -5,9 +5,16 @@ //General Log DEFINE_LOG_CATEGORY(AdvancedVoiceLog); -void UAdvancedVoiceLibrary::IsHeadsetPresent(bool & bHasHeadset, uint8 LocalPlayerNum) +void UAdvancedVoiceLibrary::IsHeadsetPresent(UObject* WorldContextObject, bool & bHasHeadset, uint8 LocalPlayerNum) { - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -19,9 +26,16 @@ void UAdvancedVoiceLibrary::IsHeadsetPresent(bool & bHasHeadset, uint8 LocalPlay bHasHeadset = VoiceInterface->IsHeadsetPresent(LocalPlayerNum); } -void UAdvancedVoiceLibrary::StartNetworkedVoice(uint8 LocalPlayerNum) +void UAdvancedVoiceLibrary::StartNetworkedVoice(UObject* WorldContextObject, uint8 LocalPlayerNum) { - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -32,9 +46,16 @@ void UAdvancedVoiceLibrary::StartNetworkedVoice(uint8 LocalPlayerNum) VoiceInterface->StartNetworkedVoice(LocalPlayerNum); } -void UAdvancedVoiceLibrary::StopNetworkedVoice(uint8 LocalPlayerNum) +void UAdvancedVoiceLibrary::StopNetworkedVoice(UObject* WorldContextObject, uint8 LocalPlayerNum) { - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -45,9 +66,15 @@ void UAdvancedVoiceLibrary::StopNetworkedVoice(uint8 LocalPlayerNum) VoiceInterface->StopNetworkedVoice(LocalPlayerNum); } -bool UAdvancedVoiceLibrary::RegisterLocalTalker(uint8 LocalPlayerNum) +bool UAdvancedVoiceLibrary::RegisterLocalTalker(UObject* WorldContextObject, uint8 LocalPlayerNum) { - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -58,9 +85,16 @@ bool UAdvancedVoiceLibrary::RegisterLocalTalker(uint8 LocalPlayerNum) return VoiceInterface->RegisterLocalTalker(LocalPlayerNum); } -void UAdvancedVoiceLibrary::RegisterAllLocalTalkers() +void UAdvancedVoiceLibrary::RegisterAllLocalTalkers(UObject* WorldContextObject) { - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -72,9 +106,16 @@ void UAdvancedVoiceLibrary::RegisterAllLocalTalkers() } -void UAdvancedVoiceLibrary::UnRegisterLocalTalker(uint8 LocalPlayerNum) +void UAdvancedVoiceLibrary::UnRegisterLocalTalker(UObject* WorldContextObject, uint8 LocalPlayerNum) { - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -85,9 +126,16 @@ void UAdvancedVoiceLibrary::UnRegisterLocalTalker(uint8 LocalPlayerNum) VoiceInterface->UnregisterLocalTalker(LocalPlayerNum); } -void UAdvancedVoiceLibrary::UnRegisterAllLocalTalkers() +void UAdvancedVoiceLibrary::UnRegisterAllLocalTalkers(UObject* WorldContextObject) { - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -98,7 +146,7 @@ void UAdvancedVoiceLibrary::UnRegisterAllLocalTalkers() VoiceInterface->UnregisterLocalTalkers(); } -bool UAdvancedVoiceLibrary::RegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId) +bool UAdvancedVoiceLibrary::RegisterRemoteTalker(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId) { if (!UniqueNetId.IsValid()) { @@ -106,7 +154,13 @@ bool UAdvancedVoiceLibrary::RegisterRemoteTalker(const FBPUniqueNetId& UniqueNet return false; } - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -117,7 +171,7 @@ bool UAdvancedVoiceLibrary::RegisterRemoteTalker(const FBPUniqueNetId& UniqueNet return VoiceInterface->RegisterRemoteTalker(*UniqueNetId.GetUniqueNetId()); } -bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId) +bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId) { if (!UniqueNetId.IsValid()) { @@ -125,7 +179,13 @@ bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(const FBPUniqueNetId& UniqueN return false; } - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -136,9 +196,16 @@ bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(const FBPUniqueNetId& UniqueN return VoiceInterface->UnregisterRemoteTalker(*UniqueNetId.GetUniqueNetId()); } -void UAdvancedVoiceLibrary::RemoveAllRemoteTalkers() +void UAdvancedVoiceLibrary::RemoveAllRemoteTalkers(UObject* WorldContextObject) { - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -149,9 +216,16 @@ void UAdvancedVoiceLibrary::RemoveAllRemoteTalkers() VoiceInterface->RemoveAllRemoteTalkers(); } -bool UAdvancedVoiceLibrary::IsLocalPlayerTalking(uint8 LocalPlayerNum) +bool UAdvancedVoiceLibrary::IsLocalPlayerTalking(UObject* WorldContextObject, uint8 LocalPlayerNum) { - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -162,7 +236,7 @@ bool UAdvancedVoiceLibrary::IsLocalPlayerTalking(uint8 LocalPlayerNum) return VoiceInterface->IsLocalPlayerTalking(LocalPlayerNum); } -bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNetId) +bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId) { if (!UniqueNetId.IsValid()) { @@ -170,7 +244,13 @@ bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNe return false; } - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -181,7 +261,7 @@ bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNe return VoiceInterface->IsRemotePlayerTalking(*UniqueNetId.GetUniqueNetId()); } -bool UAdvancedVoiceLibrary::IsPlayerMuted(uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId) +bool UAdvancedVoiceLibrary::IsPlayerMuted(UObject* WorldContextObject, uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId) { if (!UniqueNetId.IsValid()) { @@ -189,7 +269,13 @@ bool UAdvancedVoiceLibrary::IsPlayerMuted(uint8 LocalUserNumChecking, const FBPU return false; } - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -200,7 +286,7 @@ bool UAdvancedVoiceLibrary::IsPlayerMuted(uint8 LocalUserNumChecking, const FBPU return VoiceInterface->IsMuted(LocalUserNumChecking, *UniqueNetId.GetUniqueNetId()); } -bool UAdvancedVoiceLibrary::MuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide) +bool UAdvancedVoiceLibrary::MuteRemoteTalker(UObject* WorldContextObject, uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide) { if (!UniqueNetId.IsValid()) { @@ -208,7 +294,13 @@ bool UAdvancedVoiceLibrary::MuteRemoteTalker(uint8 LocalUserNum, const FBPUnique return false; } - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -219,7 +311,7 @@ bool UAdvancedVoiceLibrary::MuteRemoteTalker(uint8 LocalUserNum, const FBPUnique return VoiceInterface->MuteRemoteTalker(LocalUserNum, *UniqueNetId.GetUniqueNetId(), bIsSystemWide); } -bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide) +bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(UObject* WorldContextObject, uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide) { if (!UniqueNetId.IsValid()) { @@ -227,7 +319,13 @@ bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniq return false; } - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return false; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { @@ -239,9 +337,16 @@ bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniq } -void UAdvancedVoiceLibrary::GetNumLocalTalkers(int32 & NumLocalTalkers) +void UAdvancedVoiceLibrary::GetNumLocalTalkers(UObject* WorldContextObject, int32 & NumLocalTalkers) { - IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); + + UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull); + if (!IsValid(World)) + { + return; + } + + IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World); if (!VoiceInterface.IsValid()) { diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AutoLoginUserCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AutoLoginUserCallbackProxy.cpp index 0c29769..9046773 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AutoLoginUserCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/AutoLoginUserCallbackProxy.cpp @@ -24,13 +24,19 @@ UAutoLoginUserCallbackProxy* UAutoLoginUserCallbackProxy::AutoLoginUser(UObject* void UAutoLoginUserCallbackProxy::Activate() { - auto Identity = Online::GetIdentityInterface(); - if (Identity.IsValid()) + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("AutoLoginUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + + if (Helper.OnlineSub != nullptr) { - DelegateHandle = Identity->AddOnLoginCompleteDelegate_Handle(LocalUserNumber, Delegate); - Identity->AutoLogin(LocalUserNumber); - return; + auto Identity = Helper.OnlineSub->GetIdentityInterface(); + + if (Identity.IsValid()) + { + DelegateHandle = Identity->AddOnLoginCompleteDelegate_Handle(LocalUserNumber, Delegate); + Identity->AutoLogin(LocalUserNumber); + return; + } } // Fail immediately @@ -39,38 +45,45 @@ void UAutoLoginUserCallbackProxy::Activate() void UAutoLoginUserCallbackProxy::OnCompleted(int32 LocalUserNum, bool bWasSuccessful, const FUniqueNetId& UserId, const FString& ErrorVal) { - auto Identity = Online::GetIdentityInterface(); - - if (Identity.IsValid()) + FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("AutoLoginUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull)); + + if (Helper.OnlineSub != nullptr) { - Identity->ClearOnLoginCompleteDelegate_Handle(LocalUserNum, DelegateHandle); - } + auto Identity = Helper.OnlineSub->GetIdentityInterface(); - if(APlayerController* PController = UGameplayStatics::GetPlayerController(WorldContextObject->GetWorld(), LocalUserNum)) - { - ULocalPlayer* Player = Cast(PController->Player); - - FUniqueNetIdRepl uniqueId(UserId.AsShared()); - - if (Player) + if (Identity.IsValid()) { - Player->SetCachedUniqueNetId(uniqueId); + Identity->ClearOnLoginCompleteDelegate_Handle(LocalUserNum, DelegateHandle); } - if (APlayerState* State = PController->PlayerState) + if (APlayerController* PController = UGameplayStatics::GetPlayerController(WorldContextObject->GetWorld(), LocalUserNum)) { - // Update UniqueId. See also ShowLoginUICallbackProxy.cpp - State->SetUniqueId(uniqueId); + 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(); } } - - if (bWasSuccessful) - { - OnSuccess.Broadcast(); - } - else - { - OnFailure.Broadcast(); - } + OnFailure.Broadcast(); } diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CancelFindSessionsCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CancelFindSessionsCallbackProxy.cpp index 7d29f5f..600187e 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CancelFindSessionsCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp index 71a7d85..1ff10c1 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/CreateSessionCallbackProxyAdvanced.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/EndSessionCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/EndSessionCallbackProxy.cpp index 0276399..ddb248c 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/EndSessionCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindFriendSessionCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindFriendSessionCallbackProxy.cpp index 79b25de..019255c 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindFriendSessionCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp index 56bb813..dc0dc4b 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/FindSessionsCallbackProxyAdvanced.cpp @@ -35,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()) @@ -115,8 +115,8 @@ void UFindSessionsCallbackProxyAdvanced::Activate() case EBPServerPresenceSearchType::ClientServersOnly: { tem.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals); - - if (bSearchLobbies) + + if (bSearchLobbies && !IOnlineSubsystem::DoesInstanceExist("STEAM")) tem.Set(SEARCH_LOBBIES, true, EOnlineComparisonOp::Equals); } break; @@ -142,7 +142,7 @@ void UFindSessionsCallbackProxyAdvanced::Activate() tem.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals); - if (bSearchLobbies) + if (bSearchLobbies && !IOnlineSubsystem::DoesInstanceExist("STEAM")) tem.Set(SEARCH_LOBBIES, true, EOnlineComparisonOp::Equals); //DedicatedOnly.Set(SEARCH_DEDICATED_ONLY, true, EOnlineComparisonOp::Equals); @@ -172,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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetFriendsCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetFriendsCallbackProxy.cpp index 80fc481..2d1d738 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetFriendsCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetFriendsCallbackProxy.cpp @@ -2,6 +2,7 @@ #include "GetFriendsCallbackProxy.h" #include "Online.h" +#include "Interfaces/OnlineFriendsInterface.h" #include "Interfaces/OnlinePresenceInterface.h" ////////////////////////////////////////////////////////////////////////// @@ -33,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); } @@ -52,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 @@ -60,29 +76,31 @@ void UGetFriendsCallbackProxy::OnReadFriendsListCompleted(int32 LocalUserNum, bo TArray FriendsListOut; TArray< TSharedRef > FriendList; - Friends->GetFriendsList(LocalUserNum, ListName, FriendList); - - for (int32 i = 0; i < FriendList.Num(); i++) + if (Friends->GetFriendsList(LocalUserNum, ListName, FriendList)) { - TSharedRef Friend = FriendList[i]; - FBPFriendInfo BPF; - FOnlineUserPresence pres = Friend->GetPresence(); - BPF.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State)); - BPF.DisplayName = Friend->GetDisplayName(); - BPF.RealName = Friend->GetRealName(); - BPF.UniqueNetId.SetUniqueNetId(Friend->GetUserId()); - BPF.bIsPlayingSameGame = pres.bIsPlayingThisGame; + for (int32 i = 0; i < FriendList.Num(); i++) + { + FBPFriendInfo BPF; + const FOnlineUserPresence& pres = FriendList[i]->GetPresence(); + BPF.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State)); + BPF.DisplayName = FriendList[i]->GetDisplayName(); + BPF.RealName = FriendList[i]->GetRealName(); + BPF.UniqueNetId.SetUniqueNetId(FriendList[i]->GetUserId()); + BPF.bIsPlayingSameGame = pres.bIsPlayingThisGame; - BPF.PresenceInfo.bIsOnline = pres.bIsOnline; - BPF.PresenceInfo.bHasVoiceSupport = pres.bHasVoiceSupport; - BPF.PresenceInfo.bIsPlaying = pres.bIsPlaying; - BPF.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State)); - BPF.PresenceInfo.StatusString = pres.Status.StatusStr; - BPF.PresenceInfo.bIsJoinable = pres.bIsJoinable; - BPF.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame; + BPF.PresenceInfo.bIsOnline = pres.bIsOnline; + BPF.PresenceInfo.bHasVoiceSupport = pres.bHasVoiceSupport; + BPF.PresenceInfo.bIsPlaying = pres.bIsPlaying; + BPF.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State)); + + // #TODO: Check back in on this in shipping, epic is missing the UTF8_TO_TCHAR call on converting this and its making an invalid string + //BPF.PresenceInfo.StatusString = pres.Status.StatusStr; + BPF.PresenceInfo.bIsJoinable = pres.bIsJoinable; + BPF.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame; - FriendsListOut.Add(BPF); + FriendsListOut.Add(BPF); + } } OnSuccess.Broadcast(FriendsListOut); diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetRecentPlayersCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetRecentPlayersCallbackProxy.cpp index 8eb3a3d..84bdcec 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetRecentPlayersCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetRecentPlayersCallbackProxy.cpp @@ -32,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); @@ -49,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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetUserPrivilegeCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetUserPrivilegeCallbackProxy.cpp index cec618f..7b1ef39 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetUserPrivilegeCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/GetUserPrivilegeCallbackProxy.cpp @@ -23,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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp index 3bb211d..584edc5 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp @@ -41,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 @@ -70,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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LogoutUserCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LogoutUserCallbackProxy.cpp index 29b1b53..07bc666 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LogoutUserCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/LogoutUserCallbackProxy.cpp @@ -30,7 +30,6 @@ void ULogoutUserCallbackProxy::Activate() return; } - ULocalPlayer* Player = Cast(PlayerControllerWeakPtr->Player); if (!Player) @@ -39,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()) { @@ -61,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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/SendFriendInviteCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/SendFriendInviteCallbackProxy.cpp index 71fed1e..7c407c4 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/SendFriendInviteCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/SendFriendInviteCallbackProxy.cpp @@ -40,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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/StartSessionCallbackProxyAdvanced.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/StartSessionCallbackProxyAdvanced.cpp index 3831384..d41e428 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/StartSessionCallbackProxyAdvanced.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/UpdateSessionCallbackProxyAdvanced.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/UpdateSessionCallbackProxyAdvanced.cpp index 7fa1ea0..31aa9d9 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/UpdateSessionCallbackProxyAdvanced.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSessions/Source/AdvancedSessions/Private/UpdateSessionCallbackProxyAdvanced.cpp @@ -30,7 +30,7 @@ UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::Update 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) { @@ -105,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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/AdvancedSteamSessions.uplugin b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/AdvancedSteamSessions.uplugin index fa63cb3..307c51e 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/AdvancedSteamSessions.uplugin +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/AdvancedSteamSessions.uplugin @@ -2,8 +2,8 @@ "FileVersion" : 3, "FriendlyName" : "Advanced Steam Sessions", - "Version" : 5.1, - "VersionName": "5.1", + "Version" : 5.4, + "VersionName": "5.4", "Description" : "Adds new blueprint functions to handle more advanced session operations in Steam. REQUIRES ADVANCED SESSIONS", "Category" : "Advanced Sessions Plugin", "CreatedBy" : "Joshua Statzer", @@ -11,11 +11,11 @@ "Modules" : [ - { - "Name" : "AdvancedSteamSessions", - "Type" : "RunTime", - "LoadingPhase" : "PreDefault" - } + { + "Name": "AdvancedSteamSessions", + "Type": "RunTime", + "LoadingPhase": "Default" + } ], "Plugins": [ { @@ -26,6 +26,10 @@ "Name": "OnlineSubsystem", "Enabled": true }, + { + "Name": "OnlineSubsystemSteam", + "Enabled": true + }, { "Name": "OnlineSubsystemUtils", "Enabled": true diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/AdvancedSteamSessions.Build.cs b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/AdvancedSteamSessions.Build.cs index 609d7b5..6a4c768 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/AdvancedSteamSessions.Build.cs +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/AdvancedSteamSessions.Build.cs @@ -15,7 +15,7 @@ public class AdvancedSteamSessions : ModuleRules if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Linux) || (Target.Platform == UnrealTargetPlatform.Mac)) { - PublicDependencyModuleNames.AddRange(new string[] { "Steamworks"/*, "OnlineSubsystemSteam"*/ }); + 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 } } diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamFriendsLibrary.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamFriendsLibrary.h index 7d8cead..83de461 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamFriendsLibrary.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED #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/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamWorkshopLibrary.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamWorkshopLibrary.h index 64c5d76..db56b35 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/AdvancedSteamWorkshopLibrary.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED #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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED #pragma push_macro("ARRAY_COUNT") #undef ARRAY_COUNT @@ -223,7 +223,7 @@ public: bTagsTruncated = false; } -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED FBPSteamWorkshopItemDetails(SteamUGCDetails_t &hUGCDetails) { ResultOfRequest = (FBPSteamResult)hUGCDetails.m_eResult; diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamNotificationsSubsystem.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamNotificationsSubsystem.h index a1b547c..7b8641a 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamNotificationsSubsystem.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamNotificationsSubsystem.h @@ -5,10 +5,7 @@ #include "CoreMinimal.h" #include "Subsystems/GameInstanceSubsystem.h" -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX - -//#include "OnlineSubsystemSteam.h" -//#include "OnlineSubsystemSteamPrivate.h" +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED #include @@ -43,7 +40,7 @@ public: ParentSubsystem = MyParent; } -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED cSteamEventsStore() : OnExternalUITriggeredCallback(this, &cSteamEventsStore::OnExternalUITriggered) { @@ -59,7 +56,7 @@ public: //~cSteamEventsStore(){} private: -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED STEAM_CALLBACK(cSteamEventsStore, OnExternalUITriggered, GameOverlayActivated_t, OnExternalUITriggeredCallback); #endif }; @@ -79,7 +76,7 @@ public: } }; -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED void USteamNotificationsSubsystem::cSteamEventsStore::OnExternalUITriggered(GameOverlayActivated_t* CallbackData) { if (ParentSubsystem) diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamRequestGroupOfficersCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamRequestGroupOfficersCallbackProxy.h index 9c73a23..73955dd 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamRequestGroupOfficersCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamRequestGroupOfficersCallbackProxy.h @@ -15,7 +15,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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED //#include "OnlineSubsystemSteam.h" @@ -87,7 +87,7 @@ class USteamRequestGroupOfficersCallbackProxy : public UOnlineBlueprintCallProxy private: -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED void OnRequestGroupOfficerDetails( ClanOfficerListResponse_t *pResult, bool bIOFailure); CCallResult m_callResultGroupOfficerRequestDetails; diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamWSRequestUGCDetailsCallbackProxy.h b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamWSRequestUGCDetailsCallbackProxy.h index 63d8c80..0adee7e 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamWSRequestUGCDetailsCallbackProxy.h +++ b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamWSRequestUGCDetailsCallbackProxy.h @@ -16,7 +16,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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED //#include "OnlineSubsystemSteam.h" @@ -72,7 +72,7 @@ class USteamWSRequestUGCDetailsCallbackProxy : public UOnlineBlueprintCallProxyB private: -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED // Internal callback when the operation completes, calls out to the public success/failure callbacks void OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure); diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamFriendsLibrary.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamFriendsLibrary.cpp index 91f822e..85340e4 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamFriendsLibrary.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED 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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED if (SteamAPI_Init()) { @@ -419,7 +425,7 @@ bool UAdvancedSteamFriendsLibrary::FilterText(FString TextToFilter, EBPTextFilte bool UAdvancedSteamFriendsLibrary::IsSteamInBigPictureMode() { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED if (SteamAPI_Init()) { diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamWorkshopLibrary.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamWorkshopLibrary.cpp index 497f2b0..03eb780 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/AdvancedSteamWorkshopLibrary.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED if (SteamAPI_Init()) { @@ -20,10 +20,10 @@ void UAdvancedSteamWorkshopLibrary::GetNumSubscribedWorkshopItems(int32 & Number UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetNumSubscribedWorkshopItemCount : SteamAPI is not Inited!")); return; } -#endif - +#else UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetNumSubscribedWorkshopItemCount : Called on an incompatible platform")); return; +#endif } TArray UAdvancedSteamWorkshopLibrary::GetSubscribedWorkshopItems(int32 & NumberOfItems) @@ -31,7 +31,7 @@ TArray UAdvancedSteamWorkshopLibrary::GetSubscribedWorkshopI TArray outArray; NumberOfItems = 0; -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED if (SteamAPI_Init()) { @@ -62,8 +62,8 @@ TArray UAdvancedSteamWorkshopLibrary::GetSubscribedWorkshopI UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetSubscribedWorkshopItemCount : SteamAPI is not Inited!")); return outArray; } -#endif - +#else UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetSubscribedWorkshopItemCount : Called on an incompatible platform")); return outArray; +#endif } diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamRequestGroupOfficersCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamRequestGroupOfficersCallbackProxy.cpp index 337239c..44bcc75 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamRequestGroupOfficersCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED #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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED if (SteamAPI_Init()) { uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes()); @@ -45,7 +45,7 @@ void USteamRequestGroupOfficersCallbackProxy::Activate() OnFailure.Broadcast(EmptyArray); } -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanOfficerListResponse_t *pResult, bool bIOFailure) { TArray OfficerArray; diff --git a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamWSRequestUGCDetailsCallbackProxy.cpp b/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamWSRequestUGCDetailsCallbackProxy.cpp index 95bee5c..daf3b07 100644 --- a/VIRTUOS_ExpansionPluginTests/Plugins/AdvancedSessions/AdvancedSteamSessions/Source/AdvancedSteamSessions/Private/SteamWSRequestUGCDetailsCallbackProxy.cpp +++ b/VIRTUOS_ExpansionPluginTests/Plugins/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 (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED #include "steam/isteamugc.h" #endif @@ -25,7 +25,7 @@ USteamWSRequestUGCDetailsCallbackProxy* USteamWSRequestUGCDetailsCallbackProxy:: void USteamWSRequestUGCDetailsCallbackProxy::Activate() { -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED if (SteamAPI_Init()) { // #TODO: Support arrays instead in the future? @@ -49,7 +49,7 @@ void USteamWSRequestUGCDetailsCallbackProxy::Activate() OnFailure.Broadcast(FBPSteamWorkshopItemDetails()); } -#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure) { //FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM)); diff --git a/VIRTUOS_ExpansionPluginTests/VRExpPluginExample.uproject b/VIRTUOS_ExpansionPluginTests/VRExpPluginExample.uproject index 99879d0..146c57c 100644 --- a/VIRTUOS_ExpansionPluginTests/VRExpPluginExample.uproject +++ b/VIRTUOS_ExpansionPluginTests/VRExpPluginExample.uproject @@ -17,7 +17,8 @@ "SupportedTargetPlatforms": [ "Win64", "Linux", - "Android" + "Android", + "VisionOS" ] }, { @@ -61,7 +62,8 @@ "SupportedTargetPlatforms": [ "Win64", "Linux", - "Android" + "Android", + "VisionOS" ] }, { @@ -75,12 +77,11 @@ }, { "Name": "USDImporter", - "Enabled": true, - "SupportedTargetPlatforms": [ - "Win64", - "Mac", - "Linux" - ] + "Enabled": true + }, + { + "Name": "StudioTelemetry", + "Enabled": false } ], "TargetPlatforms": [