mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-26 18:04:07 +00:00
Compare commits
1 Commits
4.23_Locke
...
4.16_Locke
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c3e3b143b |
@@ -2,8 +2,8 @@
|
|||||||
"FileVersion" : 3,
|
"FileVersion" : 3,
|
||||||
|
|
||||||
"FriendlyName" : "Advanced Sessions",
|
"FriendlyName" : "Advanced Sessions",
|
||||||
"Version" : 4.23,
|
"Version" : 1.9,
|
||||||
"VersionName": "4.23",
|
"VersionName": "1.9",
|
||||||
"Description" : "Adds new blueprint functions to handle more advanced session operations.",
|
"Description" : "Adds new blueprint functions to handle more advanced session operations.",
|
||||||
"Category" : "Advanced Sessions Plugin",
|
"Category" : "Advanced Sessions Plugin",
|
||||||
"CreatedBy" : "Joshua Statzer",
|
"CreatedBy" : "Joshua Statzer",
|
||||||
@@ -16,15 +16,5 @@
|
|||||||
"Type" : "RunTime",
|
"Type" : "RunTime",
|
||||||
"LoadingPhase" : "PreDefault"
|
"LoadingPhase" : "PreDefault"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"Plugins": [
|
|
||||||
{
|
|
||||||
"Name": "OnlineSubsystem",
|
|
||||||
"Enabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "OnlineSubsystemUtils",
|
|
||||||
"Enabled": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -8,10 +8,10 @@ public class AdvancedSessions : ModuleRules
|
|||||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
//bEnforceIWYU = true;
|
//bEnforceIWYU = true;
|
||||||
|
|
||||||
PublicDefinitions.Add("WITH_ADVANCED_SESSIONS=1");
|
Definitions.Add("WITH_ADVANCED_SESSIONS=1");
|
||||||
|
|
||||||
// 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"*/});
|
PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "Sockets", "Networking", "OnlineSubsystemUtils" /*"Voice", "Steamworks","OnlineSubsystemSteam"*/});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
//#include "OnlineMessageInterface.h"
|
//#include "OnlineMessageInterface.h"
|
||||||
//#include "OnlinePresenceInterface.h"
|
//#include "OnlinePresenceInterface.h"
|
||||||
//#include "Engine/GameInstance.h"
|
//#include "Engine/GameInstance.h"
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "OnlineSessionInterface.h"
|
||||||
|
|
||||||
//#include "UObjectIterator.h"
|
//#include "UObjectIterator.h"
|
||||||
|
|
||||||
|
|||||||
@@ -2,20 +2,19 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
#include "OnlineSubsystem.h"
|
#include "OnlineSubsystem.h"
|
||||||
#include "Interfaces/OnlineFriendsInterface.h"
|
#include "OnlineFriendsInterface.h"
|
||||||
#include "Interfaces/OnlineUserInterface.h"
|
#include "OnlineUserInterface.h"
|
||||||
#include "Interfaces/OnlineMessageInterface.h"
|
#include "OnlineMessageInterface.h"
|
||||||
#include "Interfaces/OnlinePresenceInterface.h"
|
#include "OnlinePresenceInterface.h"
|
||||||
#include "Engine/GameInstance.h"
|
#include "Engine/GameInstance.h"
|
||||||
#include "Engine/LocalPlayer.h"
|
#include "Engine/LocalPlayer.h"
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "OnlineSessionInterface.h"
|
||||||
#include "OnlineSessionSettings.h"
|
#include "OnlineSessionSettings.h"
|
||||||
#include "UObject/UObjectIterator.h"
|
#include "UObjectIterator.h"
|
||||||
#include "AdvancedFriendsInterface.h"
|
#include "AdvancedFriendsInterface.h"
|
||||||
|
|
||||||
#include "AdvancedFriendsGameInstance.generated.h"
|
#include "AdvancedFriendsGameInstance.generated.h"
|
||||||
@@ -66,7 +65,6 @@ public:
|
|||||||
void OnSessionInviteAcceptedMaster(const bool bWasSuccessful, int32 LocalPlayer, TSharedPtr<const FUniqueNetId> PersonInviting, const FOnlineSessionSearchResult& SessionToJoin);
|
void OnSessionInviteAcceptedMaster(const bool bWasSuccessful, int32 LocalPlayer, TSharedPtr<const FUniqueNetId> PersonInviting, const FOnlineSessionSearchResult& SessionToJoin);
|
||||||
|
|
||||||
// After a session invite has been accepted by the local player this event is triggered, call JoinSession on the session result to join it
|
// After a session invite has been accepted by the local player this event is triggered, call JoinSession on the session result to join it
|
||||||
// This function is currently not hooked up in any of Epics default subsystems, it is here for custom subsystems
|
|
||||||
UFUNCTION(BlueprintImplementableEvent, Category = "AdvancedFriends")
|
UFUNCTION(BlueprintImplementableEvent, Category = "AdvancedFriends")
|
||||||
void OnSessionInviteAccepted(int32 LocalPlayerNum, FBPUniqueNetId PersonInvited, const FBlueprintSessionResult& SessionToJoin);
|
void OnSessionInviteAccepted(int32 LocalPlayerNum, FBPUniqueNetId PersonInvited, const FBlueprintSessionResult& SessionToJoin);
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
#include "OnlineSubsystem.h"
|
#include "OnlineSubsystem.h"
|
||||||
#include "Interfaces/OnlineFriendsInterface.h"
|
#include "OnlineFriendsInterface.h"
|
||||||
#include "Interfaces/OnlineUserInterface.h"
|
#include "OnlineUserInterface.h"
|
||||||
#include "Interfaces/OnlineMessageInterface.h"
|
#include "OnlineMessageInterface.h"
|
||||||
#include "Interfaces/OnlinePresenceInterface.h"
|
#include "OnlinePresenceInterface.h"
|
||||||
#include "Engine/GameInstance.h"
|
#include "Engine/GameInstance.h"
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "OnlineSessionInterface.h"
|
||||||
#include "OnlineSessionSettings.h"
|
#include "OnlineSessionSettings.h"
|
||||||
#include "UObject/UObjectIterator.h"
|
#include "UObjectIterator.h"
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "AdvancedFriendsInterface.generated.h"
|
#include "AdvancedFriendsInterface.generated.h"
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
#include "Engine/LocalPlayer.h"
|
#include "Engine/LocalPlayer.h"
|
||||||
#include "OnlineSubsystem.h"
|
#include "OnlineSubsystem.h"
|
||||||
#include "Interfaces/OnlineFriendsInterface.h"
|
#include "OnlineFriendsInterface.h"
|
||||||
#include "Interfaces/OnlineUserInterface.h"
|
#include "OnlineUserInterface.h"
|
||||||
#include "Interfaces/OnlineMessageInterface.h"
|
#include "OnlineMessageInterface.h"
|
||||||
#include "Interfaces/OnlinePresenceInterface.h"
|
#include "OnlinePresenceInterface.h"
|
||||||
#include "Engine/GameInstance.h"
|
#include "Engine/GameInstance.h"
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "OnlineSessionInterface.h"
|
||||||
|
|
||||||
#include "UObject/UObjectIterator.h"
|
#include "UObjectIterator.h"
|
||||||
|
|
||||||
#include "AdvancedFriendsLibrary.generated.h"
|
#include "AdvancedFriendsLibrary.generated.h"
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,13 @@
|
|||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
#include "OnlineSubsystem.h"
|
#include "OnlineSubsystem.h"
|
||||||
#include "Interfaces/OnlineIdentityInterface.h"
|
#include "OnlineIdentityInterface.h"
|
||||||
#include "Interfaces/OnlineUserInterface.h"
|
#include "OnlineUserInterface.h"
|
||||||
#include "Interfaces/OnlinePresenceInterface.h"
|
#include "OnlinePresenceInterface.h"
|
||||||
#include "Engine/GameInstance.h"
|
#include "Engine/GameInstance.h"
|
||||||
#include "Engine/LocalPlayer.h"
|
#include "Engine/LocalPlayer.h"
|
||||||
|
|
||||||
#include "UObject/UObjectIterator.h"
|
#include "UObjectIterator.h"
|
||||||
|
|
||||||
#include "AdvancedIdentityLibrary.generated.h"
|
#include "AdvancedIdentityLibrary.generated.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Modules/ModuleManager.h"
|
#include "ModuleManager.h"
|
||||||
|
|
||||||
class AdvancedSessions : public IModuleInterface
|
class AdvancedSessions : public IModuleInterface
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,19 +2,18 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
#include "OnlineSubsystem.h"
|
#include "OnlineSubsystem.h"
|
||||||
#include "Interfaces/OnlineFriendsInterface.h"
|
#include "OnlineFriendsInterface.h"
|
||||||
#include "Interfaces/OnlineUserInterface.h"
|
#include "OnlineUserInterface.h"
|
||||||
#include "Interfaces/OnlineMessageInterface.h"
|
#include "OnlineMessageInterface.h"
|
||||||
#include "Interfaces/OnlinePresenceInterface.h"
|
#include "OnlinePresenceInterface.h"
|
||||||
#include "Engine/GameInstance.h"
|
#include "Engine/GameInstance.h"
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "OnlineSessionInterface.h"
|
||||||
|
|
||||||
//#include "UObjectIterator.h"
|
#include "UObjectIterator.h"
|
||||||
|
|
||||||
#include "AdvancedSessionsLibrary.generated.h"
|
#include "AdvancedSessionsLibrary.generated.h"
|
||||||
|
|
||||||
@@ -39,16 +38,16 @@ public:
|
|||||||
static void GetExtraSettings(FBlueprintSessionResult SessionResult, TArray<FSessionPropertyKeyPair> & ExtraSettings);
|
static void GetExtraSettings(FBlueprintSessionResult SessionResult, TArray<FSessionPropertyKeyPair> & ExtraSettings);
|
||||||
|
|
||||||
// Get the current session state
|
// Get the current session state
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo")
|
||||||
static void GetSessionState(UObject* WorldContextObject, EBPOnlineSessionState &SessionState);
|
static void GetSessionState(EBPOnlineSessionState &SessionState);
|
||||||
|
|
||||||
// Get the current session settings
|
// Get the current session settings
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "Result"))
|
||||||
static void GetSessionSettings(UObject* WorldContextObject, int32 &NumConnections, int32 &NumPrivateConnections, bool &bIsLAN, bool &bIsDedicated, bool &bAllowInvites, bool &bAllowJoinInProgress, bool &bIsAnticheatEnabled, int32 &BuildUniqueID, TArray<FSessionPropertyKeyPair> &ExtraSettings, EBlueprintResultSwitch &Result);
|
static void GetSessionSettings(int32 &NumConnections, int32 &NumPrivateConnections, bool &bIsLAN, bool &bIsDedicated, bool &bAllowInvites, bool &bAllowJoinInProgress, bool &bIsAnticheatEnabled, int32 &BuildUniqueID, TArray<FSessionPropertyKeyPair> &ExtraSettings, EBlueprintResultSwitch &Result);
|
||||||
|
|
||||||
// Check if someone is in the current session
|
// Check if someone is in the current session
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo")
|
||||||
static void IsPlayerInSession(UObject* WorldContextObject, const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession);
|
static void IsPlayerInSession(const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession);
|
||||||
|
|
||||||
// Make a literal session search parameter
|
// Make a literal session search parameter
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo|Literals")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo|Literals")
|
||||||
@@ -61,14 +60,6 @@ public:
|
|||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
||||||
static bool IsValidSession(const FBlueprintSessionResult & SessionResult);
|
static bool IsValidSession(const FBlueprintSessionResult & SessionResult);
|
||||||
|
|
||||||
// Get a string copy of a session ID
|
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
|
||||||
static void GetSessionID_AsString(const FBlueprintSessionResult & SessionResult, FString& SessionID);
|
|
||||||
|
|
||||||
// Get a string copy of the current session ID
|
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo", meta = (WorldContext = "WorldContextObject"))
|
|
||||||
static void GetCurrentSessionID_AsString(UObject* WorldContextObject, FString& SessionID);
|
|
||||||
|
|
||||||
// Get the Unique Current Build ID
|
// Get the Unique Current Build ID
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
||||||
static void GetCurrentUniqueBuildID(int32 &UniqueBuildId);
|
static void GetCurrentUniqueBuildID(int32 &UniqueBuildId);
|
||||||
@@ -76,25 +67,6 @@ public:
|
|||||||
// Get the Unique Build ID from a session search result
|
// Get the Unique Build ID from a session search result
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
||||||
static void GetUniqueBuildID(FBlueprintSessionResult SessionResult, int32 &UniqueBuildId);
|
static void GetUniqueBuildID(FBlueprintSessionResult SessionResult, int32 &UniqueBuildId);
|
||||||
|
|
||||||
|
|
||||||
// Thanks CriErr for submission
|
|
||||||
|
|
||||||
|
|
||||||
// Get session property Key Name value
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo")
|
|
||||||
static FName GetSessionPropertyKey(const FSessionPropertyKeyPair& SessionProperty);
|
|
||||||
|
|
||||||
// Find session property by Name
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "Result"))
|
|
||||||
static void FindSessionPropertyByName(const TArray<FSessionPropertyKeyPair>& ExtraSettings, FName SettingsName, EBlueprintResultSwitch &Result, FSessionPropertyKeyPair& OutProperty);
|
|
||||||
|
|
||||||
// Find session property index by Name
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "Result"))
|
|
||||||
static void FindSessionPropertyIndexByName(const TArray<FSessionPropertyKeyPair>& ExtraSettings, FName SettingName, EBlueprintResultSwitch &Result, int32& OutIndex);
|
|
||||||
|
|
||||||
/// Removed the Index_None part of the last function, that isn't accessible in blueprint, better to return success/failure
|
|
||||||
// End Thanks CriErr :p
|
|
||||||
|
|
||||||
// Get session custom information key/value as Byte (For Enums)
|
// Get session custom information key/value as Byte (For Enums)
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "SearchResult"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "SearchResult"))
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
#include "OnlineSubsystem.h"
|
#include "OnlineSubsystem.h"
|
||||||
#include "Interfaces/VoiceInterface.h"
|
#include "VoiceInterface.h"
|
||||||
//#include "OnlineFriendsInterface.h"
|
//#include "OnlineFriendsInterface.h"
|
||||||
//#include "OnlineUserInterface.h"
|
//#include "OnlineUserInterface.h"
|
||||||
//#include "OnlineMessageInterface.h"
|
//#include "OnlineMessageInterface.h"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "Engine/GameInstance.h"
|
#include "Engine/GameInstance.h"
|
||||||
//#include "OnlineSessionInterface.h"
|
//#include "OnlineSessionInterface.h"
|
||||||
|
|
||||||
#include "UObject/UObjectIterator.h"
|
#include "UObjectIterator.h"
|
||||||
|
|
||||||
#include "AdvancedVoiceLibrary.generated.h"
|
#include "AdvancedVoiceLibrary.generated.h"
|
||||||
|
|
||||||
@@ -48,7 +48,6 @@ public:
|
|||||||
static bool RegisterLocalTalker(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
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static void RegisterAllLocalTalkers();
|
static void RegisterAllLocalTalkers();
|
||||||
|
|
||||||
@@ -61,7 +60,6 @@ public:
|
|||||||
static void UnRegisterAllLocalTalkers();
|
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
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedVoice")
|
||||||
static bool RegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId);
|
static bool RegisterRemoteTalker(const FBPUniqueNetId& UniqueNetId);
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
//#include "EngineMinimal.h"
|
#include "EngineMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
#include "Engine/Engine.h"
|
||||||
#include "GameFramework/PlayerState.h"
|
#include "GameFramework/PlayerState.h"
|
||||||
//#include "Core.h"
|
#include "Core.h"
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "OnlineSessionInterface.h"
|
||||||
#include "OnlineSessionSettings.h"
|
#include "OnlineSessionSettings.h"
|
||||||
#include "OnlineDelegateMacros.h"
|
#include "OnlineDelegateMacros.h"
|
||||||
#include "OnlineSubsystem.h"
|
#include "OnlineSubsystem.h"
|
||||||
#include "OnlineSubsystemImpl.h"
|
#include "OnlineSubsystemImpl.h"
|
||||||
#include "OnlineSubsystemUtils.h"
|
#include "OnlineSubsystemUtils.h"
|
||||||
#include "OnlineSubsystemUtilsModule.h"
|
#include "OnlineSubsystemUtilsModule.h"
|
||||||
#include "GameFramework/PlayerController.h"
|
#include "ModuleManager.h"
|
||||||
#include "Modules/ModuleManager.h"
|
|
||||||
#include "OnlineSubsystemUtilsClasses.h"
|
#include "OnlineSubsystemUtilsClasses.h"
|
||||||
#include "BlueprintDataDefinitions.generated.h"
|
#include "BlueprintDataDefinitions.generated.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
#include "OnlineSessionInterface.h"
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "CancelFindSessionsCallbackProxy.generated.h"
|
#include "CancelFindSessionsCallbackProxy.generated.h"
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "CreateSessionCallbackProxyAdvanced.generated.h"
|
#include "CreateSessionCallbackProxyAdvanced.generated.h"
|
||||||
|
|
||||||
@@ -19,13 +18,7 @@ class UCreateSessionCallbackProxyAdvanced : public UOnlineBlueprintCallProxyBase
|
|||||||
UPROPERTY(BlueprintAssignable)
|
UPROPERTY(BlueprintAssignable)
|
||||||
FEmptyOnlineDelegate OnFailure;
|
FEmptyOnlineDelegate OnFailure;
|
||||||
|
|
||||||
/**
|
// 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 bUseLAN When you want to play LAN, the level to play on must be loaded with option 'bIsLanMatch'
|
|
||||||
* @param bUsePresence 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.
|
|
||||||
*/
|
|
||||||
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 bAllowJoinViaPresence = true, bool bAllowJoinViaPresenceFriendsOnly = false, bool bAntiCheatProtected = false, bool bUsesStats = false, bool bShouldAdvertise = 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);
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
#include "OnlineSessionInterface.h"
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "EndSessionCallbackProxy.generated.h"
|
#include "EndSessionCallbackProxy.generated.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
#include "OnlineSessionInterface.h"
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
|
||||||
#include "FindSessionsCallbackProxy.h"
|
#include "FindSessionsCallbackProxy.h"
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "FindSessionsCallbackProxyAdvanced.generated.h"
|
#include "FindSessionsCallbackProxyAdvanced.generated.h"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "Interfaces/OnlineIdentityInterface.h"
|
#include "OnlineIdentityInterface.h"
|
||||||
#include "GetUserPrivilegeCallbackProxy.generated.h"
|
#include "GetUserPrivilegeCallbackProxy.generated.h"
|
||||||
|
|
||||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FBlueprintGetUserPrivilegeDelegate,/* const &FBPUniqueNetId, PlayerID,*/ EBPUserPrivileges, QueriedPrivilege, bool, HadPrivilege);
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FBlueprintGetUserPrivilegeDelegate,/* const &FBPUniqueNetId, PlayerID,*/ EBPUserPrivileges, QueriedPrivilege, bool, HadPrivilege);
|
||||||
@@ -21,7 +21,7 @@ class UGetUserPrivilegeCallbackProxy : public UOnlineBlueprintCallProxyBase
|
|||||||
UPROPERTY(BlueprintAssignable)
|
UPROPERTY(BlueprintAssignable)
|
||||||
FEmptyOnlineDelegate OnFailure;
|
FEmptyOnlineDelegate OnFailure;
|
||||||
|
|
||||||
// Gets the privilage of the user
|
// Logs out of the identity interface
|
||||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|AdvancedIdentity")
|
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|AdvancedIdentity")
|
||||||
static UGetUserPrivilegeCallbackProxy* GetUserPrivilege(UObject* WorldContextObject, const EBPUserPrivileges & PrivilegeToCheck, const FBPUniqueNetId & PlayerUniqueNetID);
|
static UGetUserPrivilegeCallbackProxy* GetUserPrivilege(UObject* WorldContextObject, const EBPUserPrivileges & PrivilegeToCheck, const FBPUniqueNetId & PlayerUniqueNetID);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "Interfaces/OnlineIdentityInterface.h"
|
#include "OnlineIdentityInterface.h"
|
||||||
#include "Engine/LocalPlayer.h"
|
#include "Engine/LocalPlayer.h"
|
||||||
#include "LoginUserCallbackProxy.generated.h"
|
#include "LoginUserCallbackProxy.generated.h"
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ class ULoginUserCallbackProxy : public UOnlineBlueprintCallProxyBase
|
|||||||
UPROPERTY(BlueprintAssignable)
|
UPROPERTY(BlueprintAssignable)
|
||||||
FEmptyOnlineDelegate OnFailure;
|
FEmptyOnlineDelegate OnFailure;
|
||||||
|
|
||||||
// Logs into the identity interface
|
// Logs out of the identity interface
|
||||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), 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);
|
static ULoginUserCallbackProxy* LoginUser(UObject* WorldContextObject, class APlayerController* PlayerController, FString UserID, FString UserToken);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "Interfaces/OnlineIdentityInterface.h"
|
#include "OnlineIdentityInterface.h"
|
||||||
#include "Engine/LocalPlayer.h"
|
#include "Engine/LocalPlayer.h"
|
||||||
#include "LogoutUserCallbackProxy.generated.h"
|
#include "LogoutUserCallbackProxy.generated.h"
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Engine/Engine.h"
|
|
||||||
#include "BlueprintDataDefinitions.h"
|
#include "BlueprintDataDefinitions.h"
|
||||||
#include "UpdateSessionCallbackProxyAdvanced.generated.h"
|
#include "UpdateSessionCallbackProxyAdvanced.generated.h"
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ void UAdvancedExternalUILibrary::ShowInviteUI(APlayerController *PlayerControlle
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExternalUIInterface->ShowInviteUI(Player->GetControllerId(), NAME_GameSession);
|
ExternalUIInterface->ShowInviteUI(Player->GetControllerId(), GameSessionName);
|
||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
// 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 "AdvancedFriendsGameInstance.h"
|
#include "AdvancedFriendsGameInstance.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
|
||||||
#include "GameFramework/PlayerController.h"
|
|
||||||
|
|
||||||
//General Log
|
//General Log
|
||||||
DEFINE_LOG_CATEGORY(AdvancedFriendsInterfaceLog);
|
DEFINE_LOG_CATEGORY(AdvancedFriendsInterfaceLog);
|
||||||
@@ -22,7 +20,7 @@ UAdvancedFriendsGameInstance::UAdvancedFriendsGameInstance(const FObjectInitiali
|
|||||||
|
|
||||||
void UAdvancedFriendsGameInstance::Shutdown()
|
void UAdvancedFriendsGameInstance::Shutdown()
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -39,7 +37,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
|||||||
|
|
||||||
if (bEnableTalkingStatusDelegate)
|
if (bEnableTalkingStatusDelegate)
|
||||||
{
|
{
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(GetWorld());
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
|
|
||||||
if (VoiceInterface.IsValid())
|
if (VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -52,7 +50,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(GetWorld());
|
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
||||||
|
|
||||||
if (IdentityInterface.IsValid())
|
if (IdentityInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -69,7 +67,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
|||||||
|
|
||||||
void UAdvancedFriendsGameInstance::Init()
|
void UAdvancedFriendsGameInstance::Init()
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());//OnlineSub->GetSessionInterface();
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();//OnlineSub->GetSessionInterface();
|
||||||
|
|
||||||
if (SessionInterface.IsValid())
|
if (SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -90,7 +88,7 @@ void UAdvancedFriendsGameInstance::Init()
|
|||||||
// Beginning work on the voice interface
|
// Beginning work on the voice interface
|
||||||
if (bEnableTalkingStatusDelegate)
|
if (bEnableTalkingStatusDelegate)
|
||||||
{
|
{
|
||||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(GetWorld());
|
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||||
|
|
||||||
if (VoiceInterface.IsValid())
|
if (VoiceInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -103,7 +101,7 @@ void UAdvancedFriendsGameInstance::Init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(GetWorld());
|
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
||||||
|
|
||||||
if (IdentityInterface.IsValid())
|
if (IdentityInterface.IsValid())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ void UAdvancedFriendsLibrary::SendSessionInviteToFriends(APlayerController *Play
|
|||||||
List.Add(val);
|
List.Add(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SessionInterface->SendSessionInviteToFriends(Player->GetControllerId(), NAME_GameSession, List))
|
if (SessionInterface->SendSessionInviteToFriends(Player->GetControllerId(), GameSessionName, List))
|
||||||
{
|
{
|
||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
return;
|
return;
|
||||||
@@ -94,7 +94,7 @@ void UAdvancedFriendsLibrary::SendSessionInviteToFriend(APlayerController *Playe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SessionInterface->SendSessionInviteToFriend(Player->GetControllerId(), NAME_GameSession, *FriendUniqueNetId.GetUniqueNetId()))
|
if (SessionInterface->SendSessionInviteToFriend(Player->GetControllerId(), GameSessionName, *FriendUniqueNetId.GetUniqueNetId()))
|
||||||
{
|
{
|
||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,5 +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 "AdvancedSessionsLibrary.h"
|
#include "AdvancedSessionsLibrary.h"
|
||||||
|
|
||||||
#include "GameFramework/PlayerState.h"
|
#include "GameFramework/PlayerState.h"
|
||||||
#include "GameFramework/GameStateBase.h"
|
#include "GameFramework/GameStateBase.h"
|
||||||
|
|
||||||
@@ -11,46 +12,6 @@ bool UAdvancedSessionsLibrary::IsValidSession(const FBlueprintSessionResult & Se
|
|||||||
return SessionResult.OnlineResult.IsValid();
|
return SessionResult.OnlineResult.IsValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetSessionID_AsString(const FBlueprintSessionResult & SessionResult, FString& SessionID)
|
|
||||||
{
|
|
||||||
const TSharedPtr<class FOnlineSessionInfo> SessionInfo = SessionResult.OnlineResult.Session.SessionInfo;
|
|
||||||
if (SessionInfo.IsValid() && SessionInfo->IsValid() && SessionInfo->GetSessionId().IsValid())
|
|
||||||
{
|
|
||||||
SessionID = SessionInfo->GetSessionId().ToString();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Zero the string out if we didn't have a valid one, in case this is called in c++
|
|
||||||
SessionID.Empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetCurrentSessionID_AsString(UObject* WorldContextObject, FString& SessionID)
|
|
||||||
{
|
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
|
||||||
{
|
|
||||||
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetCurrentSessionID_AsString couldn't get the session interface!"));
|
|
||||||
SessionID.Empty();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FNamedOnlineSession* Session = SessionInterface->GetNamedSession(NAME_GameSession);
|
|
||||||
if (Session != nullptr)
|
|
||||||
{
|
|
||||||
const TSharedPtr<class FOnlineSessionInfo> SessionInfo = Session->SessionInfo;
|
|
||||||
if (SessionInfo.IsValid() && SessionInfo->IsValid() && SessionInfo->GetSessionId().IsValid())
|
|
||||||
{
|
|
||||||
SessionID = SessionInfo->GetSessionId().ToString();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Zero the string out if we didn't have a valid one, in case this is called in c++
|
|
||||||
SessionID.Empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetCurrentUniqueBuildID(int32 &UniqueBuildId)
|
void UAdvancedSessionsLibrary::GetCurrentUniqueBuildID(int32 &UniqueBuildId)
|
||||||
{
|
{
|
||||||
UniqueBuildId = GetBuildUniqueId();
|
UniqueBuildId = GetBuildUniqueId();
|
||||||
@@ -61,31 +22,6 @@ void UAdvancedSessionsLibrary::GetUniqueBuildID(FBlueprintSessionResult SessionR
|
|||||||
UniqueBuildId = SessionResult.OnlineResult.Session.SessionSettings.BuildUniqueId;
|
UniqueBuildId = SessionResult.OnlineResult.Session.SessionSettings.BuildUniqueId;
|
||||||
}
|
}
|
||||||
|
|
||||||
FName UAdvancedSessionsLibrary::GetSessionPropertyKey(const FSessionPropertyKeyPair& SessionProperty)
|
|
||||||
{
|
|
||||||
return SessionProperty.Key;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::FindSessionPropertyByName(const TArray<FSessionPropertyKeyPair>& ExtraSettings, FName SettingName, EBlueprintResultSwitch &Result, FSessionPropertyKeyPair& OutProperty)
|
|
||||||
{
|
|
||||||
const FSessionPropertyKeyPair* prop = ExtraSettings.FindByPredicate([&](const FSessionPropertyKeyPair& it) {return it.Key == SettingName; });
|
|
||||||
if (prop)
|
|
||||||
{
|
|
||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
|
||||||
OutProperty = *prop;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Result = EBlueprintResultSwitch::OnFailure;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::FindSessionPropertyIndexByName(const TArray<FSessionPropertyKeyPair>& ExtraSettings, FName SettingName, EBlueprintResultSwitch &Result, int32& OutIndex)
|
|
||||||
{
|
|
||||||
OutIndex = ExtraSettings.IndexOfByPredicate([&](const FSessionPropertyKeyPair& it) {return it.Key == SettingName; });
|
|
||||||
|
|
||||||
Result = OutIndex != INDEX_NONE ? EBlueprintResultSwitch::OnSuccess : EBlueprintResultSwitch::OnFailure;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::AddOrModifyExtraSettings(UPARAM(ref) TArray<FSessionPropertyKeyPair> & SettingsArray, UPARAM(ref) TArray<FSessionPropertyKeyPair> & NewOrChangedSettings, TArray<FSessionPropertyKeyPair> & ModifiedSettingsArray)
|
void UAdvancedSessionsLibrary::AddOrModifyExtraSettings(UPARAM(ref) TArray<FSessionPropertyKeyPair> & SettingsArray, UPARAM(ref) TArray<FSessionPropertyKeyPair> & NewOrChangedSettings, TArray<FSessionPropertyKeyPair> & ModifiedSettingsArray)
|
||||||
{
|
{
|
||||||
ModifiedSettingsArray = SettingsArray;
|
ModifiedSettingsArray = SettingsArray;
|
||||||
@@ -126,10 +62,9 @@ void UAdvancedSessionsLibrary::GetExtraSettings(FBlueprintSessionResult SessionR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetSessionState(UObject* WorldContextObject, EBPOnlineSessionState &SessionState)
|
void UAdvancedSessionsLibrary::GetSessionState(EBPOnlineSessionState &SessionState)
|
||||||
{
|
{
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -137,13 +72,12 @@ void UAdvancedSessionsLibrary::GetSessionState(UObject* WorldContextObject, EBPO
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SessionState = ((EBPOnlineSessionState)SessionInterface->GetSessionState(NAME_GameSession));
|
SessionState = ((EBPOnlineSessionState)SessionInterface->GetSessionState(GameSessionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetSessionSettings(UObject* WorldContextObject, int32 &NumConnections, int32 &NumPrivateConnections, bool &bIsLAN, bool &bIsDedicated, bool &bAllowInvites, bool &bAllowJoinInProgress, bool &bIsAnticheatEnabled, int32 &BuildUniqueID, TArray<FSessionPropertyKeyPair> &ExtraSettings, EBlueprintResultSwitch &Result)
|
void UAdvancedSessionsLibrary::GetSessionSettings(int32 &NumConnections, int32 &NumPrivateConnections, bool &bIsLAN, bool &bIsDedicated, bool &bAllowInvites, bool &bAllowJoinInProgress, bool &bIsAnticheatEnabled, int32 &BuildUniqueID, TArray<FSessionPropertyKeyPair> &ExtraSettings, EBlueprintResultSwitch &Result)
|
||||||
{
|
{
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -152,7 +86,7 @@ void UAdvancedSessionsLibrary::GetSessionSettings(UObject* WorldContextObject, i
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FOnlineSessionSettings* settings = SessionInterface->GetSessionSettings(NAME_GameSession);
|
FOnlineSessionSettings* settings = SessionInterface->GetSessionSettings(GameSessionName);
|
||||||
if (!settings)
|
if (!settings)
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetSessionSettings couldn't get the session settings!"));
|
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetSessionSettings couldn't get the session settings!"));
|
||||||
@@ -181,10 +115,9 @@ void UAdvancedSessionsLibrary::GetSessionSettings(UObject* WorldContextObject, i
|
|||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UAdvancedSessionsLibrary::IsPlayerInSession(UObject* WorldContextObject, const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession)
|
void UAdvancedSessionsLibrary::IsPlayerInSession(const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession)
|
||||||
{
|
{
|
||||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
|
||||||
|
|
||||||
if (!SessionInterface.IsValid())
|
if (!SessionInterface.IsValid())
|
||||||
{
|
{
|
||||||
@@ -193,7 +126,7 @@ void UAdvancedSessionsLibrary::IsPlayerInSession(UObject* WorldContextObject, co
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bIsInSession = SessionInterface->IsPlayerInSession(NAME_GameSession, *PlayerToCheck.GetUniqueNetId());
|
bIsInSession = SessionInterface->IsPlayerInSession(GameSessionName, *PlayerToCheck.GetUniqueNetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
FSessionsSearchSetting UAdvancedSessionsLibrary::MakeLiteralSessionSearchProperty(FSessionPropertyKeyPair SessionSearchProperty, EOnlineComparisonOpRedux ComparisonOp)
|
FSessionsSearchSetting UAdvancedSessionsLibrary::MakeLiteralSessionSearchProperty(FSessionPropertyKeyPair SessionSearchProperty, EOnlineComparisonOpRedux ComparisonOp)
|
||||||
@@ -469,7 +402,7 @@ void UAdvancedSessionsLibrary::GetPlayerName(APlayerController *PlayerController
|
|||||||
|
|
||||||
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
|
if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
|
||||||
{
|
{
|
||||||
PlayerName = PlayerState->GetPlayerName();
|
PlayerName = PlayerState->PlayerName;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -480,14 +413,23 @@ void UAdvancedSessionsLibrary::GetPlayerName(APlayerController *PlayerController
|
|||||||
|
|
||||||
void UAdvancedSessionsLibrary::GetNumberOfNetworkPlayers(UObject* WorldContextObject, int32 &NumNetPlayers)
|
void UAdvancedSessionsLibrary::GetNumberOfNetworkPlayers(UObject* WorldContextObject, int32 &NumNetPlayers)
|
||||||
{
|
{
|
||||||
|
//Get an actor to GetWorld() from
|
||||||
|
/*TObjectIterator<AActor> Itr;
|
||||||
|
if (!Itr)
|
||||||
|
{
|
||||||
|
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetNumberOfNetworkPlayers Failed to get iterator!"));
|
||||||
|
return;
|
||||||
|
}*/
|
||||||
|
//~~~~~~~~~~~~
|
||||||
|
|
||||||
//Get World
|
//Get World
|
||||||
UWorld* TheWorld = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
UWorld* TheWorld = GEngine->GetWorldFromContextObject(WorldContextObject);
|
||||||
|
|
||||||
if (!TheWorld)
|
if (!TheWorld)
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetNumberOfNetworkPlayers Failed to get World()!"));
|
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetNumberOfNetworkPlayers Failed to get World()!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
TArray<class APlayerState*>& PlayerArray = (TheWorld->GetGameState()->PlayerArray);
|
||||||
NumNetPlayers = TheWorld->GetGameState()->PlayerArray.Num();
|
NumNetPlayers = PlayerArray.Num();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
|
|
||||||
#include "CancelFindSessionsCallbackProxy.h"
|
#include "CancelFindSessionsCallbackProxy.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ UCancelFindSessionsCallbackProxy* UCancelFindSessionsCallbackProxy::CancelFindSe
|
|||||||
|
|
||||||
void UCancelFindSessionsCallbackProxy::Activate()
|
void UCancelFindSessionsCallbackProxy::Activate()
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.IsValid())
|
if (Helper.IsValid())
|
||||||
@@ -47,7 +48,7 @@ void UCancelFindSessionsCallbackProxy::Activate()
|
|||||||
|
|
||||||
void UCancelFindSessionsCallbackProxy::OnCompleted(bool bWasSuccessful)
|
void UCancelFindSessionsCallbackProxy::OnCompleted(bool bWasSuccessful)
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.IsValid())
|
if (Helper.IsValid())
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ UCreateSessionCallbackProxyAdvanced* UCreateSessionCallbackProxyAdvanced::Create
|
|||||||
|
|
||||||
void UCreateSessionCallbackProxyAdvanced::Activate()
|
void UCreateSessionCallbackProxyAdvanced::Activate()
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSession"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSession"), GEngine->GetWorldFromContextObject(WorldContextObject));
|
||||||
|
|
||||||
if (PlayerControllerWeakPtr.IsValid() )
|
if (PlayerControllerWeakPtr.IsValid() )
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
@@ -79,23 +79,10 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!bDedicatedServer )
|
if (!bDedicatedServer && PlayerControllerWeakPtr.IsValid() && Helper.UserID.IsValid())
|
||||||
{
|
Sessions->CreateSession(*Helper.UserID, GameSessionName, Settings);
|
||||||
if (PlayerControllerWeakPtr.IsValid() && Helper.UserID.IsValid())
|
|
||||||
{
|
|
||||||
Sessions->CreateSession(*Helper.UserID, NAME_GameSession, Settings);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FFrame::KismetExecutionMessage(TEXT("Invalid Player controller when attempting to start a session"), ELogVerbosity::Warning);
|
|
||||||
Sessions->ClearOnCreateSessionCompleteDelegate_Handle(CreateCompleteDelegateHandle);
|
|
||||||
|
|
||||||
// Fail immediately
|
|
||||||
OnFailure.Broadcast();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
Sessions->CreateSession(0, NAME_GameSession, Settings);
|
Sessions->CreateSession(0, GameSessionName, Settings);
|
||||||
|
|
||||||
// OnCreateCompleted will get called, nothing more to do now
|
// OnCreateCompleted will get called, nothing more to do now
|
||||||
return;
|
return;
|
||||||
@@ -112,7 +99,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, EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject));
|
||||||
//Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
//Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.OnlineSub != nullptr)
|
if (Helper.OnlineSub != nullptr)
|
||||||
@@ -125,7 +112,7 @@ void UCreateSessionCallbackProxyAdvanced::OnCreateCompleted(FName SessionName, b
|
|||||||
if (bWasSuccessful)
|
if (bWasSuccessful)
|
||||||
{
|
{
|
||||||
StartCompleteDelegateHandle = Sessions->AddOnStartSessionCompleteDelegate_Handle(StartCompleteDelegate);
|
StartCompleteDelegateHandle = Sessions->AddOnStartSessionCompleteDelegate_Handle(StartCompleteDelegate);
|
||||||
Sessions->StartSession(NAME_GameSession);
|
Sessions->StartSession(GameSessionName);
|
||||||
|
|
||||||
// OnStartCompleted will get called, nothing more to do now
|
// OnStartCompleted will get called, nothing more to do now
|
||||||
return;
|
return;
|
||||||
@@ -141,8 +128,8 @@ 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, EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("StartSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject));
|
||||||
//Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.OnlineSub != nullptr)
|
if (Helper.OnlineSub != nullptr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
|
|
||||||
#include "EndSessionCallbackProxy.h"
|
#include "EndSessionCallbackProxy.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ UEndSessionCallbackProxy* UEndSessionCallbackProxy::EndSession(UObject* WorldCon
|
|||||||
|
|
||||||
void UEndSessionCallbackProxy::Activate()
|
void UEndSessionCallbackProxy::Activate()
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSession"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSession"), GEngine->GetWorldFromContextObject(WorldContextObject));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.IsValid())
|
if (Helper.IsValid())
|
||||||
@@ -29,12 +30,12 @@ void UEndSessionCallbackProxy::Activate()
|
|||||||
auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
{
|
{
|
||||||
FNamedOnlineSession* Session = Sessions->GetNamedSession(NAME_GameSession);
|
FNamedOnlineSession* Session = Sessions->GetNamedSession(GameSessionName);
|
||||||
if (Session &&
|
if (Session &&
|
||||||
Session->SessionState == EOnlineSessionState::InProgress)
|
Session->SessionState == EOnlineSessionState::InProgress)
|
||||||
{
|
{
|
||||||
DelegateHandle = Sessions->AddOnEndSessionCompleteDelegate_Handle(Delegate);
|
DelegateHandle = Sessions->AddOnEndSessionCompleteDelegate_Handle(Delegate);
|
||||||
Sessions->EndSession(NAME_GameSession);
|
Sessions->EndSession(GameSessionName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -55,7 +56,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, EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.IsValid())
|
if (Helper.IsValid())
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ void UFindFriendSessionCallbackProxy::Activate()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||||
|
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
{
|
{
|
||||||
@@ -71,7 +71,7 @@ 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)
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||||
|
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
Sessions->ClearOnFindFriendSessionCompleteDelegate_Handle(LocalPlayer, FindFriendSessionCompleteDelegateHandle);
|
Sessions->ClearOnFindFriendSessionCompleteDelegate_Handle(LocalPlayer, FindFriendSessionCompleteDelegateHandle);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
|
|
||||||
#include "FindSessionsCallbackProxyAdvanced.h"
|
#include "FindSessionsCallbackProxyAdvanced.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ UFindSessionsCallbackProxyAdvanced* UFindSessionsCallbackProxyAdvanced::FindSess
|
|||||||
|
|
||||||
void UFindSessionsCallbackProxyAdvanced::Activate()
|
void UFindSessionsCallbackProxyAdvanced::Activate()
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (Helper.IsValid())
|
if (Helper.IsValid())
|
||||||
@@ -155,7 +156,7 @@ void UFindSessionsCallbackProxyAdvanced::Activate()
|
|||||||
|
|
||||||
void UFindSessionsCallbackProxyAdvanced::OnCompleted(bool bSuccess)
|
void UFindSessionsCallbackProxyAdvanced::OnCompleted(bool bSuccess)
|
||||||
{
|
{
|
||||||
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
|
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject));
|
||||||
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
|
||||||
|
|
||||||
if (!bRunSecondSearch && Helper.IsValid())
|
if (!bRunSecondSearch && Helper.IsValid())
|
||||||
@@ -224,20 +225,13 @@ void UFindSessionsCallbackProxyAdvanced::OnCompleted(bool bSuccess)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Helper.IsValid() && bRunSecondSearch && ServerSearchType == EBPServerPresenceSearchType::AllServers)
|
if (bRunSecondSearch && ServerSearchType == EBPServerPresenceSearchType::AllServers)
|
||||||
{
|
{
|
||||||
bRunSecondSearch = false;
|
bRunSecondSearch = false;
|
||||||
bIsOnSecondSearch = true;
|
bIsOnSecondSearch = true;
|
||||||
auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
||||||
Sessions->FindSessions(*Helper.UserID, SearchObjectDedicated.ToSharedRef());
|
Sessions->FindSessions(*Helper.UserID, SearchObjectDedicated.ToSharedRef());
|
||||||
}
|
}
|
||||||
else // We lost our player controller
|
|
||||||
{
|
|
||||||
if (bSuccess && SessionSearchResults.Num() > 0)
|
|
||||||
OnSuccess.Broadcast(SessionSearchResults);
|
|
||||||
else
|
|
||||||
OnFailure.Broadcast(SessionSearchResults);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::Update
|
|||||||
void UUpdateSessionCallbackProxyAdvanced::Activate()
|
void UUpdateSessionCallbackProxyAdvanced::Activate()
|
||||||
{
|
{
|
||||||
|
|
||||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||||
|
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
{
|
{
|
||||||
@@ -42,8 +42,8 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This gets the actual session itself
|
// This gets the actual session itself
|
||||||
//FNamedOnlineSession * curSession = Sessions->GetNamedSession(NAME_GameSession);
|
//FNamedOnlineSession * curSession = Sessions->GetNamedSession(GameSessionName);
|
||||||
FOnlineSessionSettings* Settings = Sessions->GetSessionSettings(NAME_GameSession);
|
FOnlineSessionSettings* Settings = Sessions->GetSessionSettings(GameSessionName);
|
||||||
|
|
||||||
if (!Settings)
|
if (!Settings)
|
||||||
{
|
{
|
||||||
@@ -85,7 +85,7 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Sessions->UpdateSession(NAME_GameSession, *Settings, bRefreshOnlineData);
|
Sessions->UpdateSession(GameSessionName, *Settings, bRefreshOnlineData);
|
||||||
|
|
||||||
// OnUpdateCompleted will get called, nothing more to do now
|
// OnUpdateCompleted will get called, nothing more to do now
|
||||||
return;
|
return;
|
||||||
@@ -101,7 +101,7 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
|||||||
|
|
||||||
void UUpdateSessionCallbackProxyAdvanced::OnUpdateCompleted(FName SessionName, bool bWasSuccessful)
|
void UUpdateSessionCallbackProxyAdvanced::OnUpdateCompleted(FName SessionName, bool bWasSuccessful)
|
||||||
{
|
{
|
||||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||||
if (Sessions.IsValid())
|
if (Sessions.IsValid())
|
||||||
{
|
{
|
||||||
Sessions->ClearOnUpdateSessionCompleteDelegate_Handle(OnUpdateSessionCompleteDelegateHandle);
|
Sessions->ClearOnUpdateSessionCompleteDelegate_Handle(OnUpdateSessionCompleteDelegateHandle);
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"FileVersion" : 3,
|
"FileVersion" : 3,
|
||||||
|
|
||||||
"FriendlyName" : "Advanced Steam Sessions",
|
"FriendlyName" : "Advanced Steam Sessions",
|
||||||
"Version" : 4.23,
|
"Version" : 1.9,
|
||||||
"VersionName": "4.23",
|
"VersionName": "1.9",
|
||||||
"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",
|
||||||
@@ -16,23 +16,5 @@
|
|||||||
"Type" : "RunTime",
|
"Type" : "RunTime",
|
||||||
"LoadingPhase" : "PreDefault"
|
"LoadingPhase" : "PreDefault"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"Plugins": [
|
|
||||||
{
|
|
||||||
"Name": "AdvancedSessions",
|
|
||||||
"Enabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "OnlineSubsystem",
|
|
||||||
"Enabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "OnlineSubsystemUtils",
|
|
||||||
"Enabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "OnlineSubsystemSteam",
|
|
||||||
"Enabled": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ public class AdvancedSteamSessions : ModuleRules
|
|||||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
//bEnforceIWYU = true;
|
//bEnforceIWYU = true;
|
||||||
|
|
||||||
PublicDefinitions.Add("WITH_ADVANCED_STEAM_SESSIONS=1");
|
Definitions.Add("WITH_ADVANCED_STEAM_SESSIONS=1");
|
||||||
|
|
||||||
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"*/});
|
||||||
|
|||||||
@@ -6,232 +6,14 @@
|
|||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
#include "Online.h"
|
#include "Online.h"
|
||||||
#include "OnlineSubsystem.h"
|
#include "OnlineSubsystem.h"
|
||||||
#include "Interfaces/OnlineFriendsInterface.h"
|
#include "OnlineFriendsInterface.h"
|
||||||
#include "Interfaces/OnlineUserInterface.h"
|
#include "OnlineUserInterface.h"
|
||||||
#include "Interfaces/OnlineMessageInterface.h"
|
#include "OnlineMessageInterface.h"
|
||||||
#include "Interfaces/OnlinePresenceInterface.h"
|
#include "OnlinePresenceInterface.h"
|
||||||
#include "Engine/GameInstance.h"
|
#include "Engine/GameInstance.h"
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
#include "OnlineSessionInterface.h"
|
||||||
#include "BlueprintDataDefinitions.h"
|
|
||||||
#include "UObject/UObjectIterator.h"
|
|
||||||
|
|
||||||
// This is taken directly from UE4 - OnlineSubsystemSteamPrivatePCH.h as a fix for the array_count macro
|
#include "UObjectIterator.h"
|
||||||
// @todo Steam: Steam headers trigger secure-C-runtime warnings in Visual C++. Rather than mess with _CRT_SECURE_NO_WARNINGS, we'll just
|
|
||||||
// disable the warnings locally. Remove when this is fixed in the SDK
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma warning(push)
|
|
||||||
#pragma warning(disable:4996)
|
|
||||||
// #TODO check back on this at some point
|
|
||||||
#pragma warning(disable:4265) // SteamAPI CCallback< specifically, this warning is off by default but 4.17 turned it on....
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
|
||||||
|
|
||||||
#pragma push_macro("ARRAY_COUNT")
|
|
||||||
#undef ARRAY_COUNT
|
|
||||||
|
|
||||||
#if USING_CODE_ANALYSIS
|
|
||||||
MSVC_PRAGMA(warning(push))
|
|
||||||
MSVC_PRAGMA(warning(disable : ALL_CODE_ANALYSIS_WARNINGS))
|
|
||||||
#endif // USING_CODE_ANALYSIS
|
|
||||||
|
|
||||||
#include <steam/steam_api.h>
|
|
||||||
|
|
||||||
#if USING_CODE_ANALYSIS
|
|
||||||
MSVC_PRAGMA(warning(pop))
|
|
||||||
#endif // USING_CODE_ANALYSIS
|
|
||||||
|
|
||||||
#include <steam/isteamapps.h>
|
|
||||||
#include <steam/isteamapplist.h>
|
|
||||||
//#include <OnlineSubsystemSteamTypes.h>
|
|
||||||
#pragma pop_macro("ARRAY_COUNT")
|
|
||||||
|
|
||||||
// @todo Steam: See above
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma warning(pop)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Making a copy of this here since the original is still in a private folder and is screwing with things
|
|
||||||
/**
|
|
||||||
* Steam specific implementation of the unique net id
|
|
||||||
*/
|
|
||||||
class FUniqueNetIdSteam2 :
|
|
||||||
public FUniqueNetId
|
|
||||||
{
|
|
||||||
PACKAGE_SCOPE:
|
|
||||||
/** Holds the net id for a player */
|
|
||||||
uint64 UniqueNetId;
|
|
||||||
|
|
||||||
/** Hidden on purpose */
|
|
||||||
FUniqueNetIdSteam2() :
|
|
||||||
UniqueNetId(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copy Constructor
|
|
||||||
*
|
|
||||||
* @param Src the id to copy
|
|
||||||
*/
|
|
||||||
explicit FUniqueNetIdSteam2(const FUniqueNetIdSteam2& Src) :
|
|
||||||
UniqueNetId(Src.UniqueNetId)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* Constructs this object with the specified net id
|
|
||||||
*
|
|
||||||
* @param InUniqueNetId the id to set ours to
|
|
||||||
*/
|
|
||||||
explicit FUniqueNetIdSteam2(uint64 InUniqueNetId) :
|
|
||||||
UniqueNetId(InUniqueNetId)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs this object with the steam id
|
|
||||||
*
|
|
||||||
* @param InUniqueNetId the id to set ours to
|
|
||||||
*/
|
|
||||||
explicit FUniqueNetIdSteam2(CSteamID InSteamId) :
|
|
||||||
UniqueNetId(InSteamId.ConvertToUint64())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs this object with the specified net id
|
|
||||||
*
|
|
||||||
* @param String textual representation of an id
|
|
||||||
*/
|
|
||||||
explicit FUniqueNetIdSteam2(const FString& Str) :
|
|
||||||
UniqueNetId(FCString::Atoi64(*Str))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs this object with the specified net id
|
|
||||||
*
|
|
||||||
* @param InUniqueNetId the id to set ours to (assumed to be FUniqueNetIdSteam in fact)
|
|
||||||
*/
|
|
||||||
explicit FUniqueNetIdSteam2(const FUniqueNetId& InUniqueNetId) :
|
|
||||||
UniqueNetId(*(uint64*)InUniqueNetId.GetBytes())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual FName GetType() const override
|
|
||||||
{
|
|
||||||
return STEAM_SUBSYSTEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the raw byte representation of this net id
|
|
||||||
* This data is platform dependent and shouldn't be manipulated directly
|
|
||||||
*
|
|
||||||
* @return byte array of size GetSize()
|
|
||||||
*/
|
|
||||||
virtual const uint8* GetBytes() const override
|
|
||||||
{
|
|
||||||
return (uint8*)&UniqueNetId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the size of the id
|
|
||||||
*
|
|
||||||
* @return size in bytes of the id representation
|
|
||||||
*/
|
|
||||||
virtual int32 GetSize() const override
|
|
||||||
{
|
|
||||||
return sizeof(uint64);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check the validity of the id
|
|
||||||
*
|
|
||||||
* @return true if this is a well formed ID, false otherwise
|
|
||||||
*/
|
|
||||||
virtual bool IsValid() const override
|
|
||||||
{
|
|
||||||
return UniqueNetId != 0 && CSteamID(UniqueNetId).IsValid();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Platform specific conversion to string representation of data
|
|
||||||
*
|
|
||||||
* @return data in string form
|
|
||||||
*/
|
|
||||||
virtual FString ToString() const override
|
|
||||||
{
|
|
||||||
return FString::Printf(TEXT("%llu"), UniqueNetId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a human readable representation of the net id
|
|
||||||
* Shouldn't be used for anything other than logging/debugging
|
|
||||||
*
|
|
||||||
* @return id in string form
|
|
||||||
*/
|
|
||||||
virtual FString ToDebugString() const override
|
|
||||||
{
|
|
||||||
CSteamID SteamID(UniqueNetId);
|
|
||||||
if (SteamID.IsLobby())
|
|
||||||
{
|
|
||||||
return FString::Printf(TEXT("Lobby [0x%llX]"), UniqueNetId);
|
|
||||||
}
|
|
||||||
else if (SteamID.BAnonGameServerAccount())
|
|
||||||
{
|
|
||||||
return FString::Printf(TEXT("Server [0x%llX]"), UniqueNetId);
|
|
||||||
}
|
|
||||||
else if (SteamID.IsValid())
|
|
||||||
{
|
|
||||||
const FString NickName(SteamFriends() ? UTF8_TO_TCHAR(SteamFriends()->GetFriendPersonaName(UniqueNetId)) : TEXT("UNKNOWN"));
|
|
||||||
return FString::Printf(TEXT("%s [0x%llX]"), *NickName, UniqueNetId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return FString::Printf(TEXT("INVALID [0x%llX]"), UniqueNetId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Needed for TMap::GetTypeHash() */
|
|
||||||
friend uint32 GetTypeHash(const FUniqueNetIdSteam2& A)
|
|
||||||
{
|
|
||||||
return GetTypeHash(A.UniqueNetId);
|
|
||||||
//return (uint32)(A.UniqueNetId) + ((uint32)((A.UniqueNetId) >> 32) * 23);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Convenience cast to CSteamID */
|
|
||||||
operator CSteamID()
|
|
||||||
{
|
|
||||||
return UniqueNetId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Convenience cast to CSteamID */
|
|
||||||
operator const CSteamID() const
|
|
||||||
{
|
|
||||||
return UniqueNetId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Convenience cast to CSteamID pointer */
|
|
||||||
operator CSteamID*()
|
|
||||||
{
|
|
||||||
return (CSteamID*)&UniqueNetId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Convenience cast to CSteamID pointer */
|
|
||||||
operator const CSteamID*() const
|
|
||||||
{
|
|
||||||
return (const CSteamID*)&UniqueNetId;
|
|
||||||
}
|
|
||||||
|
|
||||||
friend FArchive& operator<<(FArchive& Ar, FUniqueNetIdSteam2& UserId)
|
|
||||||
{
|
|
||||||
return Ar << UserId.UniqueNetId;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "AdvancedSteamFriendsLibrary.generated.h"
|
#include "AdvancedSteamFriendsLibrary.generated.h"
|
||||||
|
|
||||||
@@ -247,63 +29,30 @@ enum class SteamAvatarSize : uint8
|
|||||||
SteamAvatar_Large = 3
|
SteamAvatar_Large = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
UENUM(Blueprintable)
|
|
||||||
enum class ESteamUserOverlayType : uint8
|
|
||||||
{
|
|
||||||
/*Opens the overlay web browser to the specified user or groups profile.*/
|
|
||||||
steamid,
|
|
||||||
/*Opens a chat window to the specified user, or joins the group chat.*/
|
|
||||||
chat,
|
|
||||||
/*Opens a window to a Steam Trading session that was started with the ISteamEconomy / StartTrade Web API.*/
|
|
||||||
jointrade,
|
|
||||||
/*Opens the overlay web browser to the specified user's stats.*/
|
|
||||||
stats,
|
|
||||||
/*Opens the overlay web browser to the specified user's achievements.*/
|
|
||||||
achievements,
|
|
||||||
/*Opens the overlay in minimal mode prompting the user to add the target user as a friend.*/
|
|
||||||
friendadd,
|
|
||||||
/*Opens the overlay in minimal mode prompting the user to remove the target friend.*/
|
|
||||||
friendremove,
|
|
||||||
/*Opens the overlay in minimal mode prompting the user to accept an incoming friend invite.*/
|
|
||||||
friendrequestaccept,
|
|
||||||
/*Opens the overlay in minimal mode prompting the user to ignore an incoming friend invite.*/
|
|
||||||
friendrequestignore
|
|
||||||
};
|
|
||||||
|
|
||||||
static FString EnumToString(const FString& enumName, uint8 value)
|
|
||||||
{
|
|
||||||
const UEnum* EnumPtr = FindObject<UEnum>(ANY_PACKAGE, *enumName, true);
|
|
||||||
|
|
||||||
if (!EnumPtr)
|
|
||||||
return FString();
|
|
||||||
|
|
||||||
FString EnumName = EnumPtr->GetNameStringByIndex(value);
|
|
||||||
return EnumName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
USTRUCT(BlueprintType, Category = "Online|SteamAPI|SteamGroups")
|
USTRUCT(BlueprintType, Category = "Online|SteamAPI|SteamGroups")
|
||||||
struct FBPSteamGroupInfo
|
struct FBPSteamGroupInfo
|
||||||
{
|
{
|
||||||
GENERATED_USTRUCT_BODY()
|
GENERATED_USTRUCT_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||||
FBPUniqueNetId GroupID; // Uint64 representation
|
FBPUniqueNetId GroupID; // Uint64 representation
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||||
FString GroupName;
|
FString GroupName;
|
||||||
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;
|
int32 numOnline;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||||
int32 numInGame;
|
int32 numInGame;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|SteamAPI|SteamGroups")
|
||||||
int32 numChatting;
|
int32 numChatting;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class UAdvancedSteamFriendsLibrary : public UBlueprintFunctionLibrary
|
class UAdvancedSteamFriendsLibrary : public UBlueprintFunctionLibrary
|
||||||
{
|
{
|
||||||
@@ -319,10 +68,6 @@ public:
|
|||||||
// Preloads the avatar and name of a steam friend, return whether it is already available or not, STEAM ONLY, Takes time to actually load everything after this is called.
|
// Preloads the avatar and name of a steam friend, return whether it is already available or not, STEAM ONLY, Takes time to actually load everything after this is called.
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
||||||
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
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
|
|
||||||
static bool OpenSteamUserOverlay(const FBPUniqueNetId UniqueNetId, ESteamUserOverlayType DialogType);
|
|
||||||
|
|
||||||
// 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")
|
||||||
@@ -336,17 +81,13 @@ public:
|
|||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedFriends|SteamAPI")
|
UFUNCTION(BlueprintPure, Category = "Online|AdvancedFriends|SteamAPI")
|
||||||
static FBPUniqueNetId CreateSteamIDFromString(const FString SteamID64);
|
static FBPUniqueNetId CreateSteamIDFromString(const FString SteamID64);
|
||||||
|
|
||||||
// Retreives the local steam ID from steam
|
|
||||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedFriends|SteamAPI")
|
|
||||||
static FBPUniqueNetId GetLocalSteamIDFromSteam();
|
|
||||||
|
|
||||||
/* Gets the current game played by a friend - AppID is int32 even though steam ids are uint32, can't be helped in blueprint currently
|
/* Gets the current game played by a friend - AppID is int32 even though steam ids are uint32, can't be helped in blueprint currently
|
||||||
* can use the AppID with the WebAPI GetAppList request.
|
* The game name is retrieved from steamSDK AppList which isn't available to all game IDs without request, can use the AppID with the
|
||||||
|
* WebAPI GetAppList request as an alternative.
|
||||||
*/
|
*/
|
||||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI", meta = (ExpandEnumAsExecs = "Result"))
|
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI", meta = (ExpandEnumAsExecs = "Result"))
|
||||||
static void GetSteamFriendGamePlayed(const FBPUniqueNetId UniqueNetId, EBlueprintResultSwitch &Result/*, FString & GameName*/, int32 & AppID);
|
static void GetSteamFriendGamePlayed(const FBPUniqueNetId UniqueNetId, EBlueprintResultSwitch &Result, FString & GameName, int32 & AppID);
|
||||||
|
|
||||||
// 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);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Modules/ModuleManager.h"
|
#include "ModuleManager.h"
|
||||||
|
|
||||||
class AdvancedSteamSessions : public IModuleInterface
|
class AdvancedSteamSessions : public IModuleInterface
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,19 +6,13 @@
|
|||||||
#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
|
#include "OnlineSessionInterface.h"
|
||||||
#include "steam/isteamugc.h"
|
|
||||||
#include "steam/isteamremotestorage.h"
|
|
||||||
#endif
|
|
||||||
#include "Interfaces/OnlineSessionInterface.h"
|
|
||||||
|
|
||||||
// @todo Steam: Steam headers trigger secure-C-runtime warnings in Visual C++. Rather than mess with _CRT_SECURE_NO_WARNINGS, we'll just
|
// @todo Steam: Steam headers trigger secure-C-runtime warnings in Visual C++. Rather than mess with _CRT_SECURE_NO_WARNINGS, we'll just
|
||||||
// disable the warnings locally. Remove when this is fixed in the SDK
|
// disable the warnings locally. Remove when this is fixed in the SDK
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:4996)
|
#pragma warning(disable:4996)
|
||||||
// #TODO check back on this at some point
|
|
||||||
#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
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
@@ -26,18 +20,8 @@
|
|||||||
#pragma push_macro("ARRAY_COUNT")
|
#pragma push_macro("ARRAY_COUNT")
|
||||||
#undef ARRAY_COUNT
|
#undef ARRAY_COUNT
|
||||||
|
|
||||||
#if USING_CODE_ANALYSIS
|
|
||||||
MSVC_PRAGMA(warning(push))
|
|
||||||
MSVC_PRAGMA(warning(disable : ALL_CODE_ANALYSIS_WARNINGS))
|
|
||||||
#endif // USING_CODE_ANALYSIS
|
|
||||||
|
|
||||||
#include <steam/steam_api.h>
|
#include <steam/steam_api.h>
|
||||||
|
|
||||||
#if USING_CODE_ANALYSIS
|
|
||||||
MSVC_PRAGMA(warning(pop))
|
|
||||||
#endif // USING_CODE_ANALYSIS
|
|
||||||
|
|
||||||
|
|
||||||
#pragma pop_macro("ARRAY_COUNT")
|
#pragma pop_macro("ARRAY_COUNT")
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -207,22 +191,11 @@ struct FBPSteamWorkshopItemDetails
|
|||||||
GENERATED_USTRUCT_BODY()
|
GENERATED_USTRUCT_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FBPSteamWorkshopItemDetails()
|
FBPSteamWorkshopItemDetails()
|
||||||
{
|
{
|
||||||
ResultOfRequest = FBPSteamResult::k_EResultOK;
|
|
||||||
FileType = FBPWorkshopFileType::k_EWorkshopFileTypeMax;
|
|
||||||
CreatorAppID = 0;
|
|
||||||
ConsumerAppID = 0;
|
|
||||||
VotesUp = 0;
|
|
||||||
VotesDown = 0;
|
|
||||||
CalculatedScore = 0.f;
|
|
||||||
bBanned = false;
|
|
||||||
bAcceptedForUse = false;
|
|
||||||
bTagsTruncated = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#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;
|
||||||
@@ -242,26 +215,6 @@ public:
|
|||||||
CreatorSteamID = FString::Printf(TEXT("%llu"), hUGCDetails.m_ulSteamIDOwner);
|
CreatorSteamID = FString::Printf(TEXT("%llu"), hUGCDetails.m_ulSteamIDOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
FBPSteamWorkshopItemDetails(const SteamUGCDetails_t &hUGCDetails)
|
|
||||||
{
|
|
||||||
ResultOfRequest = (FBPSteamResult)hUGCDetails.m_eResult;
|
|
||||||
FileType = (FBPWorkshopFileType)hUGCDetails.m_eFileType;
|
|
||||||
CreatorAppID = (int32)hUGCDetails.m_nCreatorAppID;
|
|
||||||
ConsumerAppID = (int32)hUGCDetails.m_nConsumerAppID;
|
|
||||||
Title = FString(hUGCDetails.m_rgchTitle, k_cchPublishedDocumentTitleMax);
|
|
||||||
Description = FString(hUGCDetails.m_rgchDescription, k_cchPublishedDocumentDescriptionMax);
|
|
||||||
ItemUrl = FString(hUGCDetails.m_rgchURL, k_cchPublishedFileURLMax);
|
|
||||||
VotesUp = (int32)hUGCDetails.m_unVotesUp;
|
|
||||||
VotesDown = (int32)hUGCDetails.m_unVotesDown;
|
|
||||||
CalculatedScore = hUGCDetails.m_flScore;
|
|
||||||
bBanned = hUGCDetails.m_bBanned;
|
|
||||||
bAcceptedForUse = hUGCDetails.m_bAcceptedForUse;
|
|
||||||
bTagsTruncated = hUGCDetails.m_bTagsTruncated;
|
|
||||||
|
|
||||||
CreatorSteamID = FString::Printf(TEXT("%llu"), hUGCDetails.m_ulSteamIDOwner);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Result of obtaining the details
|
// Result of obtaining the details
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|AdvancedSteamWorkshop")
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|AdvancedSteamWorkshop")
|
||||||
FBPSteamResult ResultOfRequest;
|
FBPSteamResult ResultOfRequest;
|
||||||
|
|||||||
@@ -11,33 +11,19 @@
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:4996)
|
#pragma warning(disable:4996)
|
||||||
// #TODO check back on this at some point
|
|
||||||
#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
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
#include "OnlineSubsystemSteam.h"
|
|
||||||
|
|
||||||
#pragma push_macro("ARRAY_COUNT")
|
#pragma push_macro("ARRAY_COUNT")
|
||||||
#undef ARRAY_COUNT
|
#undef ARRAY_COUNT
|
||||||
|
|
||||||
#if USING_CODE_ANALYSIS
|
|
||||||
MSVC_PRAGMA(warning(push))
|
|
||||||
MSVC_PRAGMA(warning(disable : ALL_CODE_ANALYSIS_WARNINGS))
|
|
||||||
#endif // USING_CODE_ANALYSIS
|
|
||||||
|
|
||||||
#include <steam/steam_api.h>
|
#include <steam/steam_api.h>
|
||||||
|
|
||||||
#if USING_CODE_ANALYSIS
|
|
||||||
MSVC_PRAGMA(warning(pop))
|
|
||||||
#endif // USING_CODE_ANALYSIS
|
|
||||||
|
|
||||||
|
|
||||||
#pragma pop_macro("ARRAY_COUNT")
|
#pragma pop_macro("ARRAY_COUNT")
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// @todo Steam: See above
|
// @todo Steam: See above
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
@@ -67,8 +53,6 @@ class USteamRequestGroupOfficersCallbackProxy : public UOnlineBlueprintCallProxy
|
|||||||
{
|
{
|
||||||
GENERATED_UCLASS_BODY()
|
GENERATED_UCLASS_BODY()
|
||||||
|
|
||||||
virtual ~USteamRequestGroupOfficersCallbackProxy();
|
|
||||||
|
|
||||||
// Called when there is a successful results return
|
// Called when there is a successful results return
|
||||||
UPROPERTY(BlueprintAssignable)
|
UPROPERTY(BlueprintAssignable)
|
||||||
FBlueprintGroupOfficerDetailsDelegate OnSuccess;
|
FBlueprintGroupOfficerDetailsDelegate OnSuccess;
|
||||||
@@ -77,7 +61,7 @@ class USteamRequestGroupOfficersCallbackProxy : public UOnlineBlueprintCallProxy
|
|||||||
UPROPERTY(BlueprintAssignable)
|
UPROPERTY(BlueprintAssignable)
|
||||||
FBlueprintGroupOfficerDetailsDelegate OnFailure;
|
FBlueprintGroupOfficerDetailsDelegate OnFailure;
|
||||||
|
|
||||||
// Returns a list of steam group officers
|
// Retruns a list of steam group officers
|
||||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|SteamAPI|SteamGroups")
|
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|SteamAPI|SteamGroups")
|
||||||
static USteamRequestGroupOfficersCallbackProxy* GetSteamGroupOfficerList(UObject* WorldContextObject, FBPUniqueNetId GroupUniqueNetID);
|
static USteamRequestGroupOfficersCallbackProxy* GetSteamGroupOfficerList(UObject* WorldContextObject, FBPUniqueNetId GroupUniqueNetID);
|
||||||
|
|
||||||
@@ -86,15 +70,14 @@ class USteamRequestGroupOfficersCallbackProxy : public UOnlineBlueprintCallProxy
|
|||||||
// End of UOnlineBlueprintCallProxyBase interface
|
// End of UOnlineBlueprintCallProxyBase interface
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#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;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
FBPUniqueNetId GroupUniqueID;
|
FBPUniqueNetId GroupUniqueID;
|
||||||
UObject* WorldContextObject;
|
UObject* WorldContextObject;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,29 +12,15 @@
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:4996)
|
#pragma warning(disable:4996)
|
||||||
// #TODO check back on this at some point
|
|
||||||
#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
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
#include "OnlineSubsystemSteam.h"
|
|
||||||
|
|
||||||
#pragma push_macro("ARRAY_COUNT")
|
#pragma push_macro("ARRAY_COUNT")
|
||||||
#undef ARRAY_COUNT
|
#undef ARRAY_COUNT
|
||||||
|
|
||||||
#if USING_CODE_ANALYSIS
|
|
||||||
MSVC_PRAGMA(warning(push))
|
|
||||||
MSVC_PRAGMA(warning(disable : ALL_CODE_ANALYSIS_WARNINGS))
|
|
||||||
#endif // USING_CODE_ANALYSIS
|
|
||||||
|
|
||||||
#include <steam/steam_api.h>
|
#include <steam/steam_api.h>
|
||||||
|
|
||||||
#if USING_CODE_ANALYSIS
|
|
||||||
MSVC_PRAGMA(warning(pop))
|
|
||||||
#endif // USING_CODE_ANALYSIS
|
|
||||||
|
|
||||||
|
|
||||||
#pragma pop_macro("ARRAY_COUNT")
|
#pragma pop_macro("ARRAY_COUNT")
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -44,7 +30,6 @@ MSVC_PRAGMA(warning(pop))
|
|||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "SteamWSRequestUGCDetailsCallbackProxy.generated.h"
|
#include "SteamWSRequestUGCDetailsCallbackProxy.generated.h"
|
||||||
|
|
||||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FBlueprintWorkshopDetailsDelegate, const FBPSteamWorkshopItemDetails&, WorkShopDetails);
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FBlueprintWorkshopDetailsDelegate, const FBPSteamWorkshopItemDetails&, WorkShopDetails);
|
||||||
|
|||||||
@@ -2,6 +2,33 @@
|
|||||||
#include "AdvancedSteamFriendsLibrary.h"
|
#include "AdvancedSteamFriendsLibrary.h"
|
||||||
#include "OnlineSubSystemHeader.h"
|
#include "OnlineSubSystemHeader.h"
|
||||||
|
|
||||||
|
// This is taken directly from UE4 - OnlineSubsystemSteamPrivatePCH.h as a fix for the array_count macro
|
||||||
|
|
||||||
|
// @todo Steam: Steam headers trigger secure-C-runtime warnings in Visual C++. Rather than mess with _CRT_SECURE_NO_WARNINGS, we'll just
|
||||||
|
// disable the warnings locally. Remove when this is fixed in the SDK
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable:4996)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
|
#pragma push_macro("ARRAY_COUNT")
|
||||||
|
#undef ARRAY_COUNT
|
||||||
|
|
||||||
|
#include <steam/steam_api.h>
|
||||||
|
#include <steam/isteamapps.h>
|
||||||
|
#include <steam/isteamapplist.h>
|
||||||
|
#include <OnlineSubsystemSteamTypes.h>
|
||||||
|
#pragma pop_macro("ARRAY_COUNT")
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// @todo Steam: See above
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
//General Log
|
//General Log
|
||||||
DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
|
DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
|
||||||
|
|
||||||
@@ -11,7 +38,7 @@ DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
|
|||||||
{
|
{
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
|
||||||
return 0;
|
return 0;
|
||||||
@@ -58,7 +85,6 @@ DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
|
|||||||
|
|
||||||
void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray<FBPSteamGroupInfo> & SteamGroups)
|
void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray<FBPSteamGroupInfo> & SteamGroups)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
@@ -74,7 +100,7 @@ void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray<FBPSteamGroupInfo> & St
|
|||||||
|
|
||||||
FBPSteamGroupInfo GroupInfo;
|
FBPSteamGroupInfo GroupInfo;
|
||||||
|
|
||||||
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam2(SteamGroupID));
|
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam(SteamGroupID));
|
||||||
GroupInfo.GroupID.SetUniqueNetId(ValueID);
|
GroupInfo.GroupID.SetUniqueNetId(ValueID);
|
||||||
SteamFriends()->GetClanActivityCounts(SteamGroupID, &GroupInfo.numOnline, &GroupInfo.numInGame, &GroupInfo.numChatting);
|
SteamFriends()->GetClanActivityCounts(SteamGroupID, &GroupInfo.numOnline, &GroupInfo.numInGame, &GroupInfo.numChatting);
|
||||||
GroupInfo.GroupName = FString(UTF8_TO_TCHAR(SteamFriends()->GetClanName(SteamGroupID)));
|
GroupInfo.GroupName = FString(UTF8_TO_TCHAR(SteamFriends()->GetClanName(SteamGroupID)));
|
||||||
@@ -84,14 +110,13 @@ void UAdvancedSteamFriendsLibrary::GetSteamGroups(TArray<FBPSteamGroupInfo> & St
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendGamePlayed Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendGamePlayed Had a bad UniqueNetId!"));
|
||||||
Result = EBlueprintResultSwitch::OnFailure;
|
Result = EBlueprintResultSwitch::OnFailure;
|
||||||
@@ -109,15 +134,13 @@ void UAdvancedSteamFriendsLibrary::GetSteamFriendGamePlayed(const FBPUniqueNetId
|
|||||||
{
|
{
|
||||||
AppID = GameInfo.m_gameID.AppID();
|
AppID = GameInfo.m_gameID.AppID();
|
||||||
|
|
||||||
// Forgot this test and left it in, it is incorrect, you would need restricted access
|
char NameBuffer[512];
|
||||||
// And it would only find games in the local library anyway
|
|
||||||
/*char NameBuffer[512];
|
|
||||||
int Len = SteamAppList()->GetAppName(GameInfo.m_gameID.AppID(), NameBuffer, 512);
|
int Len = SteamAppList()->GetAppName(GameInfo.m_gameID.AppID(), NameBuffer, 512);
|
||||||
|
|
||||||
if (Len != -1) // Invalid
|
if (Len != -1) // Invalid
|
||||||
{
|
{
|
||||||
GameName = FString(UTF8_TO_TCHAR(NameBuffer));
|
GameName = FString(UTF8_TO_TCHAR(NameBuffer));
|
||||||
}*/
|
}
|
||||||
|
|
||||||
Result = EBlueprintResultSwitch::OnSuccess;
|
Result = EBlueprintResultSwitch::OnSuccess;
|
||||||
return;
|
return;
|
||||||
@@ -133,7 +156,7 @@ int32 UAdvancedSteamFriendsLibrary::GetFriendSteamLevel(const FBPUniqueNetId Uni
|
|||||||
{
|
{
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("IsAFriend Had a bad UniqueNetId!"));
|
||||||
return 0;
|
return 0;
|
||||||
@@ -154,7 +177,7 @@ FString UAdvancedSteamFriendsLibrary::GetSteamPersonaName(const FBPUniqueNetId U
|
|||||||
{
|
{
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamPersonaName Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamPersonaName Had a bad UniqueNetId!"));
|
||||||
return FString(TEXT(""));
|
return FString(TEXT(""));
|
||||||
@@ -174,7 +197,7 @@ FString UAdvancedSteamFriendsLibrary::GetSteamPersonaName(const FBPUniqueNetId U
|
|||||||
FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FString SteamID64)
|
FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FString SteamID64)
|
||||||
{
|
{
|
||||||
FBPUniqueNetId netId;
|
FBPUniqueNetId netId;
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!(SteamID64.Len() > 0))
|
if (!(SteamID64.Len() > 0))
|
||||||
{
|
{
|
||||||
@@ -185,7 +208,7 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FStri
|
|||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
// Already does the conversion
|
// Already does the conversion
|
||||||
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam2(SteamID64));
|
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam(SteamID64));
|
||||||
//FCString::Atoi64(*SteamID64));
|
//FCString::Atoi64(*SteamID64));
|
||||||
|
|
||||||
netId.SetUniqueNetId(ValueID);
|
netId.SetUniqueNetId(ValueID);
|
||||||
@@ -196,25 +219,10 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FStri
|
|||||||
return netId;
|
return netId;
|
||||||
}
|
}
|
||||||
|
|
||||||
FBPUniqueNetId UAdvancedSteamFriendsLibrary::GetLocalSteamIDFromSteam()
|
|
||||||
{
|
|
||||||
FBPUniqueNetId netId;
|
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
|
||||||
if (SteamAPI_Init())
|
|
||||||
{
|
|
||||||
TSharedPtr<const FUniqueNetId> SteamID(new const FUniqueNetIdSteam2(SteamUser()->GetSteamID()));
|
|
||||||
netId.SetUniqueNetId(SteamID);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return netId;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly)
|
bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly)
|
||||||
{
|
{
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("RequestSteamFriendInfo Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("RequestSteamFriendInfo Had a bad UniqueNetId!"));
|
||||||
return false;
|
return false;
|
||||||
@@ -232,33 +240,10 @@ bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId U
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool UAdvancedSteamFriendsLibrary::OpenSteamUserOverlay(const FBPUniqueNetId UniqueNetId, ESteamUserOverlayType DialogType)
|
|
||||||
{
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
|
||||||
{
|
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("OpenSteamUserOverlay Had a bad UniqueNetId!"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SteamAPI_Init())
|
|
||||||
{
|
|
||||||
uint64 id = *((uint64*)UniqueNetId.UniqueNetId->GetBytes());
|
|
||||||
FString DialogName = EnumToString("ESteamUserOverlayType", (uint8)DialogType);
|
|
||||||
SteamFriends()->ActivateGameOverlayToUser(TCHAR_TO_ANSI(*DialogName), id);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#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
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid() || UniqueNetId.UniqueNetId->GetType() != STEAM_SUBSYSTEM)
|
if (!UniqueNetId.IsValid() || !UniqueNetId.UniqueNetId->IsValid())
|
||||||
{
|
{
|
||||||
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendAvatar Had a bad UniqueNetId!"));
|
UE_LOG(AdvancedSteamFriendsLog, Warning, TEXT("GetSteamFriendAvatar Had a bad UniqueNetId!"));
|
||||||
Result = EBlueprintAsyncResultSwitch::OnFailure;
|
Result = EBlueprintAsyncResultSwitch::OnFailure;
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
// 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 "UObject/CoreOnline.h"
|
|
||||||
#include "AdvancedSteamFriendsLibrary.h"
|
|
||||||
#include "OnlineSubSystemHeader.h"
|
#include "OnlineSubSystemHeader.h"
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
|
||||||
#include "steam/isteamfriends.h"
|
|
||||||
#endif
|
|
||||||
//#include "OnlineSubsystemSteamTypes.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// UEndSessionCallbackProxy
|
// UEndSessionCallbackProxy
|
||||||
@@ -17,9 +11,6 @@ USteamRequestGroupOfficersCallbackProxy::USteamRequestGroupOfficersCallbackProxy
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
USteamRequestGroupOfficersCallbackProxy::~USteamRequestGroupOfficersCallbackProxy()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
USteamRequestGroupOfficersCallbackProxy* USteamRequestGroupOfficersCallbackProxy::GetSteamGroupOfficerList(UObject* WorldContextObject, FBPUniqueNetId GroupUniqueNetID)
|
USteamRequestGroupOfficersCallbackProxy* USteamRequestGroupOfficersCallbackProxy::GetSteamGroupOfficerList(UObject* WorldContextObject, FBPUniqueNetId GroupUniqueNetID)
|
||||||
{
|
{
|
||||||
@@ -36,7 +27,7 @@ void USteamRequestGroupOfficersCallbackProxy::Activate()
|
|||||||
{
|
{
|
||||||
uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes());
|
uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes());
|
||||||
SteamAPICall_t hSteamAPICall = SteamFriends()->RequestClanOfficerList(id);
|
SteamAPICall_t hSteamAPICall = SteamFriends()->RequestClanOfficerList(id);
|
||||||
|
|
||||||
m_callResultGroupOfficerRequestDetails.Set(hSteamAPICall, this, &USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails);
|
m_callResultGroupOfficerRequestDetails.Set(hSteamAPICall, this, &USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -45,24 +36,15 @@ void USteamRequestGroupOfficersCallbackProxy::Activate()
|
|||||||
OnFailure.Broadcast(EmptyArray);
|
OnFailure.Broadcast(EmptyArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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));
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
if (bIOFailure || !pResult || !pResult->m_bSuccess)
|
if (bIOFailure || !pResult || !pResult->m_bSuccess)
|
||||||
{
|
{
|
||||||
if (SteamSubsystem != nullptr)
|
OnFailure.Broadcast(OfficerArray);
|
||||||
{
|
|
||||||
SteamSubsystem->ExecuteNextTick([this]()
|
|
||||||
{
|
|
||||||
TArray<FBPSteamGroupOfficer> FailureArray;
|
|
||||||
OnFailure.Broadcast(FailureArray);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//OnFailure.Broadcast(OfficerArray);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +57,7 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
|
|||||||
|
|
||||||
Officer.bIsOwner = true;
|
Officer.bIsOwner = true;
|
||||||
|
|
||||||
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam2(ClanOwner));
|
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam(ClanOwner));
|
||||||
Officer.OfficerUniqueNetID.SetUniqueNetId(ValueID);
|
Officer.OfficerUniqueNetID.SetUniqueNetId(ValueID);
|
||||||
OfficerArray.Add(Officer);
|
OfficerArray.Add(Officer);
|
||||||
|
|
||||||
@@ -85,37 +67,17 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
|
|||||||
|
|
||||||
Officer.bIsOwner = false;
|
Officer.bIsOwner = false;
|
||||||
|
|
||||||
TSharedPtr<const FUniqueNetId> newValueID(new const FUniqueNetIdSteam2(OfficerSteamID));
|
TSharedPtr<const FUniqueNetId> newValueID(new const FUniqueNetIdSteam(OfficerSteamID));
|
||||||
Officer.OfficerUniqueNetID.SetUniqueNetId(newValueID);
|
Officer.OfficerUniqueNetID.SetUniqueNetId(newValueID);
|
||||||
|
|
||||||
OfficerArray.Add(Officer);
|
OfficerArray.Add(Officer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SteamSubsystem != nullptr)
|
OnSuccess.Broadcast(OfficerArray);
|
||||||
{
|
|
||||||
SteamSubsystem->ExecuteNextTick([OfficerArray, this]()
|
|
||||||
{
|
|
||||||
OnSuccess.Broadcast(OfficerArray);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//OnSuccess.Broadcast(OfficerArray);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
#endif
|
||||||
{
|
|
||||||
if (SteamSubsystem != nullptr)
|
|
||||||
{
|
|
||||||
SteamSubsystem->ExecuteNextTick([this]()
|
|
||||||
{
|
|
||||||
TArray<FBPSteamGroupOfficer> FailureArray;
|
|
||||||
OnFailure.Broadcast(FailureArray);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Should never hit this anyway
|
OnFailure.Broadcast(OfficerArray);
|
||||||
//OnFailure.Broadcast(OfficerArray);
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
#include "SteamWSRequestUGCDetailsCallbackProxy.h"
|
#include "SteamWSRequestUGCDetailsCallbackProxy.h"
|
||||||
#include "OnlineSubSystemHeader.h"
|
#include "OnlineSubSystemHeader.h"
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
|
||||||
#include "steam/isteamugc.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// UEndSessionCallbackProxy
|
// UEndSessionCallbackProxy
|
||||||
@@ -49,53 +46,26 @@ void USteamWSRequestUGCDetailsCallbackProxy::Activate()
|
|||||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
}
|
}
|
||||||
|
|
||||||
#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));
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0)
|
if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0)
|
||||||
{
|
{
|
||||||
if (SteamSubsystem != nullptr)
|
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
{
|
|
||||||
SteamSubsystem->ExecuteNextTick([this]()
|
|
||||||
{
|
|
||||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (SteamAPI_Init())
|
if (SteamAPI_Init())
|
||||||
{
|
{
|
||||||
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)
|
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||||
{
|
|
||||||
SteamSubsystem->ExecuteNextTick([Details, this]()
|
|
||||||
{
|
|
||||||
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
#endif
|
||||||
{
|
|
||||||
if (SteamSubsystem != nullptr)
|
|
||||||
{
|
|
||||||
SteamSubsystem->ExecuteNextTick([this]()
|
|
||||||
{
|
|
||||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Not needed, should never hit here
|
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1 @@
|
|||||||
### How do I use it? ###
|
Readme and documentation will be worked on soon
|
||||||
|
|
||||||
**KantanDocGen Automatic Documentation ([KantanDocGen](http://kantandev.com/free/kantan-doc-gen))**
|
|
||||||
|
|
||||||
**[AdvancedSessions](https://mordentral.bitbucket.io/AdvancedSessions/Advanced)**
|
|
||||||
|
|
||||||
**[AdvancedSteamSessions](https://mordentral.bitbucket.io/AdvancedSteamSessions/Advanced)**
|
|
||||||
Reference in New Issue
Block a user