mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-25 09:24:18 +00:00
Compare commits
4 Commits
master
...
4.24_Locke
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
707c055f49 | ||
|
|
aee6c013d6 | ||
|
|
064c1a989d | ||
|
|
6b315302e2 |
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,2 +0,0 @@
|
|||||||
* text=auto
|
|
||||||
*.bat eol=crlf
|
|
||||||
@@ -1,17 +1,20 @@
|
|||||||
{
|
{
|
||||||
"FileVersion": 3,
|
"FileVersion" : 3,
|
||||||
"FriendlyName": "Advanced Sessions",
|
|
||||||
"Version": 5.5,
|
"FriendlyName" : "Advanced Sessions",
|
||||||
"VersionName": "5.5",
|
"Version" : 4.24,
|
||||||
"Description": "Adds new blueprint functions to handle more advanced session operations.",
|
"VersionName": "4.24",
|
||||||
"Category": "Advanced Sessions Plugin",
|
"Description" : "Adds new blueprint functions to handle more advanced session operations.",
|
||||||
"CreatedBy": "Joshua Statzer",
|
"Category" : "Advanced Sessions Plugin",
|
||||||
"CreatedByURL": "N/A",
|
"CreatedBy" : "Joshua Statzer",
|
||||||
"Modules": [
|
"CreatedByURL" : "N/A",
|
||||||
|
|
||||||
|
"Modules" :
|
||||||
|
[
|
||||||
{
|
{
|
||||||
"Name": "AdvancedSessions",
|
"Name" : "AdvancedSessions",
|
||||||
"Type": "Runtime",
|
"Type" : "RunTime",
|
||||||
"LoadingPhase": "PreDefault"
|
"LoadingPhase" : "PreDefault"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Plugins": [
|
"Plugins": [
|
||||||
@@ -23,12 +26,5 @@
|
|||||||
"Name": "OnlineSubsystemUtils",
|
"Name": "OnlineSubsystemUtils",
|
||||||
"Enabled": true
|
"Enabled": true
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"DocsURL": "",
|
|
||||||
"MarketplaceURL": "",
|
|
||||||
"SupportURL": "",
|
|
||||||
"CanContainContent": false,
|
|
||||||
"IsBetaVersion": false,
|
|
||||||
"IsExperimentalVersion": false,
|
|
||||||
"Installed": false
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
[FilterPlugin]
|
|
||||||
; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and
|
|
||||||
; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively.
|
|
||||||
;
|
|
||||||
; Examples:
|
|
||||||
; /README.txt
|
|
||||||
; /Extras/...
|
|
||||||
; /Binaries/ThirdParty/*.dll
|
|
||||||
@@ -5,9 +5,6 @@ public class AdvancedSessions : ModuleRules
|
|||||||
{
|
{
|
||||||
public AdvancedSessions(ReadOnlyTargetRules Target) : base(Target)
|
public AdvancedSessions(ReadOnlyTargetRules Target) : base(Target)
|
||||||
{
|
{
|
||||||
DefaultBuildSettings = BuildSettingsVersion.Latest;
|
|
||||||
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
|
|
||||||
|
|
||||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
//bEnforceIWYU = true;
|
//bEnforceIWYU = true;
|
||||||
|
|
||||||
@@ -16,5 +13,6 @@ public class AdvancedSessions : ModuleRules
|
|||||||
// PrivateIncludePaths.AddRange(new string[] { "AdvancedSessions/Private"/*, "OnlineSubsystemSteam/Private"*/ });
|
// PrivateIncludePaths.AddRange(new string[] { "AdvancedSessions/Private"/*, "OnlineSubsystemSteam/Private"*/ });
|
||||||
// PublicIncludePaths.AddRange(new string[] { "AdvancedSessions/Public" });
|
// PublicIncludePaths.AddRange(new string[] { "AdvancedSessions/Public" });
|
||||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem", "CoreUObject", "OnlineSubsystemUtils", "Networking", "Sockets"/*"Voice", "OnlineSubsystemSteam"*/ });
|
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem", "CoreUObject", "OnlineSubsystemUtils", "Networking", "Sockets"/*"Voice", "OnlineSubsystemSteam"*/ });
|
||||||
|
PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "Sockets", "Networking", "OnlineSubsystemUtils" /*"Voice", "Steamworks","OnlineSubsystemSteam"*/});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,32 +32,32 @@ public:
|
|||||||
//********* External UI Functions *************//
|
//********* External UI Functions *************//
|
||||||
|
|
||||||
// Show the UI that handles the Friends list
|
// Show the UI that handles the Friends list
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result"))
|
||||||
static void ShowFriendsUI(UObject* WorldContextObject, APlayerController *PlayerController, EBlueprintResultSwitch &Result);
|
static void ShowFriendsUI(APlayerController *PlayerController, EBlueprintResultSwitch &Result);
|
||||||
|
|
||||||
// Show the UI that handles inviting people to your game
|
// Show the UI that handles inviting people to your game
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result"))
|
||||||
static void ShowInviteUI(UObject* WorldContextObject, APlayerController *PlayerController, EBlueprintResultSwitch &Result);
|
static void ShowInviteUI(APlayerController *PlayerController, EBlueprintResultSwitch &Result);
|
||||||
|
|
||||||
// Show the UI that shows the leaderboard (doesn't work with steam)
|
// Show the UI that shows the leaderboard (doesn't work with steam)
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result"))
|
||||||
static void ShowLeaderBoardUI(UObject* WorldContextObject, FString LeaderboardName, EBlueprintResultSwitch &Result);
|
static void ShowLeaderBoardUI(FString LeaderboardName, EBlueprintResultSwitch &Result);
|
||||||
|
|
||||||
// Show the UI that shows a web URL
|
// Show the UI that shows a web URL
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", AutoCreateRefTerm = "AllowedDomains", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", AutoCreateRefTerm = "AllowedDomains"))
|
||||||
static void ShowWebURLUI(UObject* WorldContextObject, FString URLToShow, EBlueprintResultSwitch &Result, TArray<FString>& AllowedDomains, bool bEmbedded = false , bool bShowBackground = false, bool bShowCloseButton = false, int32 OffsetX = 0, int32 OffsetY = 0, int32 SizeX = 0, int32 SizeY = 0);
|
static void ShowWebURLUI(FString URLToShow, EBlueprintResultSwitch &Result, TArray<FString>& 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
|
// Show the UI that shows a web URL
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI")
|
||||||
static void CloseWebURLUI(UObject* WorldContextObject);
|
static void CloseWebURLUI();
|
||||||
|
|
||||||
|
|
||||||
// Show the UI that shows the profile of a uniquenetid
|
// Show the UI that shows the profile of a uniquenetid
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result"))
|
||||||
static void ShowProfileUI(UObject* WorldContextObject, const FBPUniqueNetId PlayerViewingProfile, const FBPUniqueNetId PlayerToViewProfileOf, EBlueprintResultSwitch &Result);
|
static void ShowProfileUI(const FBPUniqueNetId PlayerViewingProfile, const FBPUniqueNetId PlayerToViewProfileOf, EBlueprintResultSwitch &Result);
|
||||||
|
|
||||||
// Show the UI that shows the account upgrade UI (doesn't work with steam)
|
// Show the UI that shows the account upgrade UI (doesn't work with steam)
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedExternalUI", meta = (ExpandEnumAsExecs = "Result"))
|
||||||
static void ShowAccountUpgradeUI(UObject* WorldContextObject, const FBPUniqueNetId PlayerRequestingAccountUpgradeUI, EBlueprintResultSwitch &Result);
|
static void ShowAccountUpgradeUI(const FBPUniqueNetId PlayerRequestingAccountUpgradeUI, EBlueprintResultSwitch &Result);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,11 +44,6 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = AdvancedVoiceInterface)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = AdvancedVoiceInterface)
|
||||||
bool bEnableTalkingStatusDelegate;
|
bool bEnableTalkingStatusDelegate;
|
||||||
|
|
||||||
// If true we will auto travel to a game session when an invite is received.
|
|
||||||
// This can get in the way of Beacon Sessions, you may want to disable it.
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = AdvancedFriendsInterface)
|
|
||||||
bool bAutoTravelOnAcceptedUserInviteReceived = true;
|
|
||||||
|
|
||||||
//virtual void PostLoad() override;
|
//virtual void PostLoad() override;
|
||||||
virtual void Shutdown() override;
|
virtual void Shutdown() override;
|
||||||
virtual void Init() override;
|
virtual void Init() override;
|
||||||
@@ -57,13 +52,6 @@ public:
|
|||||||
FOnSessionInviteReceivedDelegate SessionInviteReceivedDelegate;
|
FOnSessionInviteReceivedDelegate SessionInviteReceivedDelegate;
|
||||||
FDelegateHandle SessionInviteReceivedDelegateHandle;
|
FDelegateHandle SessionInviteReceivedDelegateHandle;
|
||||||
|
|
||||||
// custom handle to join directly from steam ui "Join Game"
|
|
||||||
FDelegateHandle OnJoinSessionCompleteDelegateHandle;
|
|
||||||
// custom Steam UI Join User function #Self invite#
|
|
||||||
void OnSessionUserInviteAccepted(const bool bWasSuccessful, const int32 ControllerId, FUniqueNetIdPtr UserId, const FOnlineSessionSearchResult& InviteResult);
|
|
||||||
// custom Steam UI function to client travel #Self invite#
|
|
||||||
void OnJoinSessionComplete(FName SessionName, EOnJoinSessionCompleteResult::Type Result);
|
|
||||||
|
|
||||||
//const FUniqueNetId& /*UserId*/, const FUniqueNetId& /*FromId*/, const FString& /*AppId*/, const FOnlineSessionSearchResult& /*InviteResult*/
|
//const FUniqueNetId& /*UserId*/, const FUniqueNetId& /*FromId*/, const FString& /*AppId*/, const FOnlineSessionSearchResult& /*InviteResult*/
|
||||||
void OnSessionInviteReceivedMaster(const FUniqueNetId & PersonInvited, const FUniqueNetId & PersonInviting, const FString & AppId, const FOnlineSessionSearchResult& SessionToJoin);
|
void OnSessionInviteReceivedMaster(const FUniqueNetId & PersonInvited, const FUniqueNetId & PersonInviting, const FString & AppId, const FOnlineSessionSearchResult& SessionToJoin);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include "Engine/GameInstance.h"
|
#include "Engine/GameInstance.h"
|
||||||
#include "GameFramework/GameModeBase.h"
|
#include "GameFramework/GameModeBase.h"
|
||||||
#include "GameFramework/GameSession.h"
|
#include "GameFramework/GameSession.h"
|
||||||
#include "GameFramework/PlayerState.h"
|
|
||||||
|
|
||||||
//#include "UObjectIterator.h"
|
//#include "UObjectIterator.h"
|
||||||
|
|
||||||
|
|||||||
@@ -28,26 +28,26 @@ public:
|
|||||||
//********* Identity Functions *************//
|
//********* Identity Functions *************//
|
||||||
|
|
||||||
// Get the login status of a local player
|
// Get the login status of a local player
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity", meta = (ExpandEnumAsExecs = "Result"))
|
||||||
static void GetLoginStatus(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetID, EBPLoginStatus & LoginStatus, EBlueprintResultSwitch &Result);
|
static void GetLoginStatus(const FBPUniqueNetId & UniqueNetID, EBPLoginStatus & LoginStatus, EBlueprintResultSwitch &Result);
|
||||||
|
|
||||||
// Get the auth token for a local player
|
// Get the auth token for a local player
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity", meta = (ExpandEnumAsExecs = "Result"))
|
||||||
static void GetPlayerAuthToken(UObject* WorldContextObject, APlayerController * PlayerController, FString & AuthToken, EBlueprintResultSwitch &Result);
|
static void GetPlayerAuthToken(APlayerController * PlayerController, FString & AuthToken, EBlueprintResultSwitch &Result);
|
||||||
|
|
||||||
// Get a players nickname
|
// Get a players nickname
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedIdentity", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedIdentity")
|
||||||
static void GetPlayerNickname(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetID, FString & PlayerNickname);
|
static void GetPlayerNickname(const FBPUniqueNetId & UniqueNetID, FString & PlayerNickname);
|
||||||
|
|
||||||
//********* User Account Functions *************//
|
//********* User Account Functions *************//
|
||||||
|
|
||||||
// Get a users account
|
// Get a users account
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity|UserAccount", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity|UserAccount", meta = (ExpandEnumAsExecs = "Result"))
|
||||||
static void GetUserAccount(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetId, FBPUserOnlineAccount & AccountInfo, EBlueprintResultSwitch &Result);
|
static void GetUserAccount(const FBPUniqueNetId & UniqueNetId, FBPUserOnlineAccount & AccountInfo, EBlueprintResultSwitch &Result);
|
||||||
|
|
||||||
// Get all known users accounts
|
// Get all known users accounts
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity|UserAccount", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedIdentity|UserAccount", meta = (ExpandEnumAsExecs = "Result"))
|
||||||
static void GetAllUserAccounts(UObject* WorldContextObject, TArray<FBPUserOnlineAccount> & AccountInfos, EBlueprintResultSwitch &Result);
|
static void GetAllUserAccounts(TArray<FBPUserOnlineAccount> & AccountInfos, EBlueprintResultSwitch &Result);
|
||||||
|
|
||||||
// Get a user account access token
|
// Get a user account access token
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedIdentity|UserAccount")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedIdentity|UserAccount")
|
||||||
|
|||||||
@@ -160,10 +160,6 @@ public:
|
|||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|PlayerInfo|PlayerID")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|PlayerInfo|PlayerID")
|
||||||
static void GetUniqueNetID(APlayerController *PlayerController, FBPUniqueNetId &UniqueNetId);
|
static void GetUniqueNetID(APlayerController *PlayerController, FBPUniqueNetId &UniqueNetId);
|
||||||
|
|
||||||
// Get the unique net id of a network player attached to the given controller
|
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|PlayerInfo|PlayerID")
|
|
||||||
static void GetUniqueNetIdOfSessionOwner(FBlueprintSessionResult SessionResult, FBPUniqueNetId& UniqueNetId);
|
|
||||||
|
|
||||||
// Get the unique net id of a network player who is assigned the the given player state
|
// Get the unique net id of a network player who is assigned the the given player state
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|PlayerInfo|PlayerID")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|PlayerInfo|PlayerID")
|
||||||
static void GetUniqueNetIDFromPlayerState(APlayerState *PlayerState, FBPUniqueNetId &UniqueNetId);
|
static void GetUniqueNetIDFromPlayerState(APlayerState *PlayerState, FBPUniqueNetId &UniqueNetId);
|
||||||
@@ -176,10 +172,6 @@ public:
|
|||||||
UFUNCTION(BlueprintPure, meta = (DisplayName = "Equal Unique Net ID", CompactNodeTitle = "==", Keywords = "== equal"), Category = "Online|AdvancedSessions|PlayerInfo|PlayerID")
|
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);
|
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
|
// Check if a UniqueNetId is a friend
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|UniqueNetId")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|UniqueNetId")
|
||||||
static void UniqueNetIdToString(const FBPUniqueNetId &UniqueNetId, FString &String);
|
static void UniqueNetIdToString(const FBPUniqueNetId &UniqueNetId, FString &String);
|
||||||
@@ -214,4 +206,5 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category = "Online|AdvancedSessions|Seamless", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category = "Online|AdvancedSessions|Seamless", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
|
||||||
static bool ServerTravel(UObject* WorldContextObject, const FString& InURL, bool bAbsolute, bool bShouldSkipGameNotify);
|
static bool ServerTravel(UObject* WorldContextObject, const FString& InURL, bool bAbsolute, bool bShouldSkipGameNotify);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,68 +32,68 @@ public:
|
|||||||
//********* Voice Library Functions *************//
|
//********* Voice Library Functions *************//
|
||||||
|
|
||||||
// Get if a headset is present for the specified local user
|
// Get if a headset is present for the specified local user
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo")
|
||||||
static void IsHeadsetPresent(UObject* WorldContextObject, bool & bHasHeadset, uint8 LocalPlayerNum = 0);
|
static void IsHeadsetPresent(bool & bHasHeadset, uint8 LocalPlayerNum = 0);
|
||||||
|
|
||||||
// Starts networked voice, allows push to talk in coordination with StopNetworkedVoice
|
// Starts networked voice, allows push to talk in coordination with StopNetworkedVoice
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static void StartNetworkedVoice(UObject* WorldContextObject, uint8 LocalPlayerNum = 0);
|
static void StartNetworkedVoice(uint8 LocalPlayerNum = 0);
|
||||||
|
|
||||||
// Stops networked voice, allows push to talk in coordination with StartNetworkedVoice
|
// Stops networked voice, allows push to talk in coordination with StartNetworkedVoice
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static void StopNetworkedVoice(UObject* WorldContextObject, uint8 LocalPlayerNum = 0);
|
static void StopNetworkedVoice(uint8 LocalPlayerNum = 0);
|
||||||
|
|
||||||
// Registers a local player as someone interested in voice data
|
// Registers a local player as someone interested in voice data
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static bool RegisterLocalTalker(UObject* WorldContextObject, uint8 LocalPlayerNum = 0);
|
static bool RegisterLocalTalker(uint8 LocalPlayerNum = 0);
|
||||||
|
|
||||||
// Registers all signed in players as local talkers
|
// Registers all signed in players as local talkers
|
||||||
// This is already done automatically, only do it manually if you unregistered someone
|
// This is already done automatically, only do it manually if you unregistered someone
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static void RegisterAllLocalTalkers(UObject* WorldContextObject);
|
static void RegisterAllLocalTalkers();
|
||||||
|
|
||||||
// UnRegisters local player as a local talker
|
// UnRegisters local player as a local talker
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static void UnRegisterLocalTalker(UObject* WorldContextObject, uint8 LocalPlayerNum = 0);
|
static void UnRegisterLocalTalker(uint8 LocalPlayerNum = 0);
|
||||||
|
|
||||||
// UnRegisters all signed in players as local talkers
|
// UnRegisters all signed in players as local talkers
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static void UnRegisterAllLocalTalkers(UObject* WorldContextObject);
|
static void UnRegisterAllLocalTalkers();
|
||||||
|
|
||||||
// Registers a remote player as a talker
|
// Registers a remote player as a talker
|
||||||
// This is already done automatically, only do it manually if you unregistered someone
|
// This is already done automatically, only do it manually if you unregistered someone
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static bool RegisterRemoteTalker(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId);
|
static bool RegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId);
|
||||||
|
|
||||||
// UnRegisters a remote player as a talker
|
// UnRegisters a remote player as a talker
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static bool UnRegisterRemoteTalker(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId);
|
static bool UnRegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId);
|
||||||
|
|
||||||
// UnRegisters all remote players as talkers
|
// UnRegisters all remote players as talkers
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static void RemoveAllRemoteTalkers(UObject* WorldContextObject);
|
static void RemoveAllRemoteTalkers();
|
||||||
|
|
||||||
// Returns whether a local player is currently talking
|
// Returns whether a local player is currently talking
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo")
|
||||||
static bool IsLocalPlayerTalking(UObject* WorldContextObject, uint8 LocalPlayerNum);
|
static bool IsLocalPlayerTalking(uint8 LocalPlayerNum);
|
||||||
|
|
||||||
// Returns whether a remote player is currently talking
|
// Returns whether a remote player is currently talking
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo")
|
||||||
static bool IsRemotePlayerTalking(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId);
|
static bool IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNetId);
|
||||||
|
|
||||||
// Returns whether a player is muted for the specified local player
|
// Returns whether a player is muted for the specified local player
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo")
|
||||||
static bool IsPlayerMuted(UObject* WorldContextObject, uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId);
|
static bool IsPlayerMuted(uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId);
|
||||||
|
|
||||||
// Mutes the player associated with the uniquenetid for the specified local player, if IsSystemWide is true then it will attempt to mute globally for the player
|
// Mutes the player associated with the uniquenetid for the specified local player, if IsSystemWide is true then it will attempt to mute globally for the player
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static bool MuteRemoteTalker(UObject* WorldContextObject, uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide = false);
|
static bool MuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide = false);
|
||||||
|
|
||||||
// UnMutes the player associated with the uniquenetid for the specified local player, if IsSystemWide is true then it will attempt to unmute globally for the player
|
// UnMutes the player associated with the uniquenetid for the specified local player, if IsSystemWide is true then it will attempt to unmute globally for the player
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static bool UnMuteRemoteTalker(UObject* WorldContextObject, uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide = false);
|
static bool UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide = false);
|
||||||
|
|
||||||
// Gets the number of local talkers for this system
|
// Gets the number of local talkers for this system
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedVoice|VoiceInfo")
|
||||||
static void GetNumLocalTalkers(UObject* WorldContextObject, int32 & NumLocalTalkers);
|
static void GetNumLocalTalkers(int32 & NumLocalTalkers);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
|
||||||
#include "Interfaces/OnlineIdentityInterface.h"
|
|
||||||
#include "Engine/LocalPlayer.h"
|
|
||||||
#include "AutoLoginUserCallbackProxy.generated.h"
|
|
||||||
|
|
||||||
UCLASS(MinimalAPI)
|
|
||||||
class UAutoLoginUserCallbackProxy : public UOnlineBlueprintCallProxyBase
|
|
||||||
{
|
|
||||||
GENERATED_UCLASS_BODY()
|
|
||||||
|
|
||||||
// Called when there is a successful destroy
|
|
||||||
UPROPERTY(BlueprintAssignable)
|
|
||||||
FEmptyOnlineDelegate OnSuccess;
|
|
||||||
|
|
||||||
// Called when there is an unsuccessful destroy
|
|
||||||
UPROPERTY(BlueprintAssignable)
|
|
||||||
FEmptyOnlineDelegate OnFailure;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Logs the player into the online service using parameters passed on the
|
|
||||||
* command line. Expects -AUTH_LOGIN=<UserName> -AUTH_PASSWORD=<password>. If either
|
|
||||||
* are missing, the function returns false and doesn't start the login
|
|
||||||
* process
|
|
||||||
*
|
|
||||||
* @param LocalUserNum the controller number of the associated user
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|AdvancedIdentity")
|
|
||||||
static UAutoLoginUserCallbackProxy* AutoLoginUser(UObject* WorldContextObject, int32 LocalUserNum);
|
|
||||||
|
|
||||||
// UOnlineBlueprintCallProxyBase interface
|
|
||||||
virtual void Activate() override;
|
|
||||||
// End of UOnlineBlueprintCallProxyBase interface
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Internal callback when the operation completes, calls out to the public success/failure callbacks
|
|
||||||
void OnCompleted(int32 LocalUserNum, bool bWasSuccessful, const FUniqueNetId& UserId, const FString& ErrorVal);
|
|
||||||
|
|
||||||
private:
|
|
||||||
// The controller number of the associated user
|
|
||||||
int32 LocalUserNumber;
|
|
||||||
|
|
||||||
// The delegate executed by the online subsystem
|
|
||||||
FOnLoginCompleteDelegate Delegate;
|
|
||||||
|
|
||||||
// Handle to the registered OnDestroySessionComplete delegate
|
|
||||||
FDelegateHandle DelegateHandle;
|
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
|
||||||
};
|
|
||||||
@@ -200,17 +200,6 @@ public:
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adding in a compare operator so that std functions will work with this struct
|
|
||||||
FORCEINLINE bool operator==(const FBPUniqueNetId& Other) const
|
|
||||||
{
|
|
||||||
return (IsValid() && Other.IsValid() && (*GetUniqueNetId() == *Other.GetUniqueNetId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
FORCEINLINE bool operator!=(const FBPUniqueNetId& Other) const
|
|
||||||
{
|
|
||||||
return !(IsValid() && Other.IsValid() && (*GetUniqueNetId() == *Other.GetUniqueNetId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
FBPUniqueNetId()
|
FBPUniqueNetId()
|
||||||
{
|
{
|
||||||
bUseDirectPointer = false;
|
bUseDirectPointer = false;
|
||||||
@@ -251,31 +240,23 @@ struct FBPFriendPresenceInfo
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
bool bIsOnline = false;
|
bool bIsOnline;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
bool bIsPlaying = false;
|
bool bIsPlaying;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
bool bIsPlayingThisGame = false;
|
bool bIsPlayingThisGame;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
bool bIsJoinable = false;
|
bool bIsJoinable;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
bool bHasVoiceSupport = false;
|
bool bHasVoiceSupport;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
EBPOnlinePresenceState PresenceState = EBPOnlinePresenceState::Offline;
|
EBPOnlinePresenceState PresenceState;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
FString StatusString;
|
FString StatusString;
|
||||||
|
|
||||||
FBPFriendPresenceInfo()
|
|
||||||
{
|
|
||||||
bIsOnline = false;
|
|
||||||
bIsPlaying = false;
|
|
||||||
bIsPlayingThisGame = false;
|
|
||||||
bIsJoinable = false;
|
|
||||||
bHasVoiceSupport = false;
|
|
||||||
PresenceState = EBPOnlinePresenceState::Offline;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
USTRUCT(BlueprintType)
|
USTRUCT(BlueprintType)
|
||||||
struct FBPFriendInfo
|
struct FBPFriendInfo
|
||||||
{
|
{
|
||||||
@@ -288,22 +269,15 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
FString RealName;
|
FString RealName;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
EBPOnlinePresenceState OnlineState = EBPOnlinePresenceState::Offline;
|
EBPOnlinePresenceState OnlineState;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
FBPUniqueNetId UniqueNetId;
|
FBPUniqueNetId UniqueNetId;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
bool bIsPlayingSameGame = false;
|
bool bIsPlayingSameGame;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
|
||||||
FBPFriendPresenceInfo PresenceInfo;
|
FBPFriendPresenceInfo PresenceInfo;
|
||||||
|
|
||||||
FBPFriendInfo()
|
|
||||||
{
|
|
||||||
OnlineState = EBPOnlinePresenceState::Offline;
|
|
||||||
bIsPlayingSameGame = false;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** The types of comparison operations for a given search query */
|
/** The types of comparison operations for a given search query */
|
||||||
// Used to compare session properties
|
// Used to compare session properties
|
||||||
UENUM(BlueprintType)
|
UENUM(BlueprintType)
|
||||||
@@ -366,7 +340,7 @@ public:
|
|||||||
//return const_cast<FUniqueNetId*>(UniqueNetIdPtr);
|
//return const_cast<FUniqueNetId*>(UniqueNetIdPtr);
|
||||||
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
|
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
|
||||||
{
|
{
|
||||||
UserID = PlayerState->GetUniqueId().GetUniqueNetId();
|
UserID = PlayerState->UniqueId.GetUniqueNetId();
|
||||||
if (!UserID.IsValid())
|
if (!UserID.IsValid())
|
||||||
{
|
{
|
||||||
FFrame::KismetExecutionMessage(*FString::Printf(TEXT("%s - Cannot map local player to unique net ID"), FunctionContext), ELogVerbosity::Warning);
|
FFrame::KismetExecutionMessage(*FString::Printf(TEXT("%s - Cannot map local player to unique net ID"), FunctionContext), ELogVerbosity::Warning);
|
||||||
|
|||||||
@@ -42,5 +42,5 @@ private:
|
|||||||
FDelegateHandle DelegateHandle;
|
FDelegateHandle DelegateHandle;
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,24 +23,21 @@ class UCreateSessionCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase
|
|||||||
* Creates a session with the default online subsystem with advanced optional inputs, for dedicated servers leave UsePresence as false and set IsDedicatedServer to true. Dedicated servers don't use presence.
|
* Creates a session with the default online subsystem with advanced optional inputs, for dedicated servers leave UsePresence as false and set IsDedicatedServer to true. Dedicated servers don't use presence.
|
||||||
* @param PublicConnections When doing a 'listen' server, this must be >=2 (ListenServer itself counts as a connection)
|
* @param PublicConnections When doing a 'listen' server, this must be >=2 (ListenServer itself counts as a connection)
|
||||||
* @param bUseLAN When you want to play LAN, the level to play on must be loaded with option 'bIsLanMatch'
|
* @param bUseLAN When you want to play LAN, the level to play on must be loaded with option 'bIsLanMatch'
|
||||||
* @param bUseLobbiesIfAvailable Used to flag the subsystem to use a lobby api instead of general hosting if the API supports it, generally true on steam for listen servers and false for dedicated
|
* @param bUsePresence Must be true for a 'listen' server (Map must be loaded with option 'listen'), false for a 'dedicated' server.
|
||||||
* Must be true for a 'listen' server (Map must be loaded with option 'listen'), false for a 'dedicated' server.
|
|
||||||
* @param bShouldAdvertise Set to true when the OnlineSubsystem should list your server when someone is searching for servers. Otherwise the server is hidden and only join via invite is possible.
|
* @param bShouldAdvertise Set to true when the OnlineSubsystem should list your server when someone is searching for servers. Otherwise the server is hidden and only join via invite is possible.
|
||||||
* @param bUseLobbiesVoiceChatIfAvailable Set to true to setup voice chat lobbies if the API supports it
|
|
||||||
* @param bStartAfterCreate Set to true to start the session after it's created. If false you need to manually call StartSession when ready.
|
|
||||||
*/
|
*/
|
||||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject",AutoCreateRefTerm="ExtraSettings"), Category = "Online|AdvancedSessions")
|
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject",AutoCreateRefTerm="ExtraSettings"), Category = "Online|AdvancedSessions")
|
||||||
static UCreateSessionCallbackProxyAdvanced* CreateAdvancedSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair>& ExtraSettings, class APlayerController* PlayerController = NULL, int32 PublicConnections = 100, int32 PrivateConnections = 0, bool bUseLAN = false, bool bAllowInvites = true, bool bIsDedicatedServer = false, /*bool bUsePresence = true,*/ bool bUseLobbiesIfAvailable = true, bool bAllowJoinViaPresence = true, bool bAllowJoinViaPresenceFriendsOnly = false, bool bAntiCheatProtected = false, bool bUsesStats = false, bool bShouldAdvertise = true, bool bUseLobbiesVoiceChatIfAvailable = false, bool bStartAfterCreate = true);
|
static UCreateSessionCallbackProxyAdvanced* CreateAdvancedSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair> &ExtraSettings, class APlayerController* PlayerController = NULL, int32 PublicConnections = 100, int32 PrivateConnections = 0, bool bUseLAN = false, bool bAllowInvites = true, bool bIsDedicatedServer = false, bool bUsePresence = true, bool bAllowJoinViaPresence = true, bool bAllowJoinViaPresenceFriendsOnly = false, bool bAntiCheatProtected = false, bool bUsesStats = false, bool bShouldAdvertise = true);
|
||||||
|
|
||||||
// UOnlineBlueprintCallProxyBase interface
|
// UOnlineBlueprintCallProxyBase interface
|
||||||
virtual void Activate() override;
|
virtual void Activate() override;
|
||||||
// End of UOnlineBlueprintCallProxyBase interface
|
// End of UOnlineBlueprintCallProxyBase interface
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Internal callback when session creation completes, optionally calls StartSession
|
// Internal callback when session creation completes, calls StartSession
|
||||||
void OnCreateCompleted(FName SessionName, bool bWasSuccessful);
|
void OnCreateCompleted(FName SessionName, bool bWasSuccessful);
|
||||||
|
|
||||||
// Internal callback when session start completes
|
// Internal callback when session creation completes, calls StartSession
|
||||||
void OnStartCompleted(FName SessionName, bool bWasSuccessful);
|
void OnStartCompleted(FName SessionName, bool bWasSuccessful);
|
||||||
|
|
||||||
// The player controller triggering things
|
// The player controller triggering things
|
||||||
@@ -74,9 +71,6 @@ private:
|
|||||||
// Whether to use the presence option
|
// Whether to use the presence option
|
||||||
bool bUsePresence;
|
bool bUsePresence;
|
||||||
|
|
||||||
// Whether to prefer the use of lobbies for hosting if the api supports them
|
|
||||||
bool bUseLobbiesIfAvailable;
|
|
||||||
|
|
||||||
// Whether to allow joining via presence
|
// Whether to allow joining via presence
|
||||||
bool bAllowJoinViaPresence;
|
bool bAllowJoinViaPresence;
|
||||||
|
|
||||||
@@ -92,16 +86,10 @@ private:
|
|||||||
// Should advertise server?
|
// Should advertise server?
|
||||||
bool bShouldAdvertise;
|
bool bShouldAdvertise;
|
||||||
|
|
||||||
// Whether to prefer the use of voice chat lobbies if the api supports them
|
|
||||||
bool bUseLobbiesVoiceChatIfAvailable;
|
|
||||||
|
|
||||||
// Whether to start the session automatically after it is created
|
|
||||||
bool bStartAfterCreate;
|
|
||||||
|
|
||||||
// Store extra settings
|
// Store extra settings
|
||||||
TArray<FSessionPropertyKeyPair> ExtraSettings;
|
TArray<FSessionPropertyKeyPair> ExtraSettings;
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,8 @@ class UEndSessionCallbackProxy : public UOnlineBlueprintCallProxyBase
|
|||||||
UPROPERTY(BlueprintAssignable)
|
UPROPERTY(BlueprintAssignable)
|
||||||
FEmptyOnlineDelegate OnFailure;
|
FEmptyOnlineDelegate OnFailure;
|
||||||
|
|
||||||
/**
|
// Ends the current session
|
||||||
* Ends the current sessions, Generally for almost all uses you should be using the engines native Destroy Session node instead.
|
UFUNCTION(BlueprintCallable, meta=(DeprecatedFunction,DeprecationMessage = "This function is deprecated, I realized that people have been using it wrong and it doesn't have much use in blueprints. Use Destroy Session only instead.",BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|AdvancedSessions|Deprecated")
|
||||||
* This exists for people using StartSession and optionally hand managing the session state.
|
|
||||||
*/
|
|
||||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|AdvancedSessions")
|
|
||||||
static UEndSessionCallbackProxy* EndSession(UObject* WorldContextObject, class APlayerController* PlayerController);
|
static UEndSessionCallbackProxy* EndSession(UObject* WorldContextObject, class APlayerController* PlayerController);
|
||||||
|
|
||||||
// UOnlineBlueprintCallProxyBase interface
|
// UOnlineBlueprintCallProxyBase interface
|
||||||
@@ -45,5 +42,5 @@ private:
|
|||||||
FDelegateHandle DelegateHandle;
|
FDelegateHandle DelegateHandle;
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -46,6 +46,6 @@ private:
|
|||||||
FDelegateHandle FindFriendSessionCompleteDelegateHandle;
|
FDelegateHandle FindFriendSessionCompleteDelegateHandle;
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,6 @@
|
|||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "FindSessionsCallbackProxyAdvanced.generated.h"
|
#include "FindSessionsCallbackProxyAdvanced.generated.h"
|
||||||
|
|
||||||
|
|
||||||
FORCEINLINE bool operator==(const FBlueprintSessionResult& A, const FBlueprintSessionResult& B)
|
|
||||||
{
|
|
||||||
return (A.OnlineResult.IsValid() == B.OnlineResult.IsValid() && (A.OnlineResult.GetSessionIdStr() == B.OnlineResult.GetSessionIdStr()));
|
|
||||||
}
|
|
||||||
|
|
||||||
UCLASS(MinimalAPI)
|
UCLASS(MinimalAPI)
|
||||||
class UFindSessionsCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase
|
class UFindSessionsCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase
|
||||||
{
|
{
|
||||||
@@ -28,7 +22,7 @@ class UFindSessionsCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase
|
|||||||
|
|
||||||
// Searches for advertised sessions with the default online subsystem and includes an array of filters
|
// Searches for advertised sessions with the default online subsystem and includes an array of filters
|
||||||
UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject", AutoCreateRefTerm="Filters"), Category = "Online|AdvancedSessions")
|
UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject", AutoCreateRefTerm="Filters"), Category = "Online|AdvancedSessions")
|
||||||
static UFindSessionsCallbackProxyAdvanced* FindSessionsAdvanced(UObject* WorldContextObject, class APlayerController* PlayerController, int32 MaxResults, bool bUseLAN, EBPServerPresenceSearchType ServerTypeToSearch, const TArray<FSessionsSearchSetting> &Filters, bool bEmptyServersOnly = false, bool bNonEmptyServersOnly = false, bool bSecureServersOnly = false, /*bool bSearchLobbies = true,*/ int MinSlotsAvailable = 0);
|
static UFindSessionsCallbackProxyAdvanced* FindSessionsAdvanced(UObject* WorldContextObject, class APlayerController* PlayerController, int32 MaxResults, bool bUseLAN, EBPServerPresenceSearchType ServerTypeToSearch, const TArray<FSessionsSearchSetting> &Filters, bool bEmptyServersOnly = false, bool bNonEmptyServersOnly = false, bool bSecureServersOnly = false, int MinSlotsAvailable = 0);
|
||||||
|
|
||||||
static bool CompareVariants(const FVariantData &A, const FVariantData &B, EOnlineComparisonOpRedux Comparator);
|
static bool CompareVariants(const FVariantData &A, const FVariantData &B, EOnlineComparisonOpRedux Comparator);
|
||||||
|
|
||||||
@@ -98,12 +92,9 @@ private:
|
|||||||
// Search for secure servers only
|
// Search for secure servers only
|
||||||
bool bSecureServersOnly;
|
bool bSecureServersOnly;
|
||||||
|
|
||||||
// Search through lobbies
|
|
||||||
//bool bSearchLobbies;
|
|
||||||
|
|
||||||
// Min slots requires to search
|
// Min slots requires to search
|
||||||
int MinSlotsAvailable;
|
int MinSlotsAvailable;
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,6 +44,6 @@ private:
|
|||||||
//EBPFriendsLists FriendListToGet;
|
//EBPFriendsLists FriendListToGet;
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,6 @@ private:
|
|||||||
FOnQueryRecentPlayersCompleteDelegate QueryRecentPlayersCompleteDelegate;
|
FOnQueryRecentPlayersCompleteDelegate QueryRecentPlayersCompleteDelegate;
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -41,5 +41,5 @@ private:
|
|||||||
EBPUserPrivileges UserPrivilege;
|
EBPUserPrivileges UserPrivilege;
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ class ULoginUserCallbackProxy : public UOnlineBlueprintCallProxyBase
|
|||||||
FEmptyOnlineDelegate OnFailure;
|
FEmptyOnlineDelegate OnFailure;
|
||||||
|
|
||||||
// Logs into the identity interface
|
// Logs into the identity interface
|
||||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject", AdvancedDisplay = "AuthType"), Category = "Online|AdvancedIdentity")
|
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|AdvancedIdentity")
|
||||||
static ULoginUserCallbackProxy* LoginUser(UObject* WorldContextObject, class APlayerController* PlayerController, FString UserID, FString UserToken, FString AuthType);
|
static ULoginUserCallbackProxy* LoginUser(UObject* WorldContextObject, class APlayerController* PlayerController, FString UserID, FString UserToken);
|
||||||
|
|
||||||
// UOnlineBlueprintCallProxyBase interface
|
// UOnlineBlueprintCallProxyBase interface
|
||||||
virtual void Activate() override;
|
virtual void Activate() override;
|
||||||
@@ -42,8 +42,6 @@ private:
|
|||||||
// The user pass / token
|
// The user pass / token
|
||||||
FString UserToken;
|
FString UserToken;
|
||||||
|
|
||||||
FString AuthType;
|
|
||||||
|
|
||||||
// The delegate executed by the online subsystem
|
// The delegate executed by the online subsystem
|
||||||
FOnLoginCompleteDelegate Delegate;
|
FOnLoginCompleteDelegate Delegate;
|
||||||
|
|
||||||
@@ -51,5 +49,5 @@ private:
|
|||||||
FDelegateHandle DelegateHandle;
|
FDelegateHandle DelegateHandle;
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -43,5 +43,5 @@ private:
|
|||||||
FDelegateHandle DelegateHandle;
|
FDelegateHandle DelegateHandle;
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,6 +44,6 @@ private:
|
|||||||
FOnSendInviteComplete OnSendInviteCompleteDelegate;
|
FOnSendInviteComplete OnSendInviteCompleteDelegate;
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
|
||||||
#include "StartSessionCallbackProxyAdvanced.generated.h"
|
|
||||||
|
|
||||||
UCLASS(MinimalAPI)
|
|
||||||
class UStartSessionCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase
|
|
||||||
{
|
|
||||||
GENERATED_UCLASS_BODY()
|
|
||||||
// Called when the session starts successfully
|
|
||||||
UPROPERTY(BlueprintAssignable)
|
|
||||||
FEmptyOnlineDelegate OnSuccess;
|
|
||||||
|
|
||||||
// Called when there is an error starting the session
|
|
||||||
UPROPERTY(BlueprintAssignable)
|
|
||||||
FEmptyOnlineDelegate OnFailure;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Starts a session with the default online subsystem. The session needs to be previously created by calling the "CreateAdvancedSession" node.
|
|
||||||
* @param WorldContextObject
|
|
||||||
*/
|
|
||||||
UFUNCTION(
|
|
||||||
BlueprintCallable
|
|
||||||
, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject")
|
|
||||||
, Category = "Online|AdvancedSessions"
|
|
||||||
)
|
|
||||||
static UStartSessionCallbackProxyAdvanced* StartAdvancedSession(UObject* WorldContextObject);
|
|
||||||
|
|
||||||
// UOnlineBlueprintCallProxyBase interface
|
|
||||||
virtual void Activate() override;
|
|
||||||
// End of UOnlineBlueprintCallProxyBase interface
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Internal callback when session start completes
|
|
||||||
void OnStartCompleted(FName SessionName, bool bWasSuccessful);
|
|
||||||
|
|
||||||
// The delegate executed by the online subsystem
|
|
||||||
FOnStartSessionCompleteDelegate StartCompleteDelegate;
|
|
||||||
|
|
||||||
// Handles to the registered delegates above
|
|
||||||
FDelegateHandle StartCompleteDelegateHandle;
|
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
|
||||||
};
|
|
||||||
@@ -21,7 +21,7 @@ class UUpdateSessionCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase
|
|||||||
|
|
||||||
// Creates a session with the default online subsystem with advanced optional inputs, you MUST fill in all categories or it will pass in values that you didn't want as default values
|
// Creates a session with the default online subsystem with advanced optional inputs, you MUST fill in all categories or it will pass in values that you didn't want as default values
|
||||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject",AutoCreateRefTerm="ExtraSettings"), Category = "Online|AdvancedSessions")
|
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject",AutoCreateRefTerm="ExtraSettings"), Category = "Online|AdvancedSessions")
|
||||||
static UUpdateSessionCallbackProxyAdvanced* UpdateSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair> &ExtraSettings, int32 PublicConnections = 100, int32 PrivateConnections = 0, bool bUseLAN = false, bool bAllowInvites = false, bool bAllowJoinInProgress = false, bool bRefreshOnlineData = true, bool bIsDedicatedServer = false, bool bShouldAdvertise = true, bool bAllowJoinViaPresence = true, bool bAllowJoinViaPresenceFriendsOnly = false);
|
static UUpdateSessionCallbackProxyAdvanced* UpdateSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair> &ExtraSettings, int32 PublicConnections = 100, int32 PrivateConnections = 0, bool bUseLAN = false, bool bAllowInvites = false, bool bAllowJoinInProgress = false, bool bRefreshOnlineData = true, bool bIsDedicatedServer = false);
|
||||||
|
|
||||||
// UOnlineBlueprintCallProxyBase interface
|
// UOnlineBlueprintCallProxyBase interface
|
||||||
virtual void Activate() override;
|
virtual void Activate() override;
|
||||||
@@ -38,38 +38,30 @@ private:
|
|||||||
FDelegateHandle OnUpdateSessionCompleteDelegateHandle;
|
FDelegateHandle OnUpdateSessionCompleteDelegateHandle;
|
||||||
|
|
||||||
// Number of public connections
|
// Number of public connections
|
||||||
int NumPublicConnections = 100;
|
int NumPublicConnections;
|
||||||
|
|
||||||
// Number of private connections
|
// Number of private connections
|
||||||
int NumPrivateConnections = 0;
|
int NumPrivateConnections;
|
||||||
|
|
||||||
// Whether or not to search LAN
|
// Whether or not to search LAN
|
||||||
bool bUseLAN = false;
|
bool bUseLAN;
|
||||||
|
|
||||||
// Whether or not to allow invites
|
// Whether or not to allow invites
|
||||||
bool bAllowInvites = true;
|
bool bAllowInvites;
|
||||||
|
|
||||||
// Store extra settings
|
// Store extra settings
|
||||||
TArray<FSessionPropertyKeyPair> ExtraSettings;
|
TArray<FSessionPropertyKeyPair> ExtraSettings;
|
||||||
|
|
||||||
// Whether to update the online data
|
// Whether to update the online data
|
||||||
bool bRefreshOnlineData = true;
|
bool bRefreshOnlineData;
|
||||||
|
|
||||||
// Allow joining in progress
|
// Allow joining in progress
|
||||||
bool bAllowJoinInProgress = true;
|
bool bAllowJoinInProgress;
|
||||||
|
|
||||||
// Allow joining in progress
|
|
||||||
bool bAllowJoinViaPresence = true;
|
|
||||||
|
|
||||||
// Allow joining in progress
|
|
||||||
bool bAllowJoinViaPresenceFriendsOnly = false;
|
|
||||||
|
|
||||||
// Update whether this is a dedicated server or not
|
// Update whether this is a dedicated server or not
|
||||||
bool bDedicatedServer = false;
|
bool bDedicatedServer;
|
||||||
|
|
||||||
bool bShouldAdvertise = true;
|
|
||||||
|
|
||||||
// The world context object in which this call is taking place
|
// The world context object in which this call is taking place
|
||||||
TWeakObjectPtr<UObject> WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,17 +6,9 @@
|
|||||||
//General Log
|
//General Log
|
||||||
DEFINE_LOG_CATEGORY(AdvancedExternalUILog);
|
DEFINE_LOG_CATEGORY(AdvancedExternalUILog);
|
||||||
|
|
||||||
void UAdvancedExternalUILibrary::ShowAccountUpgradeUI(UObject* WorldContextObject, const FBPUniqueNetId PlayerRequestingAccountUpgradeUI, EBlueprintResultSwitch &Result)
|
void UAdvancedExternalUILibrary::ShowAccountUpgradeUI(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())
|
if (!ExternalUIInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -29,17 +21,10 @@ void UAdvancedExternalUILibrary::ShowAccountUpgradeUI(UObject* WorldContextObjec
|
|||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedExternalUILibrary::ShowProfileUI(UObject* WorldContextObject, const FBPUniqueNetId PlayerViewingProfile, const FBPUniqueNetId PlayerToViewProfileOf, EBlueprintResultSwitch &Result)
|
void UAdvancedExternalUILibrary::ShowProfileUI(const FBPUniqueNetId PlayerViewingProfile, const FBPUniqueNetId PlayerToViewProfileOf, EBlueprintResultSwitch &Result)
|
||||||
{
|
{
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
Result = EBlueprintResultSwitch::OnFailure;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World);
|
|
||||||
|
|
||||||
if (!ExternalUIInterface.IsValid())
|
if (!ExternalUIInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -54,16 +39,9 @@ void UAdvancedExternalUILibrary::ShowProfileUI(UObject* WorldContextObject, cons
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void UAdvancedExternalUILibrary::ShowWebURLUI(UObject* WorldContextObject, FString URLToShow, EBlueprintResultSwitch &Result, TArray<FString>& AllowedDomains, bool bEmbedded, bool bShowBackground, bool bShowCloseButton, int32 OffsetX, int32 OffsetY, int32 SizeX, int32 SizeY)
|
void UAdvancedExternalUILibrary::ShowWebURLUI(FString URLToShow, EBlueprintResultSwitch &Result, TArray<FString>& AllowedDomains, bool bEmbedded, bool bShowBackground, bool bShowCloseButton, int32 OffsetX, int32 OffsetY, int32 SizeX, int32 SizeY)
|
||||||
{
|
{
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
Result = EBlueprintResultSwitch::OnFailure;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World);
|
|
||||||
|
|
||||||
if (!ExternalUIInterface.IsValid())
|
if (!ExternalUIInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -89,15 +67,9 @@ void UAdvancedExternalUILibrary::ShowWebURLUI(UObject* WorldContextObject, FStri
|
|||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedExternalUILibrary::CloseWebURLUI(UObject* WorldContextObject)
|
void UAdvancedExternalUILibrary::CloseWebURLUI()
|
||||||
{
|
{
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World);
|
|
||||||
|
|
||||||
if (!ExternalUIInterface.IsValid())
|
if (!ExternalUIInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -108,16 +80,9 @@ void UAdvancedExternalUILibrary::CloseWebURLUI(UObject* WorldContextObject)
|
|||||||
ExternalUIInterface->CloseWebURL();
|
ExternalUIInterface->CloseWebURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedExternalUILibrary::ShowLeaderBoardUI(UObject* WorldContextObject, FString LeaderboardName, EBlueprintResultSwitch &Result)
|
void UAdvancedExternalUILibrary::ShowLeaderBoardUI(FString LeaderboardName, EBlueprintResultSwitch &Result)
|
||||||
{
|
{
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
Result = EBlueprintResultSwitch::OnFailure;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World);
|
|
||||||
|
|
||||||
if (!ExternalUIInterface.IsValid())
|
if (!ExternalUIInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -132,7 +97,7 @@ void UAdvancedExternalUILibrary::ShowLeaderBoardUI(UObject* WorldContextObject,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UAdvancedExternalUILibrary::ShowInviteUI(UObject* WorldContextObject, APlayerController *PlayerController, EBlueprintResultSwitch &Result)
|
void UAdvancedExternalUILibrary::ShowInviteUI(APlayerController *PlayerController, EBlueprintResultSwitch &Result)
|
||||||
{
|
{
|
||||||
if (!PlayerController)
|
if (!PlayerController)
|
||||||
{
|
{
|
||||||
@@ -141,14 +106,7 @@ void UAdvancedExternalUILibrary::ShowInviteUI(UObject* WorldContextObject, APlay
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
Result = EBlueprintResultSwitch::OnFailure;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World);
|
|
||||||
|
|
||||||
if (!ExternalUIInterface.IsValid())
|
if (!ExternalUIInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -170,7 +128,7 @@ void UAdvancedExternalUILibrary::ShowInviteUI(UObject* WorldContextObject, APlay
|
|||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedExternalUILibrary::ShowFriendsUI(UObject* WorldContextObject, APlayerController *PlayerController, EBlueprintResultSwitch &Result)
|
void UAdvancedExternalUILibrary::ShowFriendsUI(APlayerController *PlayerController, EBlueprintResultSwitch &Result)
|
||||||
{
|
{
|
||||||
if (!PlayerController)
|
if (!PlayerController)
|
||||||
{
|
{
|
||||||
@@ -179,14 +137,7 @@ void UAdvancedExternalUILibrary::ShowFriendsUI(UObject* WorldContextObject, APla
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
Result = EBlueprintResultSwitch::OnFailure;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineExternalUIPtr ExternalUIInterface = Online::GetExternalUIInterface(World);
|
|
||||||
|
|
||||||
if (!ExternalUIInterface.IsValid())
|
if (!ExternalUIInterface.IsValid())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,55 +20,6 @@ UAdvancedFriendsGameInstance::UAdvancedFriendsGameInstance(const FObjectInitiali
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedFriendsGameInstance::OnSessionUserInviteAccepted(const bool bWasSuccessful, const int32 ControllerId, FUniqueNetIdPtr UserId, const FOnlineSessionSearchResult& InviteResult)
|
|
||||||
{
|
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());
|
|
||||||
if (SessionInterface.IsValid())
|
|
||||||
{
|
|
||||||
SessionInterface->ClearOnJoinSessionCompleteDelegate_Handle(OnJoinSessionCompleteDelegateHandle);
|
|
||||||
OnJoinSessionCompleteDelegateHandle = SessionInterface->AddOnJoinSessionCompleteDelegate_Handle(
|
|
||||||
FOnJoinSessionCompleteDelegate::CreateUObject(this, &UAdvancedFriendsGameInstance::OnJoinSessionComplete));
|
|
||||||
|
|
||||||
// Temp for 5.5, they aren't filling in the struct correctly
|
|
||||||
if (!InviteResult.Session.SessionSettings.bIsDedicated)
|
|
||||||
{
|
|
||||||
FOnlineSessionSearchResult ModResult = InviteResult;
|
|
||||||
ModResult.Session.SessionSettings.bUsesPresence = true;
|
|
||||||
ModResult.Session.SessionSettings.bUseLobbiesIfAvailable = true;
|
|
||||||
SessionInterface->JoinSession(0, NAME_GameSession, ModResult);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SessionInterface->JoinSession(0, NAME_GameSession, InviteResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
UE_LOG(AdvancedFriendsInterfaceLog, Log, TEXT("Called Join Session for Steam Friends List UI InviteResults: %s, UserId: %s"), *InviteResult.GetSessionIdStr(), *UserId->ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
void UAdvancedFriendsGameInstance::OnJoinSessionComplete(FName SessionName, EOnJoinSessionCompleteResult::Type Result)
|
|
||||||
{
|
|
||||||
|
|
||||||
// If we don't want to auto travel to the session instance then exit out
|
|
||||||
if (!bAutoTravelOnAcceptedUserInviteReceived)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());
|
|
||||||
if (SessionInterface.IsValid())
|
|
||||||
{
|
|
||||||
FString ConnectInfo;
|
|
||||||
if (SessionInterface->GetResolvedConnectString(NAME_GameSession, ConnectInfo))
|
|
||||||
{
|
|
||||||
APlayerController* PlayerController = GetFirstLocalPlayerController();
|
|
||||||
if (PlayerController)
|
|
||||||
{
|
|
||||||
PlayerController->ClientTravel(ConnectInfo, ETravelType::TRAVEL_Absolute);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UAdvancedFriendsGameInstance::Shutdown()
|
void UAdvancedFriendsGameInstance::Shutdown()
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());
|
||||||
@@ -83,7 +34,6 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
|||||||
// Clear all of the delegate handles here
|
// Clear all of the delegate handles here
|
||||||
SessionInterface->ClearOnSessionUserInviteAcceptedDelegate_Handle(SessionInviteAcceptedDelegateHandle);
|
SessionInterface->ClearOnSessionUserInviteAcceptedDelegate_Handle(SessionInviteAcceptedDelegateHandle);
|
||||||
SessionInterface->ClearOnSessionInviteReceivedDelegate_Handle(SessionInviteReceivedDelegateHandle);
|
SessionInterface->ClearOnSessionInviteReceivedDelegate_Handle(SessionInviteReceivedDelegateHandle);
|
||||||
SessionInterface->ClearOnJoinSessionCompleteDelegate_Handle(OnJoinSessionCompleteDelegateHandle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -130,9 +80,6 @@ void UAdvancedFriendsGameInstance::Init()
|
|||||||
SessionInviteAcceptedDelegateHandle = SessionInterface->AddOnSessionUserInviteAcceptedDelegate_Handle(SessionInviteAcceptedDelegate);
|
SessionInviteAcceptedDelegateHandle = SessionInterface->AddOnSessionUserInviteAcceptedDelegate_Handle(SessionInviteAcceptedDelegate);
|
||||||
|
|
||||||
SessionInviteReceivedDelegateHandle = SessionInterface->AddOnSessionInviteReceivedDelegate_Handle(SessionInviteReceivedDelegate);
|
SessionInviteReceivedDelegateHandle = SessionInterface->AddOnSessionInviteReceivedDelegate_Handle(SessionInviteReceivedDelegate);
|
||||||
|
|
||||||
// Custom steam join game delegate
|
|
||||||
SessionInterface->OnSessionUserInviteAcceptedDelegates.AddUObject(this, &UAdvancedFriendsGameInstance::OnSessionUserInviteAccepted);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -316,7 +263,7 @@ void UAdvancedFriendsGameInstance::OnSessionInviteReceivedMaster(const FUniqueNe
|
|||||||
int32 LocalPlayer = 0;
|
int32 LocalPlayer = 0;
|
||||||
for (int i = 0; i < PlayerList.Num(); i++)
|
for (int i = 0; i < PlayerList.Num(); i++)
|
||||||
{
|
{
|
||||||
if (*PlayerList[i]->PlayerState->GetUniqueId().GetUniqueNetId() == PersonInvited)
|
if (*PlayerList[i]->PlayerState->UniqueId.GetUniqueNetId() == PersonInvited)
|
||||||
{
|
{
|
||||||
LocalPlayer = i;
|
LocalPlayer = i;
|
||||||
Player = PlayerList[i];
|
Player = PlayerList[i];
|
||||||
@@ -324,13 +271,6 @@ void UAdvancedFriendsGameInstance::OnSessionInviteReceivedMaster(const FUniqueNe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temp for 5.5, they aren't filling in the struct correctly
|
|
||||||
if (!BluePrintResult.OnlineResult.Session.SessionSettings.bIsDedicated)
|
|
||||||
{
|
|
||||||
BluePrintResult.OnlineResult.Session.SessionSettings.bUsesPresence = true;
|
|
||||||
BluePrintResult.OnlineResult.Session.SessionSettings.bUseLobbiesIfAvailable = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
OnSessionInviteReceived(LocalPlayer, PInviting, AppId, BluePrintResult);
|
OnSessionInviteReceived(LocalPlayer, PInviting, AppId, BluePrintResult);
|
||||||
|
|
||||||
//IAdvancedFriendsInterface* TheInterface = NULL;
|
//IAdvancedFriendsInterface* TheInterface = NULL;
|
||||||
@@ -367,13 +307,6 @@ void UAdvancedFriendsGameInstance::OnSessionInviteAcceptedMaster(const bool bWas
|
|||||||
FBPUniqueNetId PInvited;
|
FBPUniqueNetId PInvited;
|
||||||
PInvited.SetUniqueNetId(PersonInvited);
|
PInvited.SetUniqueNetId(PersonInvited);
|
||||||
|
|
||||||
// Temp for 5.5, they aren't filling in the struct correctly
|
|
||||||
if (!BluePrintResult.OnlineResult.Session.SessionSettings.bIsDedicated)
|
|
||||||
{
|
|
||||||
BluePrintResult.OnlineResult.Session.SessionSettings.bUsesPresence = true;
|
|
||||||
BluePrintResult.OnlineResult.Session.SessionSettings.bUseLobbiesIfAvailable = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
OnSessionInviteAccepted(LocalPlayer,PInvited, BluePrintResult);
|
OnSessionInviteAccepted(LocalPlayer,PInvited, BluePrintResult);
|
||||||
|
|
||||||
APlayerController* Player = UGameplayStatics::GetPlayerController(GetWorld(), LocalPlayer);
|
APlayerController* Player = UGameplayStatics::GetPlayerController(GetWorld(), LocalPlayer);
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ void UAdvancedFriendsLibrary::GetFriend(APlayerController *PlayerController, con
|
|||||||
TSharedPtr<FOnlineFriend> fr = FriendsInterface->GetFriend(Player->GetControllerId(), *FriendUniqueNetId.GetUniqueNetId(), EFriendsLists::ToString(EFriendsLists::Default));
|
TSharedPtr<FOnlineFriend> fr = FriendsInterface->GetFriend(Player->GetControllerId(), *FriendUniqueNetId.GetUniqueNetId(), EFriendsLists::ToString(EFriendsLists::Default));
|
||||||
if (fr.IsValid())
|
if (fr.IsValid())
|
||||||
{
|
{
|
||||||
const FOnlineUserPresence& pres = fr->GetPresence();
|
FOnlineUserPresence pres = fr->GetPresence();
|
||||||
Friend.DisplayName = fr->GetDisplayName();
|
Friend.DisplayName = fr->GetDisplayName();
|
||||||
Friend.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
|
Friend.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
|
||||||
Friend.RealName = fr->GetRealName();
|
Friend.RealName = fr->GetRealName();
|
||||||
@@ -151,8 +151,7 @@ void UAdvancedFriendsLibrary::GetFriend(APlayerController *PlayerController, con
|
|||||||
Friend.PresenceInfo.bIsPlaying = pres.bIsPlaying;
|
Friend.PresenceInfo.bIsPlaying = pres.bIsPlaying;
|
||||||
Friend.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame;
|
Friend.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame;
|
||||||
Friend.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
|
Friend.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
|
Friend.PresenceInfo.StatusString = pres.Status.StatusStr;
|
||||||
//Friend.PresenceInfo.StatusString = pres.Status.StatusStr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,34 +247,28 @@ void UAdvancedFriendsLibrary::GetStoredFriendsList(APlayerController *PlayerCont
|
|||||||
|
|
||||||
|
|
||||||
TArray< TSharedRef<FOnlineFriend> > FriendList;
|
TArray< TSharedRef<FOnlineFriend> > FriendList;
|
||||||
if (FriendsInterface->GetFriendsList(Player->GetControllerId(), EFriendsLists::ToString((EFriendsLists::Default)), FriendList))
|
FriendsInterface->GetFriendsList(Player->GetControllerId(), EFriendsLists::ToString((EFriendsLists::Default)), FriendList);
|
||||||
{
|
|
||||||
for (int32 i = 0; i < FriendList.Num(); i++)
|
for (int32 i = 0; i < FriendList.Num(); i++)
|
||||||
{
|
{
|
||||||
|
TSharedRef<FOnlineFriend> Friend = FriendList[i];
|
||||||
FBPFriendInfo BPF;
|
FBPFriendInfo BPF;
|
||||||
const FOnlineUserPresence& pres = FriendList[i]->GetPresence();
|
FOnlineUserPresence pres = Friend->GetPresence();
|
||||||
|
|
||||||
BPF.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
|
BPF.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
|
||||||
BPF.DisplayName = FriendList[i]->GetDisplayName();
|
BPF.DisplayName = Friend->GetDisplayName();
|
||||||
BPF.RealName = FriendList[i]->GetRealName();
|
BPF.RealName = Friend->GetRealName();
|
||||||
BPF.UniqueNetId.SetUniqueNetId(FriendList[i]->GetUserId());
|
BPF.UniqueNetId.SetUniqueNetId(Friend->GetUserId());
|
||||||
BPF.bIsPlayingSameGame = pres.bIsPlayingThisGame;
|
BPF.bIsPlayingSameGame = pres.bIsPlayingThisGame;
|
||||||
|
|
||||||
BPF.PresenceInfo.bIsOnline = pres.bIsOnline;
|
BPF.PresenceInfo.bIsOnline = pres.bIsOnline;
|
||||||
BPF.PresenceInfo.bHasVoiceSupport = pres.bHasVoiceSupport;
|
BPF.PresenceInfo.bHasVoiceSupport = pres.bHasVoiceSupport;
|
||||||
BPF.PresenceInfo.bIsPlaying = pres.bIsPlaying;
|
BPF.PresenceInfo.bIsPlaying = pres.bIsPlaying;
|
||||||
BPF.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
|
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.StatusString = pres.Status.StatusStr;
|
|
||||||
BPF.PresenceInfo.bIsJoinable = pres.bIsJoinable;
|
BPF.PresenceInfo.bIsJoinable = pres.bIsJoinable;
|
||||||
BPF.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame;
|
BPF.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame;
|
||||||
|
|
||||||
FriendsList.Add(BPF);
|
FriendsList.Add(BPF);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UE_LOG(AdvancedFriendsLog, Warning, TEXT("GetFriendsList Failed to get any friends!"));
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
DEFINE_LOG_CATEGORY(AdvancedIdentityLog);
|
DEFINE_LOG_CATEGORY(AdvancedIdentityLog);
|
||||||
|
|
||||||
|
|
||||||
void UAdvancedIdentityLibrary::GetPlayerAuthToken(UObject* WorldContextObject, APlayerController * PlayerController, FString & AuthToken, EBlueprintResultSwitch &Result)
|
void UAdvancedIdentityLibrary::GetPlayerAuthToken(APlayerController * PlayerController, FString & AuthToken, EBlueprintResultSwitch &Result)
|
||||||
{
|
{
|
||||||
if (!PlayerController)
|
if (!PlayerController)
|
||||||
{
|
{
|
||||||
@@ -23,14 +23,7 @@ void UAdvancedIdentityLibrary::GetPlayerAuthToken(UObject* WorldContextObject, A
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
Result = EBlueprintResultSwitch::OnFailure;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(World);
|
|
||||||
|
|
||||||
if (!IdentityInterface.IsValid())
|
if (!IdentityInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -43,7 +36,7 @@ void UAdvancedIdentityLibrary::GetPlayerAuthToken(UObject* WorldContextObject, A
|
|||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedIdentityLibrary::GetPlayerNickname(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetID, FString & PlayerNickname)
|
void UAdvancedIdentityLibrary::GetPlayerNickname(const FBPUniqueNetId & UniqueNetID, FString & PlayerNickname)
|
||||||
{
|
{
|
||||||
if (!UniqueNetID.IsValid())
|
if (!UniqueNetID.IsValid())
|
||||||
{
|
{
|
||||||
@@ -51,13 +44,7 @@ void UAdvancedIdentityLibrary::GetPlayerNickname(UObject* WorldContextObject, co
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(World);
|
|
||||||
|
|
||||||
if (!IdentityInterface.IsValid())
|
if (!IdentityInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -68,7 +55,7 @@ void UAdvancedIdentityLibrary::GetPlayerNickname(UObject* WorldContextObject, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UAdvancedIdentityLibrary::GetLoginStatus(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetID, EBPLoginStatus & LoginStatus, EBlueprintResultSwitch &Result)
|
void UAdvancedIdentityLibrary::GetLoginStatus(const FBPUniqueNetId & UniqueNetID, EBPLoginStatus & LoginStatus, EBlueprintResultSwitch &Result)
|
||||||
{
|
{
|
||||||
if (!UniqueNetID.IsValid())
|
if (!UniqueNetID.IsValid())
|
||||||
{
|
{
|
||||||
@@ -77,14 +64,7 @@ void UAdvancedIdentityLibrary::GetLoginStatus(UObject* WorldContextObject, const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
Result = EBlueprintResultSwitch::OnFailure;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(World);
|
|
||||||
|
|
||||||
if (!IdentityInterface.IsValid())
|
if (!IdentityInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -98,17 +78,9 @@ void UAdvancedIdentityLibrary::GetLoginStatus(UObject* WorldContextObject, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UAdvancedIdentityLibrary::GetAllUserAccounts(UObject* WorldContextObject, TArray<FBPUserOnlineAccount> & AccountInfos, EBlueprintResultSwitch &Result)
|
void UAdvancedIdentityLibrary::GetAllUserAccounts(TArray<FBPUserOnlineAccount> & 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())
|
if (!IdentityInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -127,17 +99,9 @@ void UAdvancedIdentityLibrary::GetAllUserAccounts(UObject* WorldContextObject, T
|
|||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedIdentityLibrary::GetUserAccount(UObject* WorldContextObject, const FBPUniqueNetId & UniqueNetId, FBPUserOnlineAccount & AccountInfo, EBlueprintResultSwitch &Result)
|
void UAdvancedIdentityLibrary::GetUserAccount(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())
|
if(!UniqueNetId.IsValid())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ void UAdvancedSessionsLibrary::GetUniqueNetID(APlayerController *PlayerControlle
|
|||||||
|
|
||||||
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
|
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
|
||||||
{
|
{
|
||||||
UniqueNetId.SetUniqueNetId(PlayerState->GetUniqueId().GetUniqueNetId());
|
UniqueNetId.SetUniqueNetId(PlayerState->UniqueId.GetUniqueNetId());
|
||||||
if (!UniqueNetId.IsValid())
|
if (!UniqueNetId.IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetUniqueNetIdFromController couldn't get the player uniquenetid!"));
|
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetUniqueNetIdFromController couldn't get the player uniquenetid!"));
|
||||||
@@ -451,17 +451,6 @@ void UAdvancedSessionsLibrary::GetUniqueNetID(APlayerController *PlayerControlle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetUniqueNetIdOfSessionOwner(FBlueprintSessionResult SessionResult, FBPUniqueNetId& UniqueNetId)
|
|
||||||
{
|
|
||||||
FBPUniqueNetId ReturnID;
|
|
||||||
if (SessionResult.OnlineResult.IsValid())
|
|
||||||
{
|
|
||||||
ReturnID.SetUniqueNetId(SessionResult.OnlineResult.Session.OwningUserId);
|
|
||||||
}
|
|
||||||
|
|
||||||
UniqueNetId = ReturnID;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetUniqueNetIDFromPlayerState(APlayerState *PlayerState, FBPUniqueNetId &UniqueNetId)
|
void UAdvancedSessionsLibrary::GetUniqueNetIDFromPlayerState(APlayerState *PlayerState, FBPUniqueNetId &UniqueNetId)
|
||||||
{
|
{
|
||||||
if (!PlayerState)
|
if (!PlayerState)
|
||||||
@@ -470,7 +459,7 @@ void UAdvancedSessionsLibrary::GetUniqueNetIDFromPlayerState(APlayerState *Playe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UniqueNetId.SetUniqueNetId(PlayerState->GetUniqueId().GetUniqueNetId());
|
UniqueNetId.SetUniqueNetId(PlayerState->UniqueId.GetUniqueNetId());
|
||||||
if (!UniqueNetId.IsValid())
|
if (!UniqueNetId.IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetUniqueNetIdFromPlayerState couldn't get the player uniquenetid!"));
|
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetUniqueNetIdFromPlayerState couldn't get the player uniquenetid!"));
|
||||||
@@ -488,11 +477,6 @@ bool UAdvancedSessionsLibrary::EqualEqual_UNetIDUnetID(const FBPUniqueNetId &A,
|
|||||||
return ((A.IsValid() && B.IsValid()) && (*A.GetUniqueNetId() == *B.GetUniqueNetId()));
|
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)
|
void UAdvancedSessionsLibrary::SetPlayerName(APlayerController *PlayerController, FString PlayerName)
|
||||||
{
|
{
|
||||||
if (!PlayerController)
|
if (!PlayerController)
|
||||||
@@ -547,17 +531,11 @@ void UAdvancedSessionsLibrary::GetNumberOfNetworkPlayers(UObject* WorldContextOb
|
|||||||
|
|
||||||
bool UAdvancedSessionsLibrary::ServerTravel(UObject* WorldContextObject, const FString& FURL, bool bAbsolute, bool bShouldSkipGameNotify)
|
bool UAdvancedSessionsLibrary::ServerTravel(UObject* WorldContextObject, const FString& FURL, bool bAbsolute, bool bShouldSkipGameNotify)
|
||||||
{
|
{
|
||||||
if (!WorldContextObject)
|
if (!WorldContextObject) return false;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//using a context object to get the world
|
//using a context object to get the world
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::ReturnNull);
|
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::ReturnNull);
|
||||||
if (World)
|
if (!World) return false;
|
||||||
{
|
World->ServerTravel(FURL,bAbsolute,bShouldSkipGameNotify);
|
||||||
return World->ServerTravel(FURL, bAbsolute, bShouldSkipGameNotify);
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
@@ -5,16 +5,9 @@
|
|||||||
//General Log
|
//General Log
|
||||||
DEFINE_LOG_CATEGORY(AdvancedVoiceLog);
|
DEFINE_LOG_CATEGORY(AdvancedVoiceLog);
|
||||||
|
|
||||||
void UAdvancedVoiceLibrary::IsHeadsetPresent(UObject* WorldContextObject, bool & bHasHeadset, uint8 LocalPlayerNum)
|
void UAdvancedVoiceLibrary::IsHeadsetPresent(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())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -26,16 +19,9 @@ void UAdvancedVoiceLibrary::IsHeadsetPresent(UObject* WorldContextObject, bool &
|
|||||||
bHasHeadset = VoiceInterface->IsHeadsetPresent(LocalPlayerNum);
|
bHasHeadset = VoiceInterface->IsHeadsetPresent(LocalPlayerNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedVoiceLibrary::StartNetworkedVoice(UObject* WorldContextObject, uint8 LocalPlayerNum)
|
void UAdvancedVoiceLibrary::StartNetworkedVoice(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())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -46,16 +32,9 @@ void UAdvancedVoiceLibrary::StartNetworkedVoice(UObject* WorldContextObject, uin
|
|||||||
VoiceInterface->StartNetworkedVoice(LocalPlayerNum);
|
VoiceInterface->StartNetworkedVoice(LocalPlayerNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedVoiceLibrary::StopNetworkedVoice(UObject* WorldContextObject, uint8 LocalPlayerNum)
|
void UAdvancedVoiceLibrary::StopNetworkedVoice(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())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -66,15 +45,9 @@ void UAdvancedVoiceLibrary::StopNetworkedVoice(UObject* WorldContextObject, uint
|
|||||||
VoiceInterface->StopNetworkedVoice(LocalPlayerNum);
|
VoiceInterface->StopNetworkedVoice(LocalPlayerNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedVoiceLibrary::RegisterLocalTalker(UObject* WorldContextObject, uint8 LocalPlayerNum)
|
bool UAdvancedVoiceLibrary::RegisterLocalTalker(uint8 LocalPlayerNum)
|
||||||
{
|
{
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
|
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -85,16 +58,9 @@ bool UAdvancedVoiceLibrary::RegisterLocalTalker(UObject* WorldContextObject, uin
|
|||||||
return VoiceInterface->RegisterLocalTalker(LocalPlayerNum);
|
return VoiceInterface->RegisterLocalTalker(LocalPlayerNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedVoiceLibrary::RegisterAllLocalTalkers(UObject* WorldContextObject)
|
void UAdvancedVoiceLibrary::RegisterAllLocalTalkers()
|
||||||
{
|
{
|
||||||
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
|
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -106,16 +72,9 @@ void UAdvancedVoiceLibrary::RegisterAllLocalTalkers(UObject* WorldContextObject)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UAdvancedVoiceLibrary::UnRegisterLocalTalker(UObject* WorldContextObject, uint8 LocalPlayerNum)
|
void UAdvancedVoiceLibrary::UnRegisterLocalTalker(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())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -126,16 +85,9 @@ void UAdvancedVoiceLibrary::UnRegisterLocalTalker(UObject* WorldContextObject, u
|
|||||||
VoiceInterface->UnregisterLocalTalker(LocalPlayerNum);
|
VoiceInterface->UnregisterLocalTalker(LocalPlayerNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedVoiceLibrary::UnRegisterAllLocalTalkers(UObject* WorldContextObject)
|
void UAdvancedVoiceLibrary::UnRegisterAllLocalTalkers()
|
||||||
{
|
{
|
||||||
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
|
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -146,7 +98,7 @@ void UAdvancedVoiceLibrary::UnRegisterAllLocalTalkers(UObject* WorldContextObjec
|
|||||||
VoiceInterface->UnregisterLocalTalkers();
|
VoiceInterface->UnregisterLocalTalkers();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedVoiceLibrary::RegisterRemoteTalker(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId)
|
bool UAdvancedVoiceLibrary::RegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId)
|
||||||
{
|
{
|
||||||
if (!UniqueNetId.IsValid())
|
if (!UniqueNetId.IsValid())
|
||||||
{
|
{
|
||||||
@@ -154,13 +106,7 @@ bool UAdvancedVoiceLibrary::RegisterRemoteTalker(UObject* WorldContextObject, co
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
|
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -171,7 +117,7 @@ bool UAdvancedVoiceLibrary::RegisterRemoteTalker(UObject* WorldContextObject, co
|
|||||||
return VoiceInterface->RegisterRemoteTalker(*UniqueNetId.GetUniqueNetId());
|
return VoiceInterface->RegisterRemoteTalker(*UniqueNetId.GetUniqueNetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId)
|
bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId)
|
||||||
{
|
{
|
||||||
if (!UniqueNetId.IsValid())
|
if (!UniqueNetId.IsValid())
|
||||||
{
|
{
|
||||||
@@ -179,13 +125,7 @@ bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(UObject* WorldContextObject,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
|
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -196,16 +136,9 @@ bool UAdvancedVoiceLibrary::UnRegisterRemoteTalker(UObject* WorldContextObject,
|
|||||||
return VoiceInterface->UnregisterRemoteTalker(*UniqueNetId.GetUniqueNetId());
|
return VoiceInterface->UnregisterRemoteTalker(*UniqueNetId.GetUniqueNetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedVoiceLibrary::RemoveAllRemoteTalkers(UObject* WorldContextObject)
|
void UAdvancedVoiceLibrary::RemoveAllRemoteTalkers()
|
||||||
{
|
{
|
||||||
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
|
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -216,16 +149,9 @@ void UAdvancedVoiceLibrary::RemoveAllRemoteTalkers(UObject* WorldContextObject)
|
|||||||
VoiceInterface->RemoveAllRemoteTalkers();
|
VoiceInterface->RemoveAllRemoteTalkers();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedVoiceLibrary::IsLocalPlayerTalking(UObject* WorldContextObject, uint8 LocalPlayerNum)
|
bool UAdvancedVoiceLibrary::IsLocalPlayerTalking(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())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -236,7 +162,7 @@ bool UAdvancedVoiceLibrary::IsLocalPlayerTalking(UObject* WorldContextObject, ui
|
|||||||
return VoiceInterface->IsLocalPlayerTalking(LocalPlayerNum);
|
return VoiceInterface->IsLocalPlayerTalking(LocalPlayerNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(UObject* WorldContextObject, const FBPUniqueNetId& UniqueNetId)
|
bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(const FBPUniqueNetId& UniqueNetId)
|
||||||
{
|
{
|
||||||
if (!UniqueNetId.IsValid())
|
if (!UniqueNetId.IsValid())
|
||||||
{
|
{
|
||||||
@@ -244,13 +170,7 @@ bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(UObject* WorldContextObject, c
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
|
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -261,7 +181,7 @@ bool UAdvancedVoiceLibrary::IsRemotePlayerTalking(UObject* WorldContextObject, c
|
|||||||
return VoiceInterface->IsRemotePlayerTalking(*UniqueNetId.GetUniqueNetId());
|
return VoiceInterface->IsRemotePlayerTalking(*UniqueNetId.GetUniqueNetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedVoiceLibrary::IsPlayerMuted(UObject* WorldContextObject, uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId)
|
bool UAdvancedVoiceLibrary::IsPlayerMuted(uint8 LocalUserNumChecking, const FBPUniqueNetId& UniqueNetId)
|
||||||
{
|
{
|
||||||
if (!UniqueNetId.IsValid())
|
if (!UniqueNetId.IsValid())
|
||||||
{
|
{
|
||||||
@@ -269,13 +189,7 @@ bool UAdvancedVoiceLibrary::IsPlayerMuted(UObject* WorldContextObject, uint8 Loc
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
|
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -286,7 +200,7 @@ bool UAdvancedVoiceLibrary::IsPlayerMuted(UObject* WorldContextObject, uint8 Loc
|
|||||||
return VoiceInterface->IsMuted(LocalUserNumChecking, *UniqueNetId.GetUniqueNetId());
|
return VoiceInterface->IsMuted(LocalUserNumChecking, *UniqueNetId.GetUniqueNetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedVoiceLibrary::MuteRemoteTalker(UObject* WorldContextObject, uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide)
|
bool UAdvancedVoiceLibrary::MuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide)
|
||||||
{
|
{
|
||||||
if (!UniqueNetId.IsValid())
|
if (!UniqueNetId.IsValid())
|
||||||
{
|
{
|
||||||
@@ -294,13 +208,7 @@ bool UAdvancedVoiceLibrary::MuteRemoteTalker(UObject* WorldContextObject, uint8
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
|
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -311,7 +219,7 @@ bool UAdvancedVoiceLibrary::MuteRemoteTalker(UObject* WorldContextObject, uint8
|
|||||||
return VoiceInterface->MuteRemoteTalker(LocalUserNum, *UniqueNetId.GetUniqueNetId(), bIsSystemWide);
|
return VoiceInterface->MuteRemoteTalker(LocalUserNum, *UniqueNetId.GetUniqueNetId(), bIsSystemWide);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(UObject* WorldContextObject, uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide)
|
bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(uint8 LocalUserNum, const FBPUniqueNetId& UniqueNetId, bool bIsSystemWide)
|
||||||
{
|
{
|
||||||
if (!UniqueNetId.IsValid())
|
if (!UniqueNetId.IsValid())
|
||||||
{
|
{
|
||||||
@@ -319,13 +227,7 @@ bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(UObject* WorldContextObject, uint
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
if (!IsValid(World))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
|
|
||||||
|
|
||||||
if (!VoiceInterface.IsValid())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -337,16 +239,9 @@ bool UAdvancedVoiceLibrary::UnMuteRemoteTalker(UObject* WorldContextObject, uint
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UAdvancedVoiceLibrary::GetNumLocalTalkers(UObject* WorldContextObject, int32 & NumLocalTalkers)
|
void UAdvancedVoiceLibrary::GetNumLocalTalkers(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())
|
if (!VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,91 +0,0 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
||||||
|
|
||||||
#include "AutoLoginUserCallbackProxy.h"
|
|
||||||
#include "Kismet/GameplayStatics.h"
|
|
||||||
|
|
||||||
#include "Online.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// ULoginUserCallbackProxy
|
|
||||||
|
|
||||||
UAutoLoginUserCallbackProxy::UAutoLoginUserCallbackProxy(const FObjectInitializer& ObjectInitializer)
|
|
||||||
: Super(ObjectInitializer)
|
|
||||||
, Delegate(FOnLoginCompleteDelegate::CreateUObject(this, &ThisClass::OnCompleted))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
UAutoLoginUserCallbackProxy* UAutoLoginUserCallbackProxy::AutoLoginUser(UObject* WorldContextObject, int32 LocalUserNum)
|
|
||||||
{
|
|
||||||
UAutoLoginUserCallbackProxy* Proxy = NewObject<UAutoLoginUserCallbackProxy>();
|
|
||||||
Proxy->LocalUserNumber = LocalUserNum;
|
|
||||||
Proxy->WorldContextObject = WorldContextObject;
|
|
||||||
return Proxy;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UAutoLoginUserCallbackProxy::Activate()
|
|
||||||
{
|
|
||||||
|
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("AutoLoginUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
|
||||||
|
|
||||||
if (Helper.OnlineSub != nullptr)
|
|
||||||
{
|
|
||||||
auto Identity = Helper.OnlineSub->GetIdentityInterface();
|
|
||||||
|
|
||||||
if (Identity.IsValid())
|
|
||||||
{
|
|
||||||
DelegateHandle = Identity->AddOnLoginCompleteDelegate_Handle(LocalUserNumber, Delegate);
|
|
||||||
Identity->AutoLogin(LocalUserNumber);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fail immediately
|
|
||||||
OnFailure.Broadcast();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UAutoLoginUserCallbackProxy::OnCompleted(int32 LocalUserNum, bool bWasSuccessful, const FUniqueNetId& UserId, const FString& ErrorVal)
|
|
||||||
{
|
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("AutoLoginUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
|
||||||
|
|
||||||
if (Helper.OnlineSub != nullptr)
|
|
||||||
{
|
|
||||||
auto Identity = Helper.OnlineSub->GetIdentityInterface();
|
|
||||||
|
|
||||||
if (Identity.IsValid())
|
|
||||||
{
|
|
||||||
Identity->ClearOnLoginCompleteDelegate_Handle(LocalUserNum, DelegateHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (APlayerController* PController = UGameplayStatics::GetPlayerController(WorldContextObject->GetWorld(), LocalUserNum))
|
|
||||||
{
|
|
||||||
ULocalPlayer* Player = Cast<ULocalPlayer>(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();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
OnFailure.Broadcast();
|
|
||||||
}
|
|
||||||
@@ -21,7 +21,7 @@ UCancelFindSessionsCallbackProxy* UCancelFindSessionsCallbackProxy::CancelFindSe
|
|||||||
|
|
||||||
void UCancelFindSessionsCallbackProxy::Activate()
|
void UCancelFindSessionsCallbackProxy::Activate()
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.IsValid())
|
if (Helper.IsValid())
|
||||||
@@ -47,7 +47,7 @@ void UCancelFindSessionsCallbackProxy::Activate()
|
|||||||
|
|
||||||
void UCancelFindSessionsCallbackProxy::OnCompleted(bool bWasSuccessful)
|
void UCancelFindSessionsCallbackProxy::OnCompleted(bool bWasSuccessful)
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.IsValid())
|
if (Helper.IsValid())
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ UCreateSessionCallbackProxyAdvanced::UCreateSessionCallbackProxyAdvanced(const F
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
UCreateSessionCallbackProxyAdvanced* UCreateSessionCallbackProxyAdvanced::CreateAdvancedSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair>& ExtraSettings, class APlayerController* PlayerController, int32 PublicConnections, int32 PrivateConnections, bool bUseLAN, bool bAllowInvites, bool bIsDedicatedServer, /*bool bUsePresence,*/ bool bUseLobbiesIfAvailable, bool bAllowJoinViaPresence, bool bAllowJoinViaPresenceFriendsOnly, bool bAntiCheatProtected, bool bUsesStats, bool bShouldAdvertise, bool bUseLobbiesVoiceChatIfAvailable, bool bStartAfterCreate)
|
UCreateSessionCallbackProxyAdvanced* UCreateSessionCallbackProxyAdvanced::CreateAdvancedSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair> &ExtraSettings, class APlayerController* PlayerController, int32 PublicConnections, int32 PrivateConnections, bool bUseLAN, bool bAllowInvites, bool bIsDedicatedServer, bool bUsePresence, bool bAllowJoinViaPresence, bool bAllowJoinViaPresenceFriendsOnly, bool bAntiCheatProtected, bool bUsesStats, bool bShouldAdvertise)
|
||||||
{
|
{
|
||||||
UCreateSessionCallbackProxyAdvanced* Proxy = NewObject<UCreateSessionCallbackProxyAdvanced>();
|
UCreateSessionCallbackProxyAdvanced* Proxy = NewObject<UCreateSessionCallbackProxyAdvanced>();
|
||||||
Proxy->PlayerControllerWeakPtr = PlayerController;
|
Proxy->PlayerControllerWeakPtr = PlayerController;
|
||||||
@@ -24,21 +24,18 @@ UCreateSessionCallbackProxyAdvanced* UCreateSessionCallbackProxyAdvanced::Create
|
|||||||
Proxy->bAllowInvites = bAllowInvites;
|
Proxy->bAllowInvites = bAllowInvites;
|
||||||
Proxy->ExtraSettings = ExtraSettings;
|
Proxy->ExtraSettings = ExtraSettings;
|
||||||
Proxy->bDedicatedServer = bIsDedicatedServer;
|
Proxy->bDedicatedServer = bIsDedicatedServer;
|
||||||
/*Proxy->bUsePresence = bUsePresence;*/
|
Proxy->bUsePresence = bUsePresence;
|
||||||
Proxy->bUseLobbiesIfAvailable = bUseLobbiesIfAvailable;
|
|
||||||
Proxy->bAllowJoinViaPresence = bAllowJoinViaPresence;
|
Proxy->bAllowJoinViaPresence = bAllowJoinViaPresence;
|
||||||
Proxy->bAllowJoinViaPresenceFriendsOnly = bAllowJoinViaPresenceFriendsOnly;
|
Proxy->bAllowJoinViaPresenceFriendsOnly = bAllowJoinViaPresenceFriendsOnly;
|
||||||
Proxy->bAntiCheatProtected = bAntiCheatProtected;
|
Proxy->bAntiCheatProtected = bAntiCheatProtected;
|
||||||
Proxy->bUsesStats = bUsesStats;
|
Proxy->bUsesStats = bUsesStats;
|
||||||
Proxy->bShouldAdvertise = bShouldAdvertise;
|
Proxy->bShouldAdvertise = bShouldAdvertise;
|
||||||
Proxy->bUseLobbiesVoiceChatIfAvailable = bUseLobbiesVoiceChatIfAvailable;
|
|
||||||
Proxy->bStartAfterCreate = bStartAfterCreate;
|
|
||||||
return Proxy;
|
return Proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UCreateSessionCallbackProxyAdvanced::Activate()
|
void UCreateSessionCallbackProxyAdvanced::Activate()
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSession"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSession"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
||||||
|
|
||||||
if (PlayerControllerWeakPtr.IsValid() )
|
if (PlayerControllerWeakPtr.IsValid() )
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
@@ -53,27 +50,21 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
|
|||||||
FOnlineSessionSettings Settings;
|
FOnlineSessionSettings Settings;
|
||||||
Settings.NumPublicConnections = NumPublicConnections;
|
Settings.NumPublicConnections = NumPublicConnections;
|
||||||
Settings.NumPrivateConnections = NumPrivateConnections;
|
Settings.NumPrivateConnections = NumPrivateConnections;
|
||||||
Settings.bShouldAdvertise = bShouldAdvertise;
|
Settings.bShouldAdvertise = true;
|
||||||
Settings.bAllowJoinInProgress = true;
|
Settings.bAllowJoinInProgress = true;
|
||||||
Settings.bIsLANMatch = bUseLAN;
|
Settings.bIsLANMatch = bUseLAN;
|
||||||
Settings.bAllowJoinViaPresence = bAllowJoinViaPresence;
|
Settings.bAllowJoinViaPresence = true;
|
||||||
Settings.bIsDedicated = bDedicatedServer;
|
Settings.bIsDedicated = bDedicatedServer;
|
||||||
|
|
||||||
if (bDedicatedServer)
|
if (bDedicatedServer)
|
||||||
{
|
|
||||||
Settings.bUseLobbiesIfAvailable = false;
|
|
||||||
Settings.bUsesPresence = false;
|
Settings.bUsesPresence = false;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
Settings.bUsesPresence = bUsePresence;
|
||||||
Settings.bUseLobbiesIfAvailable = bUseLobbiesIfAvailable;
|
|
||||||
Settings.bUsesPresence = bUseLobbiesIfAvailable;
|
|
||||||
}
|
|
||||||
|
|
||||||
Settings.bUseLobbiesVoiceChatIfAvailable = bUseLobbiesIfAvailable ? bUseLobbiesVoiceChatIfAvailable : false;
|
|
||||||
Settings.bAllowJoinViaPresenceFriendsOnly = bAllowJoinViaPresenceFriendsOnly;
|
Settings.bAllowJoinViaPresenceFriendsOnly = bAllowJoinViaPresenceFriendsOnly;
|
||||||
Settings.bAntiCheatProtected = bAntiCheatProtected;
|
Settings.bAntiCheatProtected = bAntiCheatProtected;
|
||||||
Settings.bUsesStats = bUsesStats;
|
Settings.bUsesStats = bUsesStats;
|
||||||
|
Settings.bShouldAdvertise = bShouldAdvertise;
|
||||||
|
|
||||||
// These are about the only changes over the standard Create Sessions Node
|
// These are about the only changes over the standard Create Sessions Node
|
||||||
Settings.bAllowInvites = bAllowInvites;
|
Settings.bAllowInvites = bAllowInvites;
|
||||||
@@ -121,7 +112,7 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
|
|||||||
|
|
||||||
void UCreateSessionCallbackProxyAdvanced::OnCreateCompleted(FName SessionName, bool bWasSuccessful)
|
void UCreateSessionCallbackProxyAdvanced::OnCreateCompleted(FName SessionName, bool bWasSuccessful)
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
||||||
//Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
//Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.OnlineSub != nullptr)
|
if (Helper.OnlineSub != nullptr)
|
||||||
@@ -133,17 +124,8 @@ void UCreateSessionCallbackProxyAdvanced::OnCreateCompleted(FName SessionName, b
|
|||||||
|
|
||||||
if (bWasSuccessful)
|
if (bWasSuccessful)
|
||||||
{
|
{
|
||||||
if (this->bStartAfterCreate)
|
|
||||||
{
|
|
||||||
UE_LOG_ONLINE_SESSION(Display, TEXT("Session creation completed. Automatic start is turned on, starting session now."));
|
|
||||||
StartCompleteDelegateHandle = Sessions->AddOnStartSessionCompleteDelegate_Handle(StartCompleteDelegate);
|
StartCompleteDelegateHandle = Sessions->AddOnStartSessionCompleteDelegate_Handle(StartCompleteDelegate);
|
||||||
Sessions->StartSession(NAME_GameSession); // We'll call `OnSuccess.Broadcast()` when start succeeds.
|
Sessions->StartSession(NAME_GameSession);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UE_LOG_ONLINE_SESSION(Display, TEXT("Session creation completed. Automatic start is turned off, to start the session call 'StartSession'."));
|
|
||||||
OnSuccess.Broadcast();
|
|
||||||
}
|
|
||||||
|
|
||||||
// OnStartCompleted will get called, nothing more to do now
|
// OnStartCompleted will get called, nothing more to do now
|
||||||
return;
|
return;
|
||||||
@@ -159,7 +141,7 @@ void UCreateSessionCallbackProxyAdvanced::OnCreateCompleted(FName SessionName, b
|
|||||||
|
|
||||||
void UCreateSessionCallbackProxyAdvanced::OnStartCompleted(FName SessionName, bool bWasSuccessful)
|
void UCreateSessionCallbackProxyAdvanced::OnStartCompleted(FName SessionName, bool bWasSuccessful)
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("StartSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("StartSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
||||||
//Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
//Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.OnlineSub != nullptr)
|
if (Helper.OnlineSub != nullptr)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ UEndSessionCallbackProxy* UEndSessionCallbackProxy::EndSession(UObject* WorldCon
|
|||||||
|
|
||||||
void UEndSessionCallbackProxy::Activate()
|
void UEndSessionCallbackProxy::Activate()
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSession"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSession"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.IsValid())
|
if (Helper.IsValid())
|
||||||
@@ -55,7 +55,7 @@ void UEndSessionCallbackProxy::Activate()
|
|||||||
|
|
||||||
void UEndSessionCallbackProxy::OnCompleted(FName SessionName, bool bWasSuccessful)
|
void UEndSessionCallbackProxy::OnCompleted(FName SessionName, bool bWasSuccessful)
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.IsValid())
|
if (Helper.IsValid())
|
||||||
|
|||||||
@@ -41,18 +41,7 @@ void UFindFriendSessionCallbackProxy::Activate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
|
||||||
|
|
||||||
if (!Helper.IsValid())
|
|
||||||
{
|
|
||||||
// Fail immediately
|
|
||||||
TArray<FBlueprintSessionResult> EmptyResult;
|
|
||||||
OnFailure.Broadcast(EmptyResult);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineSessionPtr Sessions = Helper.OnlineSub->GetSessionInterface();
|
|
||||||
|
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
{
|
{
|
||||||
@@ -82,17 +71,12 @@ void UFindFriendSessionCallbackProxy::Activate()
|
|||||||
|
|
||||||
void UFindFriendSessionCallbackProxy::OnFindFriendSessionCompleted(int32 LocalPlayer, bool bWasSuccessful, const TArray<FOnlineSessionSearchResult>& SessionInfo)
|
void UFindFriendSessionCallbackProxy::OnFindFriendSessionCompleted(int32 LocalPlayer, bool bWasSuccessful, const TArray<FOnlineSessionSearchResult>& SessionInfo)
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
|
||||||
|
|
||||||
if (Helper.IsValid())
|
|
||||||
{
|
|
||||||
IOnlineSessionPtr Sessions = Helper.OnlineSub->GetSessionInterface();
|
|
||||||
|
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
Sessions->ClearOnFindFriendSessionCompleteDelegate_Handle(LocalPlayer, FindFriendSessionCompleteDelegateHandle);
|
Sessions->ClearOnFindFriendSessionCompleteDelegate_Handle(LocalPlayer, FindFriendSessionCompleteDelegateHandle);
|
||||||
|
|
||||||
if (bWasSuccessful)
|
if ( bWasSuccessful )
|
||||||
{
|
{
|
||||||
TArray<FBlueprintSessionResult> Result;
|
TArray<FBlueprintSessionResult> Result;
|
||||||
|
|
||||||
@@ -102,19 +86,11 @@ void UFindFriendSessionCallbackProxy::OnFindFriendSessionCompleted(int32 LocalPl
|
|||||||
{
|
{
|
||||||
FBlueprintSessionResult BSesh;
|
FBlueprintSessionResult BSesh;
|
||||||
BSesh.OnlineResult = Sesh;
|
BSesh.OnlineResult = Sesh;
|
||||||
|
|
||||||
// Temp for 5.5, force the values if epic isn't setting them, lobbies should always have these true
|
|
||||||
if (!BSesh.OnlineResult.Session.SessionSettings.bIsDedicated)
|
|
||||||
{
|
|
||||||
BSesh.OnlineResult.Session.SessionSettings.bUseLobbiesIfAvailable = true;
|
|
||||||
BSesh.OnlineResult.Session.SessionSettings.bUsesPresence = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Result.Add(BSesh);
|
Result.Add(BSesh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Result.Num() > 0)
|
if(Result.Num() > 0)
|
||||||
OnSuccess.Broadcast(Result);
|
OnSuccess.Broadcast(Result);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -128,11 +104,4 @@ void UFindFriendSessionCallbackProxy::OnFindFriendSessionCompleted(int32 LocalPl
|
|||||||
TArray<FBlueprintSessionResult> EmptyResult;
|
TArray<FBlueprintSessionResult> EmptyResult;
|
||||||
OnFailure.Broadcast(EmptyResult);
|
OnFailure.Broadcast(EmptyResult);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UE_LOG(AdvancedFindFriendSessionLog, Warning, TEXT("FindFriendSession Failed"));
|
|
||||||
TArray<FBlueprintSessionResult> EmptyResult;
|
|
||||||
OnFailure.Broadcast(EmptyResult);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
#include "FindSessionsCallbackProxyAdvanced.h"
|
#include "FindSessionsCallbackProxyAdvanced.h"
|
||||||
|
|
||||||
#include "Online/OnlineSessionNames.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// UFindSessionsCallbackProxyAdvanced
|
// UFindSessionsCallbackProxyAdvanced
|
||||||
@@ -16,7 +15,7 @@ UFindSessionsCallbackProxyAdvanced::UFindSessionsCallbackProxyAdvanced(const FOb
|
|||||||
bIsOnSecondSearch = false;
|
bIsOnSecondSearch = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UFindSessionsCallbackProxyAdvanced* UFindSessionsCallbackProxyAdvanced::FindSessionsAdvanced(UObject* WorldContextObject, class APlayerController* PlayerController, int MaxResults, bool bUseLAN, EBPServerPresenceSearchType ServerTypeToSearch, const TArray<FSessionsSearchSetting> &Filters, bool bEmptyServersOnly, bool bNonEmptyServersOnly, bool bSecureServersOnly, /*bool bSearchLobbies,*/ int MinSlotsAvailable)
|
UFindSessionsCallbackProxyAdvanced* UFindSessionsCallbackProxyAdvanced::FindSessionsAdvanced(UObject* WorldContextObject, class APlayerController* PlayerController, int MaxResults, bool bUseLAN, EBPServerPresenceSearchType ServerTypeToSearch, const TArray<FSessionsSearchSetting> &Filters, bool bEmptyServersOnly, bool bNonEmptyServersOnly, bool bSecureServersOnly, int MinSlotsAvailable)
|
||||||
{
|
{
|
||||||
UFindSessionsCallbackProxyAdvanced* Proxy = NewObject<UFindSessionsCallbackProxyAdvanced>();
|
UFindSessionsCallbackProxyAdvanced* Proxy = NewObject<UFindSessionsCallbackProxyAdvanced>();
|
||||||
Proxy->PlayerControllerWeakPtr = PlayerController;
|
Proxy->PlayerControllerWeakPtr = PlayerController;
|
||||||
@@ -28,14 +27,13 @@ UFindSessionsCallbackProxyAdvanced* UFindSessionsCallbackProxyAdvanced::FindSess
|
|||||||
Proxy->bEmptyServersOnly = bEmptyServersOnly,
|
Proxy->bEmptyServersOnly = bEmptyServersOnly,
|
||||||
Proxy->bNonEmptyServersOnly = bNonEmptyServersOnly;
|
Proxy->bNonEmptyServersOnly = bNonEmptyServersOnly;
|
||||||
Proxy->bSecureServersOnly = bSecureServersOnly;
|
Proxy->bSecureServersOnly = bSecureServersOnly;
|
||||||
//Proxy->bSearchLobbies = bSearchLobbies;
|
|
||||||
Proxy->MinSlotsAvailable = MinSlotsAvailable;
|
Proxy->MinSlotsAvailable = MinSlotsAvailable;
|
||||||
return Proxy;
|
return Proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UFindSessionsCallbackProxyAdvanced::Activate()
|
void UFindSessionsCallbackProxyAdvanced::Activate()
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.IsValid())
|
if (Helper.IsValid())
|
||||||
@@ -75,17 +73,7 @@ void UFindSessionsCallbackProxyAdvanced::Activate()
|
|||||||
#define SEARCH_USER FName(TEXT("SEARCHUSER"))
|
#define SEARCH_USER FName(TEXT("SEARCHUSER"))
|
||||||
// Keywords to match in session search
|
// Keywords to match in session search
|
||||||
#define SEARCH_KEYWORDS FName(TEXT("SEARCHKEYWORDS"))*/
|
#define SEARCH_KEYWORDS FName(TEXT("SEARCHKEYWORDS"))*/
|
||||||
/** Keywords to match in session search */
|
|
||||||
/** The matchmaking queue name to matchmake in, e.g. "TeamDeathmatch" (value is string) */
|
|
||||||
/** #define SEARCH_MATCHMAKING_QUEUE FName(TEXT("MATCHMAKINGQUEUE"))*/
|
|
||||||
/** If set, use the named Xbox Live hopper to find a session via matchmaking (value is a string) */
|
|
||||||
/** #define SEARCH_XBOX_LIVE_HOPPER_NAME FName(TEXT("LIVEHOPPERNAME"))*/
|
|
||||||
/** Which session template from the service configuration to use */
|
|
||||||
/** #define SEARCH_XBOX_LIVE_SESSION_TEMPLATE_NAME FName(TEXT("LIVESESSIONTEMPLATE"))*/
|
|
||||||
/** Selection method used to determine which match to join when multiple are returned (valid only on Switch) */
|
|
||||||
/** #define SEARCH_SWITCH_SELECTION_METHOD FName(TEXT("SWITCHSELECTIONMETHOD"))*/
|
|
||||||
/** Whether to use lobbies vs sessions */
|
|
||||||
/** #define SEARCH_LOBBIES FName(TEXT("LOBBYSEARCH"))*/
|
|
||||||
if (bEmptyServersOnly)
|
if (bEmptyServersOnly)
|
||||||
tem.Set(SEARCH_EMPTY_SERVERS_ONLY, true, EOnlineComparisonOp::Equals);
|
tem.Set(SEARCH_EMPTY_SERVERS_ONLY, true, EOnlineComparisonOp::Equals);
|
||||||
|
|
||||||
@@ -98,6 +86,8 @@ void UFindSessionsCallbackProxyAdvanced::Activate()
|
|||||||
if (MinSlotsAvailable != 0)
|
if (MinSlotsAvailable != 0)
|
||||||
tem.Set(SEARCH_MINSLOTSAVAILABLE, MinSlotsAvailable, EOnlineComparisonOp::GreaterThanEquals);
|
tem.Set(SEARCH_MINSLOTSAVAILABLE, MinSlotsAvailable, EOnlineComparisonOp::GreaterThanEquals);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Filter results
|
// Filter results
|
||||||
if (SearchSettings.Num() > 0)
|
if (SearchSettings.Num() > 0)
|
||||||
{
|
{
|
||||||
@@ -113,10 +103,7 @@ void UFindSessionsCallbackProxyAdvanced::Activate()
|
|||||||
|
|
||||||
case EBPServerPresenceSearchType::ClientServersOnly:
|
case EBPServerPresenceSearchType::ClientServersOnly:
|
||||||
{
|
{
|
||||||
//tem.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);
|
tem.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);
|
||||||
|
|
||||||
//if (bSearchLobbies)// && !IOnlineSubsystem::DoesInstanceExist("STEAM"))
|
|
||||||
tem.Set(SEARCH_LOBBIES, true, EOnlineComparisonOp::Equals);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -129,8 +116,9 @@ void UFindSessionsCallbackProxyAdvanced::Activate()
|
|||||||
case EBPServerPresenceSearchType::AllServers:
|
case EBPServerPresenceSearchType::AllServers:
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
//if (IOnlineSubsystem::DoesInstanceExist("STEAM"))
|
// Only steam uses the separate searching flags currently
|
||||||
//{
|
if (IOnlineSubsystem::DoesInstanceExist("STEAM"))
|
||||||
|
{
|
||||||
bRunSecondSearch = true;
|
bRunSecondSearch = true;
|
||||||
|
|
||||||
SearchObjectDedicated = MakeShareable(new FOnlineSessionSearch);
|
SearchObjectDedicated = MakeShareable(new FOnlineSessionSearch);
|
||||||
@@ -138,15 +126,11 @@ void UFindSessionsCallbackProxyAdvanced::Activate()
|
|||||||
SearchObjectDedicated->bIsLanQuery = bUseLAN;
|
SearchObjectDedicated->bIsLanQuery = bUseLAN;
|
||||||
|
|
||||||
FOnlineSearchSettingsEx DedicatedOnly = tem;
|
FOnlineSearchSettingsEx DedicatedOnly = tem;
|
||||||
|
tem.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);
|
||||||
//tem.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);
|
|
||||||
|
|
||||||
//if (bSearchLobbies)// && !IOnlineSubsystem::DoesInstanceExist("STEAM"))
|
|
||||||
tem.Set(SEARCH_LOBBIES, true, EOnlineComparisonOp::Equals);
|
|
||||||
|
|
||||||
//DedicatedOnly.Set(SEARCH_DEDICATED_ONLY, true, EOnlineComparisonOp::Equals);
|
//DedicatedOnly.Set(SEARCH_DEDICATED_ONLY, true, EOnlineComparisonOp::Equals);
|
||||||
SearchObjectDedicated->QuerySettings = DedicatedOnly;
|
SearchObjectDedicated->QuerySettings = DedicatedOnly;
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -171,16 +155,9 @@ void UFindSessionsCallbackProxyAdvanced::Activate()
|
|||||||
|
|
||||||
void UFindSessionsCallbackProxyAdvanced::OnCompleted(bool bSuccess)
|
void UFindSessionsCallbackProxyAdvanced::OnCompleted(bool bSuccess)
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (!Helper.IsValid())
|
|
||||||
{
|
|
||||||
// Fail immediately
|
|
||||||
OnFailure.Broadcast(SessionSearchResults);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bRunSecondSearch && Helper.IsValid())
|
if (!bRunSecondSearch && Helper.IsValid())
|
||||||
{
|
{
|
||||||
auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
||||||
@@ -205,7 +182,7 @@ void UFindSessionsCallbackProxyAdvanced::OnCompleted(bool bSuccess)
|
|||||||
|
|
||||||
FBlueprintSessionResult BPResult;
|
FBlueprintSessionResult BPResult;
|
||||||
BPResult.OnlineResult = Result;
|
BPResult.OnlineResult = Result;
|
||||||
SessionSearchResults.AddUnique(BPResult);
|
SessionSearchResults.Add(BPResult);
|
||||||
}
|
}
|
||||||
OnSuccess.Broadcast(SessionSearchResults);
|
OnSuccess.Broadcast(SessionSearchResults);
|
||||||
return;
|
return;
|
||||||
@@ -224,15 +201,7 @@ void UFindSessionsCallbackProxyAdvanced::OnCompleted(bool bSuccess)
|
|||||||
|
|
||||||
FBlueprintSessionResult BPResult;
|
FBlueprintSessionResult BPResult;
|
||||||
BPResult.OnlineResult = Result;
|
BPResult.OnlineResult = Result;
|
||||||
|
SessionSearchResults.Add(BPResult);
|
||||||
// Temp for 5.5, force the values if epic isn't setting them, lobbies should always have these true
|
|
||||||
if (ServerSearchType != EBPServerPresenceSearchType::DedicatedServersOnly )
|
|
||||||
{
|
|
||||||
BPResult.OnlineResult.Session.SessionSettings.bUseLobbiesIfAvailable = true;
|
|
||||||
BPResult.OnlineResult.Session.SessionSettings.bUsesPresence = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
SessionSearchResults.AddUnique(BPResult);
|
|
||||||
}
|
}
|
||||||
if (!bRunSecondSearch)
|
if (!bRunSecondSearch)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
#include "GetFriendsCallbackProxy.h"
|
#include "GetFriendsCallbackProxy.h"
|
||||||
|
|
||||||
#include "Online.h"
|
|
||||||
#include "Interfaces/OnlineFriendsInterface.h"
|
|
||||||
#include "Interfaces/OnlinePresenceInterface.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// UGetFriendsCallbackProxy
|
// UGetFriendsCallbackProxy
|
||||||
@@ -34,12 +31,7 @@ void UGetFriendsCallbackProxy::Activate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetFriends"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
IOnlineFriendsPtr Friends = Online::GetFriendsInterface();
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
|
||||||
|
|
||||||
if (Helper.IsValid())
|
|
||||||
{
|
|
||||||
IOnlineFriendsPtr Friends = Helper.OnlineSub->GetFriendsInterface();
|
|
||||||
if (Friends.IsValid())
|
if (Friends.IsValid())
|
||||||
{
|
{
|
||||||
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerControllerWeakPtr->Player);
|
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerControllerWeakPtr->Player);
|
||||||
@@ -47,10 +39,10 @@ void UGetFriendsCallbackProxy::Activate()
|
|||||||
Friends->ReadFriendsList(Player->GetControllerId(), EFriendsLists::ToString((EFriendsLists::Default)), FriendListReadCompleteDelegate);
|
Friends->ReadFriendsList(Player->GetControllerId(), EFriendsLists::ToString((EFriendsLists::Default)), FriendListReadCompleteDelegate);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Fail immediately
|
// Fail immediately
|
||||||
TArray<FBPFriendInfo> EmptyArray;
|
TArray<FBPFriendInfo> EmptyArray;
|
||||||
|
|
||||||
OnFailure.Broadcast(EmptyArray);
|
OnFailure.Broadcast(EmptyArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,17 +50,7 @@ void UGetFriendsCallbackProxy::OnReadFriendsListCompleted(int32 LocalUserNum, bo
|
|||||||
{
|
{
|
||||||
if (bWasSuccessful)
|
if (bWasSuccessful)
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetFriends"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
IOnlineFriendsPtr Friends = Online::GetFriendsInterface();
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
|
||||||
|
|
||||||
if (!Helper.IsValid())
|
|
||||||
{
|
|
||||||
TArray<FBPFriendInfo> EmptyArray;
|
|
||||||
OnFailure.Broadcast(EmptyArray);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto Friends = Helper.OnlineSub->GetFriendsInterface();
|
|
||||||
if (Friends.IsValid())
|
if (Friends.IsValid())
|
||||||
{
|
{
|
||||||
// Not actually needed anymore, plus was not being validated and causing a crash
|
// Not actually needed anymore, plus was not being validated and causing a crash
|
||||||
@@ -76,32 +58,30 @@ void UGetFriendsCallbackProxy::OnReadFriendsListCompleted(int32 LocalUserNum, bo
|
|||||||
|
|
||||||
TArray<FBPFriendInfo> FriendsListOut;
|
TArray<FBPFriendInfo> FriendsListOut;
|
||||||
TArray< TSharedRef<FOnlineFriend> > FriendList;
|
TArray< TSharedRef<FOnlineFriend> > FriendList;
|
||||||
if (Friends->GetFriendsList(LocalUserNum, ListName, FriendList))
|
Friends->GetFriendsList(LocalUserNum, ListName, FriendList);
|
||||||
{
|
|
||||||
for (int32 i = 0; i < FriendList.Num(); i++)
|
for (int32 i = 0; i < FriendList.Num(); i++)
|
||||||
{
|
{
|
||||||
|
TSharedRef<FOnlineFriend> Friend = FriendList[i];
|
||||||
FBPFriendInfo BPF;
|
FBPFriendInfo BPF;
|
||||||
const FOnlineUserPresence& pres = FriendList[i]->GetPresence();
|
FOnlineUserPresence pres = Friend->GetPresence();
|
||||||
BPF.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
|
BPF.OnlineState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
|
||||||
BPF.DisplayName = FriendList[i]->GetDisplayName();
|
BPF.DisplayName = Friend->GetDisplayName();
|
||||||
BPF.RealName = FriendList[i]->GetRealName();
|
BPF.RealName = Friend->GetRealName();
|
||||||
BPF.UniqueNetId.SetUniqueNetId(FriendList[i]->GetUserId());
|
BPF.UniqueNetId.SetUniqueNetId(Friend->GetUserId());
|
||||||
BPF.bIsPlayingSameGame = pres.bIsPlayingThisGame;
|
BPF.bIsPlayingSameGame = pres.bIsPlayingThisGame;
|
||||||
|
|
||||||
BPF.PresenceInfo.bIsOnline = pres.bIsOnline;
|
BPF.PresenceInfo.bIsOnline = pres.bIsOnline;
|
||||||
BPF.PresenceInfo.bHasVoiceSupport = pres.bHasVoiceSupport;
|
BPF.PresenceInfo.bHasVoiceSupport = pres.bHasVoiceSupport;
|
||||||
BPF.PresenceInfo.bIsPlaying = pres.bIsPlaying;
|
BPF.PresenceInfo.bIsPlaying = pres.bIsPlaying;
|
||||||
BPF.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
|
BPF.PresenceInfo.PresenceState = ((EBPOnlinePresenceState)((int32)pres.Status.State));
|
||||||
|
BPF.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
|
|
||||||
//BPF.PresenceInfo.StatusString = pres.Status.StatusStr;
|
|
||||||
BPF.PresenceInfo.bIsJoinable = pres.bIsJoinable;
|
BPF.PresenceInfo.bIsJoinable = pres.bIsJoinable;
|
||||||
BPF.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame;
|
BPF.PresenceInfo.bIsPlayingThisGame = pres.bIsPlayingThisGame;
|
||||||
|
|
||||||
|
|
||||||
FriendsListOut.Add(BPF);
|
FriendsListOut.Add(BPF);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
OnSuccess.Broadcast(FriendsListOut);
|
OnSuccess.Broadcast(FriendsListOut);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
#include "GetRecentPlayersCallbackProxy.h"
|
#include "GetRecentPlayersCallbackProxy.h"
|
||||||
|
|
||||||
#include "Online.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// UGetRecentPlayersCallbackProxy
|
// UGetRecentPlayersCallbackProxy
|
||||||
@@ -32,16 +31,7 @@ void UGetRecentPlayersCallbackProxy::Activate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetRecentPlayers"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
IOnlineFriendsPtr Friends = Online::GetFriendsInterface();
|
||||||
|
|
||||||
if (!Helper.OnlineSub)
|
|
||||||
{
|
|
||||||
TArray<FBPOnlineRecentPlayer> EmptyArray;
|
|
||||||
OnFailure.Broadcast(EmptyArray);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineFriendsPtr Friends = Helper.OnlineSub->GetFriendsInterface();
|
|
||||||
if (Friends.IsValid())
|
if (Friends.IsValid())
|
||||||
{
|
{
|
||||||
DelegateHandle = Friends->AddOnQueryRecentPlayersCompleteDelegate_Handle(QueryRecentPlayersCompleteDelegate);
|
DelegateHandle = Friends->AddOnQueryRecentPlayersCompleteDelegate_Handle(QueryRecentPlayersCompleteDelegate);
|
||||||
@@ -58,16 +48,7 @@ void UGetRecentPlayersCallbackProxy::Activate()
|
|||||||
void UGetRecentPlayersCallbackProxy::OnQueryRecentPlayersCompleted(const FUniqueNetId &UserID, const FString &Namespace, bool bWasSuccessful, const FString& ErrorString)
|
void UGetRecentPlayersCallbackProxy::OnQueryRecentPlayersCompleted(const FUniqueNetId &UserID, const FString &Namespace, bool bWasSuccessful, const FString& ErrorString)
|
||||||
{
|
{
|
||||||
|
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetRecentPlayers"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
IOnlineFriendsPtr Friends = Online::GetFriendsInterface();
|
||||||
|
|
||||||
if (!Helper.OnlineSub)
|
|
||||||
{
|
|
||||||
TArray<FBPOnlineRecentPlayer> EmptyArray;
|
|
||||||
OnFailure.Broadcast(EmptyArray);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOnlineFriendsPtr Friends = Helper.OnlineSub->GetFriendsInterface();
|
|
||||||
if (Friends.IsValid())
|
if (Friends.IsValid())
|
||||||
Friends->ClearOnQueryRecentPlayersCompleteDelegate_Handle(DelegateHandle);
|
Friends->ClearOnQueryRecentPlayersCompleteDelegate_Handle(DelegateHandle);
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "GetUserPrivilegeCallbackProxy.h"
|
#include "GetUserPrivilegeCallbackProxy.h"
|
||||||
|
|
||||||
#include "Online.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// UGetUserPrivilegeCallbackProxy
|
// UGetUserPrivilegeCallbackProxy
|
||||||
@@ -23,14 +22,7 @@ UGetUserPrivilegeCallbackProxy* UGetUserPrivilegeCallbackProxy::GetUserPrivilege
|
|||||||
|
|
||||||
void UGetUserPrivilegeCallbackProxy::Activate()
|
void UGetUserPrivilegeCallbackProxy::Activate()
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetUserPrivilege"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
auto Identity = Online::GetIdentityInterface();
|
||||||
|
|
||||||
if (!Helper.OnlineSub)
|
|
||||||
{
|
|
||||||
OnFailure.Broadcast();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
auto Identity = Helper.OnlineSub->GetIdentityInterface();
|
|
||||||
|
|
||||||
if (Identity.IsValid())
|
if (Identity.IsValid())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "LoginUserCallbackProxy.h"
|
#include "LoginUserCallbackProxy.h"
|
||||||
|
|
||||||
#include "Online.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// ULoginUserCallbackProxy
|
// ULoginUserCallbackProxy
|
||||||
@@ -13,13 +12,12 @@ ULoginUserCallbackProxy::ULoginUserCallbackProxy(const FObjectInitializer& Objec
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ULoginUserCallbackProxy* ULoginUserCallbackProxy::LoginUser(UObject* WorldContextObject, class APlayerController* PlayerController, FString UserID, FString UserToken, FString AuthType)
|
ULoginUserCallbackProxy* ULoginUserCallbackProxy::LoginUser(UObject* WorldContextObject, class APlayerController* PlayerController, FString UserID, FString UserToken)
|
||||||
{
|
{
|
||||||
ULoginUserCallbackProxy* Proxy = NewObject<ULoginUserCallbackProxy>();
|
ULoginUserCallbackProxy* Proxy = NewObject<ULoginUserCallbackProxy>();
|
||||||
Proxy->PlayerControllerWeakPtr = PlayerController;
|
Proxy->PlayerControllerWeakPtr = PlayerController;
|
||||||
Proxy->UserID = UserID;
|
Proxy->UserID = UserID;
|
||||||
Proxy->UserToken = UserToken;
|
Proxy->UserToken = UserToken;
|
||||||
Proxy->AuthType = AuthType;
|
|
||||||
Proxy->WorldContextObject = WorldContextObject;
|
Proxy->WorldContextObject = WorldContextObject;
|
||||||
return Proxy;
|
return Proxy;
|
||||||
}
|
}
|
||||||
@@ -41,24 +39,12 @@ void ULoginUserCallbackProxy::Activate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("LoginUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
auto Identity = Online::GetIdentityInterface();
|
||||||
|
|
||||||
if (!Helper.OnlineSub)
|
|
||||||
{
|
|
||||||
OnFailure.Broadcast();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto Identity = Helper.OnlineSub->GetIdentityInterface();
|
|
||||||
if (Identity.IsValid())
|
if (Identity.IsValid())
|
||||||
{
|
{
|
||||||
// Fallback to default AuthType if nothing is specified
|
|
||||||
if (AuthType.IsEmpty())
|
|
||||||
{
|
|
||||||
AuthType = Identity->GetAuthType();
|
|
||||||
}
|
|
||||||
DelegateHandle = Identity->AddOnLoginCompleteDelegate_Handle(Player->GetControllerId(), Delegate);
|
DelegateHandle = Identity->AddOnLoginCompleteDelegate_Handle(Player->GetControllerId(), Delegate);
|
||||||
FOnlineAccountCredentials AccountCreds(AuthType, UserID, UserToken);
|
FOnlineAccountCredentials AccountCreds(Identity->GetAuthType(), UserID, UserToken);
|
||||||
Identity->Login(Player->GetControllerId(), AccountCreds);
|
Identity->Login(Player->GetControllerId(), AccountCreds);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -73,30 +59,14 @@ void ULoginUserCallbackProxy::OnCompleted(int32 LocalUserNum, bool bWasSuccessfu
|
|||||||
{
|
{
|
||||||
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerControllerWeakPtr->Player);
|
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerControllerWeakPtr->Player);
|
||||||
|
|
||||||
FUniqueNetIdRepl UniqueID(UserId.AsShared());
|
|
||||||
|
|
||||||
if (Player)
|
if (Player)
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("GetUserPrivilege"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
auto Identity = Online::GetIdentityInterface();
|
||||||
|
|
||||||
if (!Helper.OnlineSub)
|
|
||||||
{
|
|
||||||
OnFailure.Broadcast();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto Identity = Helper.OnlineSub->GetIdentityInterface();
|
|
||||||
if (Identity.IsValid())
|
if (Identity.IsValid())
|
||||||
{
|
{
|
||||||
Identity->ClearOnLoginCompleteDelegate_Handle(Player->GetControllerId(), DelegateHandle);
|
Identity->ClearOnLoginCompleteDelegate_Handle(Player->GetControllerId(), DelegateHandle);
|
||||||
}
|
}
|
||||||
Player->SetCachedUniqueNetId(UniqueID);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (APlayerState* State = PlayerControllerWeakPtr->PlayerState)
|
|
||||||
{
|
|
||||||
// Update UniqueId. See also ShowLoginUICallbackProxy.cpp
|
|
||||||
State->SetUniqueId(UniqueID);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "LogoutUserCallbackProxy.h"
|
#include "LogoutUserCallbackProxy.h"
|
||||||
|
|
||||||
#include "Online.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// ULogoutUserCallbackProxy
|
// ULogoutUserCallbackProxy
|
||||||
@@ -30,6 +29,7 @@ void ULogoutUserCallbackProxy::Activate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerControllerWeakPtr->Player);
|
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerControllerWeakPtr->Player);
|
||||||
|
|
||||||
if (!Player)
|
if (!Player)
|
||||||
@@ -38,14 +38,7 @@ void ULogoutUserCallbackProxy::Activate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("LogoutUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
auto Identity = Online::GetIdentityInterface();
|
||||||
|
|
||||||
if (!Helper.OnlineSub)
|
|
||||||
{
|
|
||||||
OnFailure.Broadcast();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
auto Identity = Helper.OnlineSub->GetIdentityInterface();
|
|
||||||
|
|
||||||
if (Identity.IsValid())
|
if (Identity.IsValid())
|
||||||
{
|
{
|
||||||
@@ -67,14 +60,7 @@ void ULogoutUserCallbackProxy::OnCompleted(int LocalUserNum, bool bWasSuccessful
|
|||||||
|
|
||||||
if (Player)
|
if (Player)
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("LogoutUser"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
auto Identity = Online::GetIdentityInterface();
|
||||||
|
|
||||||
if (!Helper.OnlineSub)
|
|
||||||
{
|
|
||||||
OnFailure.Broadcast();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
auto Identity = Helper.OnlineSub->GetIdentityInterface();
|
|
||||||
|
|
||||||
if (Identity.IsValid())
|
if (Identity.IsValid())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
#include "SendFriendInviteCallbackProxy.h"
|
#include "SendFriendInviteCallbackProxy.h"
|
||||||
|
|
||||||
#include "Online.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// UGetRecentPlayersCallbackProxy
|
// UGetRecentPlayersCallbackProxy
|
||||||
@@ -40,15 +39,7 @@ void USendFriendInviteCallbackProxy::Activate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("SendFriendInvite"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
IOnlineFriendsPtr Friends = Online::GetFriendsInterface();
|
||||||
|
|
||||||
if (!Helper.OnlineSub)
|
|
||||||
{
|
|
||||||
OnFailure.Broadcast();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto Friends = Helper.OnlineSub->GetFriendsInterface();
|
|
||||||
if (Friends.IsValid())
|
if (Friends.IsValid())
|
||||||
{
|
{
|
||||||
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerControllerWeakPtr->Player);
|
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerControllerWeakPtr->Player);
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
#include "StartSessionCallbackProxyAdvanced.h"
|
|
||||||
|
|
||||||
UStartSessionCallbackProxyAdvanced::UStartSessionCallbackProxyAdvanced(const FObjectInitializer& ObjectInitializer)
|
|
||||||
: Super(ObjectInitializer)
|
|
||||||
, StartCompleteDelegate(FOnStartSessionCompleteDelegate::CreateUObject(this, &ThisClass::OnStartCompleted))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
UStartSessionCallbackProxyAdvanced* UStartSessionCallbackProxyAdvanced::StartAdvancedSession(
|
|
||||||
UObject* WorldContextObject)
|
|
||||||
{
|
|
||||||
UStartSessionCallbackProxyAdvanced* Proxy = NewObject<UStartSessionCallbackProxyAdvanced>();
|
|
||||||
Proxy->WorldContextObject = WorldContextObject;
|
|
||||||
return Proxy;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UStartSessionCallbackProxyAdvanced::Activate()
|
|
||||||
{
|
|
||||||
const FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("StartSession"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
|
||||||
|
|
||||||
if (Helper.OnlineSub != nullptr)
|
|
||||||
{
|
|
||||||
const auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
|
||||||
if (Sessions.IsValid())
|
|
||||||
{
|
|
||||||
StartCompleteDelegateHandle = Sessions->AddOnStartSessionCompleteDelegate_Handle(StartCompleteDelegate);
|
|
||||||
Sessions->StartSession(NAME_GameSession);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
FFrame::KismetExecutionMessage(TEXT("Sessions not supported by Online Subsystem"), ELogVerbosity::Warning);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fail immediately
|
|
||||||
OnFailure.Broadcast();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UStartSessionCallbackProxyAdvanced::OnStartCompleted(FName SessionName, bool bWasSuccessful)
|
|
||||||
{
|
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("StartSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
|
||||||
|
|
||||||
if (Helper.OnlineSub != nullptr)
|
|
||||||
{
|
|
||||||
auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
|
||||||
if (Sessions.IsValid())
|
|
||||||
{
|
|
||||||
Sessions->ClearOnStartSessionCompleteDelegate_Handle(StartCompleteDelegateHandle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bWasSuccessful)
|
|
||||||
{
|
|
||||||
OnSuccess.Broadcast();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OnFailure.Broadcast();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -12,7 +12,7 @@ UUpdateSessionCallbackProxyAdvanced::UUpdateSessionCallbackProxyAdvanced(const F
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::UpdateSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair> &ExtraSettings, int32 PublicConnections, int32 PrivateConnections, bool bUseLAN, bool bAllowInvites, bool bAllowJoinInProgress, bool bRefreshOnlineData, bool bIsDedicatedServer, bool bShouldAdvertise, bool bAllowJoinViaPresence, bool bAllowJoinViaPresenceFriendsOnly)
|
UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::UpdateSession(UObject* WorldContextObject, const TArray<FSessionPropertyKeyPair> &ExtraSettings, int32 PublicConnections, int32 PrivateConnections, bool bUseLAN, bool bAllowInvites, bool bAllowJoinInProgress, bool bRefreshOnlineData, bool bIsDedicatedServer)
|
||||||
{
|
{
|
||||||
UUpdateSessionCallbackProxyAdvanced* Proxy = NewObject<UUpdateSessionCallbackProxyAdvanced>();
|
UUpdateSessionCallbackProxyAdvanced* Proxy = NewObject<UUpdateSessionCallbackProxyAdvanced>();
|
||||||
Proxy->NumPublicConnections = PublicConnections;
|
Proxy->NumPublicConnections = PublicConnections;
|
||||||
@@ -24,19 +24,14 @@ UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::Update
|
|||||||
Proxy->bRefreshOnlineData = bRefreshOnlineData;
|
Proxy->bRefreshOnlineData = bRefreshOnlineData;
|
||||||
Proxy->bAllowJoinInProgress = bAllowJoinInProgress;
|
Proxy->bAllowJoinInProgress = bAllowJoinInProgress;
|
||||||
Proxy->bDedicatedServer = bIsDedicatedServer;
|
Proxy->bDedicatedServer = bIsDedicatedServer;
|
||||||
Proxy->bShouldAdvertise = bShouldAdvertise;
|
|
||||||
Proxy->bAllowJoinViaPresence = bAllowJoinViaPresence;
|
|
||||||
Proxy->bAllowJoinViaPresenceFriendsOnly = bAllowJoinViaPresenceFriendsOnly;
|
|
||||||
return Proxy;
|
return Proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UUpdateSessionCallbackProxyAdvanced::Activate()
|
void UUpdateSessionCallbackProxyAdvanced::Activate()
|
||||||
{
|
{
|
||||||
const FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("UpdateSession"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
|
||||||
|
|
||||||
if (Helper.OnlineSub != nullptr)
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||||
{
|
|
||||||
const auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
{
|
{
|
||||||
if (Sessions->GetNumSessions() < 1)
|
if (Sessions->GetNumSessions() < 1)
|
||||||
@@ -63,18 +58,15 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
|||||||
//Settings->BuildUniqueId = GetBuildUniqueId();
|
//Settings->BuildUniqueId = GetBuildUniqueId();
|
||||||
Settings->NumPublicConnections = NumPublicConnections;
|
Settings->NumPublicConnections = NumPublicConnections;
|
||||||
Settings->NumPrivateConnections = NumPrivateConnections;
|
Settings->NumPrivateConnections = NumPrivateConnections;
|
||||||
Settings->bShouldAdvertise = bShouldAdvertise;
|
//Settings->bShouldAdvertise = true;
|
||||||
Settings->bAllowJoinInProgress = bAllowJoinInProgress;
|
Settings->bAllowJoinInProgress = bAllowJoinInProgress;
|
||||||
Settings->bIsLANMatch = bUseLAN;
|
Settings->bIsLANMatch = bUseLAN;
|
||||||
//Settings->bUsesPresence = true;
|
//Settings->bUsesPresence = true;
|
||||||
|
//Settings->bAllowJoinViaPresence = true;
|
||||||
Settings->bAllowInvites = bAllowInvites;
|
Settings->bAllowInvites = bAllowInvites;
|
||||||
Settings->bAllowJoinInProgress = bAllowJoinInProgress;
|
Settings->bAllowJoinInProgress = bAllowJoinInProgress;
|
||||||
Settings->bIsDedicated = bDedicatedServer;
|
Settings->bIsDedicated = bDedicatedServer;
|
||||||
|
|
||||||
// Added in 5.6
|
|
||||||
Settings->bAllowJoinViaPresence = bAllowJoinViaPresence;
|
|
||||||
Settings->bAllowJoinViaPresenceFriendsOnly = bAllowJoinViaPresenceFriendsOnly;
|
|
||||||
|
|
||||||
FOnlineSessionSetting * fSetting = NULL;
|
FOnlineSessionSetting * fSetting = NULL;
|
||||||
FOnlineSessionSetting ExtraSetting;
|
FOnlineSessionSetting ExtraSetting;
|
||||||
for (int i = 0; i < ExtraSettings.Num(); i++)
|
for (int i = 0; i < ExtraSettings.Num(); i++)
|
||||||
@@ -102,7 +94,6 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
|||||||
{
|
{
|
||||||
FFrame::KismetExecutionMessage(TEXT("Sessions not supported by Online Subsystem"), ELogVerbosity::Warning);
|
FFrame::KismetExecutionMessage(TEXT("Sessions not supported by Online Subsystem"), ELogVerbosity::Warning);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Fail immediately
|
// Fail immediately
|
||||||
OnFailure.Broadcast();
|
OnFailure.Broadcast();
|
||||||
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Sessions not supported"));
|
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Sessions not supported"));
|
||||||
@@ -110,11 +101,7 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
|||||||
|
|
||||||
void UUpdateSessionCallbackProxyAdvanced::OnUpdateCompleted(FName SessionName, bool bWasSuccessful)
|
void UUpdateSessionCallbackProxyAdvanced::OnUpdateCompleted(FName SessionName, bool bWasSuccessful)
|
||||||
{
|
{
|
||||||
const FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("UpdateSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject.Get(), EGetWorldErrorMode::LogAndReturnNull));
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||||
|
|
||||||
if (Helper.OnlineSub != nullptr)
|
|
||||||
{
|
|
||||||
const auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
{
|
{
|
||||||
Sessions->ClearOnUpdateSessionCompleteDelegate_Handle(OnUpdateSessionCompleteDelegateHandle);
|
Sessions->ClearOnUpdateSessionCompleteDelegate_Handle(OnUpdateSessionCompleteDelegateHandle);
|
||||||
@@ -125,7 +112,6 @@ void UUpdateSessionCallbackProxyAdvanced::OnUpdateCompleted(FName SessionName, b
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!bWasSuccessful)
|
if (!bWasSuccessful)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"FileVersion" : 3,
|
"FileVersion" : 3,
|
||||||
|
|
||||||
"FriendlyName" : "Advanced Steam Sessions",
|
"FriendlyName" : "Advanced Steam Sessions",
|
||||||
"Version" : 5.4,
|
"Version" : 4.24,
|
||||||
"VersionName": "5.4",
|
"VersionName": "4.24",
|
||||||
"Description" : "Adds new blueprint functions to handle more advanced session operations in Steam. REQUIRES ADVANCED SESSIONS",
|
"Description" : "Adds new blueprint functions to handle more advanced session operations in Steam. REQUIRES ADVANCED SESSIONS",
|
||||||
"Category" : "Advanced Sessions Plugin",
|
"Category" : "Advanced Sessions Plugin",
|
||||||
"CreatedBy" : "Joshua Statzer",
|
"CreatedBy" : "Joshua Statzer",
|
||||||
@@ -12,9 +12,9 @@
|
|||||||
"Modules" :
|
"Modules" :
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"Name": "AdvancedSteamSessions",
|
"Name" : "AdvancedSteamSessions",
|
||||||
"Type": "RunTime",
|
"Type" : "RunTime",
|
||||||
"LoadingPhase": "PostDefault"
|
"LoadingPhase" : "PreDefault"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Plugins": [
|
"Plugins": [
|
||||||
@@ -26,16 +26,12 @@
|
|||||||
"Name": "OnlineSubsystem",
|
"Name": "OnlineSubsystem",
|
||||||
"Enabled": true
|
"Enabled": true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"Name": "OnlineSubsystemSteam",
|
|
||||||
"Enabled": true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"Name": "OnlineSubsystemUtils",
|
"Name": "OnlineSubsystemUtils",
|
||||||
"Enabled": true
|
"Enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "SteamShared",
|
"Name": "OnlineSubsystemSteam",
|
||||||
"Enabled": true
|
"Enabled": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
[FilterPlugin]
|
|
||||||
; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and
|
|
||||||
; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively.
|
|
||||||
;
|
|
||||||
; Examples:
|
|
||||||
; /README.txt
|
|
||||||
; /Extras/...
|
|
||||||
; /Binaries/ThirdParty/*.dll
|
|
||||||
@@ -5,9 +5,6 @@ public class AdvancedSteamSessions : ModuleRules
|
|||||||
{
|
{
|
||||||
public AdvancedSteamSessions(ReadOnlyTargetRules Target) : base(Target)
|
public AdvancedSteamSessions(ReadOnlyTargetRules Target) : base(Target)
|
||||||
{
|
{
|
||||||
DefaultBuildSettings = BuildSettingsVersion.Latest;
|
|
||||||
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
|
|
||||||
|
|
||||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
//bEnforceIWYU = true;
|
//bEnforceIWYU = true;
|
||||||
|
|
||||||
@@ -16,11 +13,10 @@ public class AdvancedSteamSessions : ModuleRules
|
|||||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem", "CoreUObject", "OnlineSubsystemUtils", "Networking", "Sockets", "AdvancedSessions"/*"Voice", "OnlineSubsystemSteam"*/ });
|
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem", "CoreUObject", "OnlineSubsystemUtils", "Networking", "Sockets", "AdvancedSessions"/*"Voice", "OnlineSubsystemSteam"*/ });
|
||||||
PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "Sockets", "Networking", "OnlineSubsystemUtils" /*"Voice", "Steamworks","OnlineSubsystemSteam"*/});
|
PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "Sockets", "Networking", "OnlineSubsystemUtils" /*"Voice", "Steamworks","OnlineSubsystemSteam"*/});
|
||||||
|
|
||||||
if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Linux) || (Target.Platform == UnrealTargetPlatform.Mac))
|
if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Linux) || (Target.Platform == UnrealTargetPlatform.Mac))
|
||||||
{
|
{
|
||||||
PublicDependencyModuleNames.AddRange(new string[] { "SteamShared", "Steamworks", "OnlineSubsystemSteam" });
|
PublicDependencyModuleNames.AddRange(new string[] { "Steamworks",/*"Voice",*/ "OnlineSubsystemSteam" });
|
||||||
AddEngineThirdPartyPrivateStaticDependencies(Target, "Steamworks");
|
PublicIncludePaths.AddRange(new string[] { "../Plugins/Online/OnlineSubsystemSteam/Source/Private" });// This is dumb but it isn't very open
|
||||||
//PublicIncludePaths.AddRange(new string[] { "../Plugins/Online/OnlineSubsystemSteam/Source/Private" });// This is dumb but it isn't very open
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
#pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on....
|
#pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on....
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
#pragma push_macro("ARRAY_COUNT")
|
#pragma push_macro("ARRAY_COUNT")
|
||||||
#undef ARRAY_COUNT
|
#undef ARRAY_COUNT
|
||||||
@@ -194,10 +194,11 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Needed for TMap::GetTypeHash() */
|
||||||
virtual uint32 GetTypeHash() const override
|
friend uint32 GetTypeHash(const FUniqueNetIdSteam2& A)
|
||||||
{
|
{
|
||||||
return ::GetTypeHash(UniqueNetId);
|
return GetTypeHash(A.UniqueNetId);
|
||||||
|
//return (uint32)(A.UniqueNetId) + ((uint32)((A.UniqueNetId) >> 32) * 23);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Convenience cast to CSteamID */
|
/** Convenience cast to CSteamID */
|
||||||
@@ -267,15 +268,12 @@ enum class ESteamUserOverlayType : uint8
|
|||||||
/*Opens the overlay in minimal mode prompting the user to accept an incoming friend invite.*/
|
/*Opens the overlay in minimal mode prompting the user to accept an incoming friend invite.*/
|
||||||
friendrequestaccept,
|
friendrequestaccept,
|
||||||
/*Opens the overlay in minimal mode prompting the user to ignore an incoming friend invite.*/
|
/*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)
|
static FString EnumToString(const FString& enumName, uint8 value)
|
||||||
{
|
{
|
||||||
|
const UEnum* EnumPtr = FindObject<UEnum>(ANY_PACKAGE, *enumName, true);
|
||||||
const UEnum* EnumPtr = FindFirstObject<UEnum>(*enumName, EFindFirstObjectOptions::None, ELogVerbosity::Warning, TEXT("EumtoString"));
|
|
||||||
|
|
||||||
if (!EnumPtr)
|
if (!EnumPtr)
|
||||||
return FString();
|
return FString();
|
||||||
@@ -299,27 +297,14 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||||
FString GroupTag;
|
FString GroupTag;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||||
int32 numOnline = 0;
|
int32 numOnline;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||||
int32 numInGame = 0;
|
int32 numInGame;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||||
int32 numChatting = 0;
|
int32 numChatting;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
UENUM(Blueprintable)
|
|
||||||
enum class EBPTextFilteringContext : uint8
|
|
||||||
{
|
|
||||||
/*Unknown context.*/
|
|
||||||
FContext_Unknown = 0,
|
|
||||||
/*Game content, only legally required filtering is performed.*/
|
|
||||||
FContext_GameContent = 1,
|
|
||||||
/*Char from another player.*/
|
|
||||||
FContext_Chat = 2,
|
|
||||||
/*Character or item name.*/
|
|
||||||
FContext_Name = 3
|
|
||||||
};
|
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class UAdvancedSteamFriendsLibrary : public UBlueprintFunctionLibrary
|
class UAdvancedSteamFriendsLibrary : public UBlueprintFunctionLibrary
|
||||||
{
|
{
|
||||||
@@ -337,12 +322,8 @@ public:
|
|||||||
static bool RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly = false);
|
static bool RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly = false);
|
||||||
|
|
||||||
// Opens the steam overlay to go to the specified user dialog
|
// Opens the steam overlay to go to the specified user dialog
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
||||||
static bool OpenSteamUserOverlay(UObject* WorldContextObject, const FBPUniqueNetId UniqueNetId, ESteamUserOverlayType DialogType);
|
static bool OpenSteamUserOverlay(const FBPUniqueNetId UniqueNetId, ESteamUserOverlayType DialogType);
|
||||||
|
|
||||||
// Returns if the steam overlay is currently active (this can return false during initial overlay hooking)
|
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedFriends|SteamAPI")
|
|
||||||
static bool IsOverlayEnabled();
|
|
||||||
|
|
||||||
// Gets the level of a friends steam account, STEAM ONLY, Returns -1 if the steam level is not known, might need RequestSteamFriendInfo called first.
|
// Gets the level of a friends steam account, STEAM ONLY, Returns -1 if the steam level is not known, might need RequestSteamFriendInfo called first.
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
||||||
@@ -369,21 +350,4 @@ public:
|
|||||||
// Get a full list of steam groups
|
// Get a full list of steam groups
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|SteamAPI|SteamGroups")
|
UFUNCTION(BlueprintCallable, Category = "Online|SteamAPI|SteamGroups")
|
||||||
static void GetSteamGroups(TArray<FBPSteamGroupInfo> & SteamGroups);
|
static void GetSteamGroups(TArray<FBPSteamGroupInfo> & SteamGroups);
|
||||||
|
|
||||||
// Initializes text filtering (pre-loading dictonaries)
|
|
||||||
// Returns if it succeeded, false if filtering is unavailable for the games language
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|SteamAPI|TextFiltering")
|
|
||||||
static bool InitTextFiltering();
|
|
||||||
|
|
||||||
// Attempts to filter a string with the given filtering context
|
|
||||||
// Returns true if the text has been filtered, false if it hasn't (no filtering required or operation failed)
|
|
||||||
// If false it will still output the original text
|
|
||||||
// Textsource is the steam id that is the source of the text (player name / chat)
|
|
||||||
// Requires that InitTextFiltering be called first!!
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|SteamAPI|TextFiltering")
|
|
||||||
static bool FilterText(FString TextToFilter, EBPTextFilteringContext Context, const FBPUniqueNetId TextSourceID, FString& FilteredText);
|
|
||||||
|
|
||||||
// Returns if steam is running in big picture mode
|
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|SteamAPI")
|
|
||||||
static bool IsSteamInBigPictureMode();
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
#include "OnlineSubsystem.h"
|
#include "OnlineSubsystem.h"
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
#include "steam/isteamugc.h"
|
#include "steam/isteamugc.h"
|
||||||
#include "steam/isteamremotestorage.h"
|
#include "steam/isteamremotestorage.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
#pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on....
|
#pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on....
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
#pragma push_macro("ARRAY_COUNT")
|
#pragma push_macro("ARRAY_COUNT")
|
||||||
#undef ARRAY_COUNT
|
#undef ARRAY_COUNT
|
||||||
@@ -223,7 +223,7 @@ public:
|
|||||||
bTagsTruncated = false;
|
bTagsTruncated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
FBPSteamWorkshopItemDetails(SteamUGCDetails_t &hUGCDetails)
|
FBPSteamWorkshopItemDetails(SteamUGCDetails_t &hUGCDetails)
|
||||||
{
|
{
|
||||||
ResultOfRequest = (FBPSteamResult)hUGCDetails.m_eResult;
|
ResultOfRequest = (FBPSteamResult)hUGCDetails.m_eResult;
|
||||||
|
|||||||
@@ -1,101 +0,0 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "Subsystems/GameInstanceSubsystem.h"
|
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
|
||||||
|
|
||||||
#include <steam/steam_api.h>
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "SteamNotificationsSubsystem.generated.h"
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSteamOverlayActivated, bool, bOverlayState);
|
|
||||||
|
|
||||||
UCLASS()
|
|
||||||
class ADVANCEDSTEAMSESSIONS_API USteamNotificationsSubsystem : public UGameInstanceSubsystem
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Event thrown when the steam overlay switches states
|
|
||||||
UPROPERTY(BlueprintAssignable, Category = "SteamEvents")
|
|
||||||
FOnSteamOverlayActivated OnSteamOverlayActivated_Bind;
|
|
||||||
|
|
||||||
USteamNotificationsSubsystem() : Super()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class cSteamEventsStore
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
USteamNotificationsSubsystem* ParentSubsystem = nullptr;
|
|
||||||
void Initialize(USteamNotificationsSubsystem* MyParent)
|
|
||||||
{
|
|
||||||
ParentSubsystem = MyParent;
|
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
|
||||||
OnExternalUITriggeredCallback.Register(this, &USteamNotificationsSubsystem::cSteamEventsStore::OnExternalUITriggered);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void UnInitialize(USteamNotificationsSubsystem* MyParent)
|
|
||||||
{
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
|
||||||
OnExternalUITriggeredCallback.Unregister();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
|
||||||
cSteamEventsStore()
|
|
||||||
{}
|
|
||||||
//:
|
|
||||||
/*OnExternalUITriggeredCallback(this, &cSteamEventsStore::OnExternalUITriggered)
|
|
||||||
{
|
|
||||||
|
|
||||||
}*/
|
|
||||||
#else
|
|
||||||
//cSteamEventsStore()
|
|
||||||
//{
|
|
||||||
|
|
||||||
//}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//~cSteamEventsStore(){}
|
|
||||||
|
|
||||||
private:
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
|
||||||
//STEAM_CALLBACK(cSteamEventsStore, OnExternalUITriggered, GameOverlayActivated_t, OnExternalUITriggeredCallback);
|
|
||||||
STEAM_CALLBACK_MANUAL(cSteamEventsStore, OnExternalUITriggered, GameOverlayActivated_t, OnExternalUITriggeredCallback);
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
cSteamEventsStore MyEvents;
|
|
||||||
|
|
||||||
/** Implement this for initialization of instances of the system */
|
|
||||||
virtual void Initialize(FSubsystemCollectionBase& Collection) override
|
|
||||||
{
|
|
||||||
MyEvents.Initialize(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Implement this for deinitialization of instances of the system */
|
|
||||||
virtual void Deinitialize() override
|
|
||||||
{
|
|
||||||
MyEvents.UnInitialize(this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
|
||||||
void USteamNotificationsSubsystem::cSteamEventsStore::OnExternalUITriggered(GameOverlayActivated_t* CallbackData)
|
|
||||||
{
|
|
||||||
if (ParentSubsystem)
|
|
||||||
{
|
|
||||||
ParentSubsystem->OnSteamOverlayActivated_Bind.Broadcast((bool)CallbackData->m_bActive);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -15,9 +15,9 @@
|
|||||||
#pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on....
|
#pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on....
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
//#include "OnlineSubsystemSteam.h"
|
#include "OnlineSubsystemSteam.h"
|
||||||
|
|
||||||
#pragma push_macro("ARRAY_COUNT")
|
#pragma push_macro("ARRAY_COUNT")
|
||||||
#undef ARRAY_COUNT
|
#undef ARRAY_COUNT
|
||||||
@@ -55,7 +55,7 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||||
FBPUniqueNetId OfficerUniqueNetID; // Uint64 representation
|
FBPUniqueNetId OfficerUniqueNetID; // Uint64 representation
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||||
bool bIsOwner = false;
|
bool bIsOwner;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ class USteamRequestGroupOfficersCallbackProxy : public UOnlineBlueprintCallProxy
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
void OnRequestGroupOfficerDetails( ClanOfficerListResponse_t *pResult, bool bIOFailure);
|
void OnRequestGroupOfficerDetails( ClanOfficerListResponse_t *pResult, bool bIOFailure);
|
||||||
CCallResult<USteamRequestGroupOfficersCallbackProxy, ClanOfficerListResponse_t> m_callResultGroupOfficerRequestDetails;
|
CCallResult<USteamRequestGroupOfficersCallbackProxy, ClanOfficerListResponse_t> m_callResultGroupOfficerRequestDetails;
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
#pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on....
|
#pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on....
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
//#include "OnlineSubsystemSteam.h"
|
#include "OnlineSubsystemSteam.h"
|
||||||
|
|
||||||
#pragma push_macro("ARRAY_COUNT")
|
#pragma push_macro("ARRAY_COUNT")
|
||||||
#undef ARRAY_COUNT
|
#undef ARRAY_COUNT
|
||||||
@@ -72,7 +72,7 @@ class USteamWSRequestUGCDetailsCallbackProxy : public UOnlineBlueprintCallProxyB
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
// Internal callback when the operation completes, calls out to the public success/failure callbacks
|
// Internal callback when the operation completes, calls out to the public success/failure callbacks
|
||||||
|
|
||||||
void OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure);
|
void OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure);
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
#include "AdvancedSteamFriendsLibrary.h"
|
#include "AdvancedSteamFriendsLibrary.h"
|
||||||
#include "OnlineSubSystemHeader.h"
|
#include "OnlineSubSystemHeader.h"
|
||||||
#include "OnlineSubsystemTypes.h"
|
|
||||||
#include "Engine/Texture.h"
|
|
||||||
#include "Engine/Texture2D.h"
|
|
||||||
#include "TextureResource.h"
|
|
||||||
#include "PixelFormat.h"
|
|
||||||
|
|
||||||
//General Log
|
//General Log
|
||||||
DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
|
DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
|
||||||
@@ -15,7 +10,7 @@ DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
|
|||||||
/*int32 UAdvancedSteamFriendsLibrary::GetFriendSteamLevel(const FBPUniqueNetId UniqueNetId)
|
/*int32 UAdvancedSteamFriendsLibrary::GetFriendSteamLevel(const FBPUniqueNetId UniqueNetId)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
|
||||||
@@ -64,7 +59,7 @@ DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
|
|||||||
void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray<FBPSteamGroupInfo> & SteamGroups)
|
void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray<FBPSteamGroupInfo> & SteamGroups)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
@@ -95,7 +90,7 @@ void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray<FBPSteamGroupInfo> & St
|
|||||||
void UAdvancedSteamFriendsLibrary::GetSteamFriendGamePlayed(const FBPUniqueNetId UniqueNetId, EBlueprintResultSwitch &Result/*, FString & GameName*/, int32 & AppID)
|
void UAdvancedSteamFriendsLibrary::GetSteamFriendGamePlayed(const FBPUniqueNetId UniqueNetId, EBlueprintResultSwitch &Result/*, FString & GameName*/, int32 & AppID)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendGamePlayed Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendGamePlayed Had a bad UniqueNetId!"));
|
||||||
@@ -137,7 +132,7 @@ void UAdvancedSteamFriendsLibrary::GetSteamFriendGamePlayed(const FBPUniqueNetId
|
|||||||
int32 UAdvancedSteamFriendsLibrary::GetFriendSteamLevel(const FBPUniqueNetId UniqueNetId)
|
int32 UAdvancedSteamFriendsLibrary::GetFriendSteamLevel(const FBPUniqueNetId UniqueNetId)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
|
||||||
@@ -158,7 +153,7 @@ int32 UAdvancedSteamFriendsLibrary::GetFriendSteamLevel(const FBPUniqueNetId Uni
|
|||||||
FString UAdvancedSteamFriendsLibrary::GetSteamPersonaName(const FBPUniqueNetId UniqueNetId)
|
FString UAdvancedSteamFriendsLibrary::GetSteamPersonaName(const FBPUniqueNetId UniqueNetId)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamPersonaName Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamPersonaName Had a bad UniqueNetId!"));
|
||||||
@@ -180,7 +175,7 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FStri
|
|||||||
{
|
{
|
||||||
FBPUniqueNetId netId;
|
FBPUniqueNetId netId;
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!(SteamID64.Len() > 0))
|
if (!(SteamID64.Len() > 0))
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("CreateSteamIDFromString Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("CreateSteamIDFromString Had a bad UniqueNetId!"));
|
||||||
@@ -205,7 +200,7 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::GetLocalSteamIDFromSteam()
|
|||||||
{
|
{
|
||||||
FBPUniqueNetId netId;
|
FBPUniqueNetId netId;
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
TSharedPtr<const FUniqueNetId> SteamID(new const FUniqueNetIdSteam2(SteamUser()->GetSteamID()));
|
TSharedPtr<const FUniqueNetId> SteamID(new const FUniqueNetIdSteam2(SteamUser()->GetSteamID()));
|
||||||
@@ -218,7 +213,7 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::GetLocalSteamIDFromSteam()
|
|||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly)
|
bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly)
|
||||||
{
|
{
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("RequestSteamFriendInfo Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("RequestSteamFriendInfo Had a bad UniqueNetId!"));
|
||||||
@@ -238,9 +233,9 @@ bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId U
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::OpenSteamUserOverlay(UObject* WorldContextObject,const FBPUniqueNetId UniqueNetId, ESteamUserOverlayType DialogType)
|
bool UAdvancedSteamFriendsLibrary::OpenSteamUserOverlay(const FBPUniqueNetId UniqueNetId, ESteamUserOverlayType DialogType)
|
||||||
{
|
{
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("OpenSteamUserOverlay Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("OpenSteamUserOverlay Had a bad UniqueNetId!"));
|
||||||
@@ -248,28 +243,10 @@ bool UAdvancedSteamFriendsLibrary::OpenSteamUserOverlay(UObject* WorldContextObj
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
|
||||||
if (DialogType == ESteamUserOverlayType::invitetolobby)
|
|
||||||
{
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
|
||||||
if (SessionInterface.IsValid())
|
|
||||||
{
|
|
||||||
FNamedOnlineSession* CurrentSession = SessionInterface->GetNamedSession(NAME_GameSession);
|
|
||||||
|
|
||||||
if (CurrentSession && CurrentSession->SessionInfo->GetSessionId().IsValid())
|
|
||||||
{
|
|
||||||
uint64 id = *((uint64*)CurrentSession->SessionInfo->GetSessionId().GetBytes());
|
|
||||||
SteamFriends()->ActivateGameOverlayInviteDialog(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
uint64 id = *((uint64*)UniqueNetId.UniqueNetId->GetBytes());
|
uint64 id = *((uint64*)UniqueNetId.UniqueNetId->GetBytes());
|
||||||
FString DialogName = EnumToString("ESteamUserOverlayType", (uint8)DialogType);
|
FString DialogName = EnumToString("ESteamUserOverlayType", (uint8)DialogType);
|
||||||
SteamFriends()->ActivateGameOverlayToUser(TCHAR_TO_ANSI(*DialogName), id);
|
SteamFriends()->ActivateGameOverlayToUser(TCHAR_TO_ANSI(*DialogName), id);
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -278,22 +255,9 @@ bool UAdvancedSteamFriendsLibrary::OpenSteamUserOverlay(UObject* WorldContextObj
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::IsOverlayEnabled()
|
|
||||||
{
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
|
||||||
if (SteamAPI_Init())
|
|
||||||
{
|
|
||||||
return SteamUtils()->IsOverlayEnabled();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("OpenSteamUserOverlay Couldn't init steamAPI!"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueNetId UniqueNetId, EBlueprintAsyncResultSwitch &Result, SteamAvatarSize AvatarSize)
|
UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueNetId UniqueNetId, EBlueprintAsyncResultSwitch &Result, SteamAvatarSize AvatarSize)
|
||||||
{
|
{
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendAvatar Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendAvatar Had a bad UniqueNetId!"));
|
||||||
@@ -355,21 +319,18 @@ UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueN
|
|||||||
|
|
||||||
UTexture2D* Avatar = UTexture2D::CreateTransient(Width, Height, PF_R8G8B8A8);
|
UTexture2D* Avatar = UTexture2D::CreateTransient(Width, Height, PF_R8G8B8A8);
|
||||||
// Switched to a Memcpy instead of byte by byte transer
|
// Switched to a Memcpy instead of byte by byte transer
|
||||||
|
uint8* MipData = (uint8*)Avatar->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE);
|
||||||
if (FTexturePlatformData* PlatformData = Avatar->GetPlatformData())
|
|
||||||
{
|
|
||||||
uint8* MipData = (uint8*)PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE);
|
|
||||||
FMemory::Memcpy(MipData, (void*)oAvatarRGBA, Height * Width * 4);
|
FMemory::Memcpy(MipData, (void*)oAvatarRGBA, Height * Width * 4);
|
||||||
PlatformData->Mips[0].BulkData.Unlock();
|
Avatar->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
|
//Setting some Parameters for the Texture and finally returning it
|
||||||
PlatformData->SetNumSlices(1);
|
Avatar->PlatformData->SetNumSlices(1);
|
||||||
Avatar->NeverStream = true;
|
Avatar->NeverStream = true;
|
||||||
//Avatar->CompressionSettings = TC_EditorIcon;
|
//Avatar->CompressionSettings = TC_EditorIcon;
|
||||||
}
|
|
||||||
|
|
||||||
// Free RGBA buffer regardless of whether it was used or not
|
|
||||||
delete[] oAvatarRGBA;
|
|
||||||
|
|
||||||
Avatar->UpdateResource();
|
Avatar->UpdateResource();
|
||||||
|
|
||||||
@@ -390,65 +351,3 @@ UTexture2D * UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(const FBPUniqueN
|
|||||||
Result = EBlueprintAsyncResultSwitch::OnFailure;
|
Result = EBlueprintAsyncResultSwitch::OnFailure;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::InitTextFiltering()
|
|
||||||
{
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
|
||||||
{
|
|
||||||
return SteamUtils()->InitFilterText();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::FilterText(FString TextToFilter, EBPTextFilteringContext Context, const FBPUniqueNetId TextSourceID, FString& FilteredText)
|
|
||||||
{
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
|
||||||
{
|
|
||||||
uint32 BufferLen = TextToFilter.Len() + 10; // Docs say 1 byte excess min, going with 10
|
|
||||||
char* OutText = new char[BufferLen];
|
|
||||||
|
|
||||||
uint64 id = 0;
|
|
||||||
|
|
||||||
if (TextSourceID.IsValid())
|
|
||||||
{
|
|
||||||
id = *((uint64*)TextSourceID.UniqueNetId->GetBytes());
|
|
||||||
}
|
|
||||||
|
|
||||||
int FilterCount = SteamUtils()->FilterText((ETextFilteringContext)Context, id, TCHAR_TO_ANSI(*TextToFilter), OutText, BufferLen);
|
|
||||||
|
|
||||||
if (FilterCount > 0)
|
|
||||||
{
|
|
||||||
FilteredText = FString(UTF8_TO_TCHAR(OutText));
|
|
||||||
delete[] OutText;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete[] OutText;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FilteredText = TextToFilter;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::IsSteamInBigPictureMode()
|
|
||||||
{
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
|
||||||
{
|
|
||||||
return SteamUtils()->IsSteamInBigPictureMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@@ -8,7 +8,7 @@ DEFINE_LOG_CATEGORY(AdvancedSteamWorkshopLog);
|
|||||||
void UAdvancedSteamWorkshopLibrary::GetNumSubscribedWorkshopItems(int32 & NumberOfItems)
|
void UAdvancedSteamWorkshopLibrary::GetNumSubscribedWorkshopItems(int32 & NumberOfItems)
|
||||||
{
|
{
|
||||||
NumberOfItems = 0;
|
NumberOfItems = 0;
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
@@ -20,10 +20,10 @@ void UAdvancedSteamWorkshopLibrary::GetNumSubscribedWorkshopItems(int32 & Number
|
|||||||
UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetNumSubscribedWorkshopItemCount : SteamAPI is not Inited!"));
|
UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetNumSubscribedWorkshopItemCount : SteamAPI is not Inited!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetNumSubscribedWorkshopItemCount : Called on an incompatible platform"));
|
UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetNumSubscribedWorkshopItemCount : Called on an incompatible platform"));
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<FBPSteamWorkshopID> UAdvancedSteamWorkshopLibrary::GetSubscribedWorkshopItems(int32 & NumberOfItems)
|
TArray<FBPSteamWorkshopID> UAdvancedSteamWorkshopLibrary::GetSubscribedWorkshopItems(int32 & NumberOfItems)
|
||||||
@@ -31,7 +31,7 @@ TArray<FBPSteamWorkshopID> UAdvancedSteamWorkshopLibrary::GetSubscribedWorkshopI
|
|||||||
TArray<FBPSteamWorkshopID> outArray;
|
TArray<FBPSteamWorkshopID> outArray;
|
||||||
NumberOfItems = 0;
|
NumberOfItems = 0;
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
@@ -62,8 +62,8 @@ TArray<FBPSteamWorkshopID> UAdvancedSteamWorkshopLibrary::GetSubscribedWorkshopI
|
|||||||
UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetSubscribedWorkshopItemCount : SteamAPI is not Inited!"));
|
UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetSubscribedWorkshopItemCount : SteamAPI is not Inited!"));
|
||||||
return outArray;
|
return outArray;
|
||||||
}
|
}
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetSubscribedWorkshopItemCount : Called on an incompatible platform"));
|
UE_LOG(AdvancedSteamWorkshopLog, Warning, TEXT("Error in GetSubscribedWorkshopItemCount : Called on an incompatible platform"));
|
||||||
return outArray;
|
return outArray;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
|
|
||||||
#include "SteamRequestGroupOfficersCallbackProxy.h"
|
#include "SteamRequestGroupOfficersCallbackProxy.h"
|
||||||
#include "Online/CoreOnline.h"
|
#include "UObject/CoreOnline.h"
|
||||||
#include "AdvancedSteamFriendsLibrary.h"
|
#include "AdvancedSteamFriendsLibrary.h"
|
||||||
#include "OnlineSubSystemHeader.h"
|
#include "OnlineSubSystemHeader.h"
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
#include "steam/isteamfriends.h"
|
#include "steam/isteamfriends.h"
|
||||||
#endif
|
#endif
|
||||||
//#include "OnlineSubsystemSteamTypes.h"
|
//#include "OnlineSubsystemSteamTypes.h"
|
||||||
@@ -31,7 +31,7 @@ USteamRequestGroupOfficersCallbackProxy* USteamRequestGroupOfficersCallbackProxy
|
|||||||
|
|
||||||
void USteamRequestGroupOfficersCallbackProxy::Activate()
|
void USteamRequestGroupOfficersCallbackProxy::Activate()
|
||||||
{
|
{
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes());
|
uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes());
|
||||||
@@ -45,22 +45,22 @@ void USteamRequestGroupOfficersCallbackProxy::Activate()
|
|||||||
OnFailure.Broadcast(EmptyArray);
|
OnFailure.Broadcast(EmptyArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanOfficerListResponse_t *pResult, bool bIOFailure)
|
void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanOfficerListResponse_t *pResult, bool bIOFailure)
|
||||||
{
|
{
|
||||||
TArray<FBPSteamGroupOfficer> OfficerArray;
|
TArray<FBPSteamGroupOfficer> OfficerArray;
|
||||||
|
|
||||||
//FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
||||||
|
|
||||||
if (bIOFailure || !pResult || !pResult->m_bSuccess)
|
if (bIOFailure || !pResult || !pResult->m_bSuccess)
|
||||||
{
|
{
|
||||||
//if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
|
{
|
||||||
|
SteamSubsystem->ExecuteNextTick([this]()
|
||||||
{
|
{
|
||||||
// SteamSubsystem->ExecuteNextTick([this]()
|
|
||||||
//{
|
|
||||||
TArray<FBPSteamGroupOfficer> FailureArray;
|
TArray<FBPSteamGroupOfficer> FailureArray;
|
||||||
OnFailure.Broadcast(FailureArray);
|
OnFailure.Broadcast(FailureArray);
|
||||||
//});
|
});
|
||||||
}
|
}
|
||||||
//OnFailure.Broadcast(OfficerArray);
|
//OnFailure.Broadcast(OfficerArray);
|
||||||
return;
|
return;
|
||||||
@@ -91,26 +91,26 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
|
|||||||
OfficerArray.Add(Officer);
|
OfficerArray.Add(Officer);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
//{
|
{
|
||||||
//SteamSubsystem->ExecuteNextTick([OfficerArray, this]()
|
SteamSubsystem->ExecuteNextTick([OfficerArray, this]()
|
||||||
//{
|
{
|
||||||
OnSuccess.Broadcast(OfficerArray);
|
OnSuccess.Broadcast(OfficerArray);
|
||||||
//});
|
});
|
||||||
//}
|
}
|
||||||
|
|
||||||
//OnSuccess.Broadcast(OfficerArray);
|
//OnSuccess.Broadcast(OfficerArray);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
|
{
|
||||||
|
SteamSubsystem->ExecuteNextTick([this]()
|
||||||
{
|
{
|
||||||
//SteamSubsystem->ExecuteNextTick([this]()
|
|
||||||
//{
|
|
||||||
TArray<FBPSteamGroupOfficer> FailureArray;
|
TArray<FBPSteamGroupOfficer> FailureArray;
|
||||||
OnFailure.Broadcast(FailureArray);
|
OnFailure.Broadcast(FailureArray);
|
||||||
//});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "SteamWSRequestUGCDetailsCallbackProxy.h"
|
#include "SteamWSRequestUGCDetailsCallbackProxy.h"
|
||||||
#include "OnlineSubSystemHeader.h"
|
#include "OnlineSubSystemHeader.h"
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
#include "steam/isteamugc.h"
|
#include "steam/isteamugc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ USteamWSRequestUGCDetailsCallbackProxy* USteamWSRequestUGCDetailsCallbackProxy::
|
|||||||
|
|
||||||
void USteamWSRequestUGCDetailsCallbackProxy::Activate()
|
void USteamWSRequestUGCDetailsCallbackProxy::Activate()
|
||||||
{
|
{
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
// #TODO: Support arrays instead in the future?
|
// #TODO: Support arrays instead in the future?
|
||||||
@@ -49,19 +49,19 @@ void USteamWSRequestUGCDetailsCallbackProxy::Activate()
|
|||||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure)
|
void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure)
|
||||||
{
|
{
|
||||||
//FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
||||||
|
|
||||||
if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0)
|
if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0)
|
||||||
{
|
{
|
||||||
//if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
|
{
|
||||||
|
SteamSubsystem->ExecuteNextTick([this]()
|
||||||
{
|
{
|
||||||
// SteamSubsystem->ExecuteNextTick([this]()
|
|
||||||
//{
|
|
||||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
//});
|
});
|
||||||
}
|
}
|
||||||
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
return;
|
return;
|
||||||
@@ -71,12 +71,12 @@ void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQuer
|
|||||||
SteamUGCDetails_t Details;
|
SteamUGCDetails_t Details;
|
||||||
if (SteamUGC()->GetQueryUGCResult(pResult->m_handle, 0, &Details))
|
if (SteamUGC()->GetQueryUGCResult(pResult->m_handle, 0, &Details))
|
||||||
{
|
{
|
||||||
//if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
|
{
|
||||||
|
SteamSubsystem->ExecuteNextTick([Details, this]()
|
||||||
{
|
{
|
||||||
//SteamSubsystem->ExecuteNextTick([Details, this]()
|
|
||||||
//{
|
|
||||||
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||||
//});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
//OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||||
@@ -85,12 +85,12 @@ void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQuer
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//if (SteamSubsystem != nullptr)
|
if (SteamSubsystem != nullptr)
|
||||||
|
{
|
||||||
|
SteamSubsystem->ExecuteNextTick([this]()
|
||||||
{
|
{
|
||||||
//SteamSubsystem->ExecuteNextTick([this]()
|
|
||||||
//{
|
|
||||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
//});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
**KantanDocGen Automatic Documentation ([KantanDocGen](http://kantandev.com/free/kantan-doc-gen))**
|
**KantanDocGen Automatic Documentation ([KantanDocGen](http://kantandev.com/free/kantan-doc-gen))**
|
||||||
|
|
||||||
**[AdvancedSessions](https://vreue4.com/generated-node-documentation?section=advanced-sessions-plugin)**
|
**[AdvancedSessions](https://mordentral.bitbucket.io/AdvancedSessions/Advanced)**
|
||||||
|
|
||||||
**[AdvancedSteamSessions](https://vreue4.com/generated-node-documentation?section=advanced-steam-sessions-plugin)**
|
**[AdvancedSteamSessions](https://mordentral.bitbucket.io/AdvancedSteamSessions/Advanced)**
|
||||||
|
|||||||
Reference in New Issue
Block a user