mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-26 18:04:07 +00:00
Compare commits
15 Commits
4.20_Locke
...
4.22_Locke
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95044826af | ||
|
|
b043ad1cf0 | ||
|
|
4c4de8e536 | ||
|
|
60d1d272a5 | ||
|
|
c3f889c9c5 | ||
|
|
2e93c6095a | ||
|
|
6007506189 | ||
|
|
0952d9b18a | ||
|
|
438d0a69ba | ||
|
|
85e9b54fab | ||
|
|
ba28fccfe0 | ||
|
|
d71aaede8d | ||
|
|
38b5c96cbd | ||
|
|
ad745512ac | ||
|
|
ce7d8b1bf3 |
@@ -2,8 +2,8 @@
|
||||
"FileVersion" : 3,
|
||||
|
||||
"FriendlyName" : "Advanced Sessions",
|
||||
"Version" : 4.20,
|
||||
"VersionName": "4.20",
|
||||
"Version" : 4.22,
|
||||
"VersionName": "4.22",
|
||||
"Description" : "Adds new blueprint functions to handle more advanced session operations.",
|
||||
"Category" : "Advanced Sessions Plugin",
|
||||
"CreatedBy" : "Joshua Statzer",
|
||||
|
||||
@@ -38,16 +38,16 @@ public:
|
||||
static void GetExtraSettings(FBlueprintSessionResult SessionResult, TArray<FSessionPropertyKeyPair> & ExtraSettings);
|
||||
|
||||
// Get the current session state
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo")
|
||||
static void GetSessionState(EBPOnlineSessionState &SessionState);
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (WorldContext = "WorldContextObject"))
|
||||
static void GetSessionState(UObject* WorldContextObject, EBPOnlineSessionState &SessionState);
|
||||
|
||||
// Get the current session settings
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "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);
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "Result", WorldContext = "WorldContextObject"))
|
||||
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);
|
||||
|
||||
// Check if someone is in the current session
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo")
|
||||
static void IsPlayerInSession(const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession);
|
||||
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (WorldContext = "WorldContextObject"))
|
||||
static void IsPlayerInSession(UObject* WorldContextObject, const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession);
|
||||
|
||||
// Make a literal session search parameter
|
||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo|Literals")
|
||||
@@ -60,6 +60,14 @@ public:
|
||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
||||
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
|
||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
|
||||
static void GetCurrentUniqueBuildID(int32 &UniqueBuildId);
|
||||
|
||||
@@ -124,7 +124,7 @@ void UAdvancedExternalUILibrary::ShowInviteUI(APlayerController *PlayerControlle
|
||||
return;
|
||||
}
|
||||
|
||||
ExternalUIInterface->ShowInviteUI(Player->GetControllerId(), GameSessionName);
|
||||
ExternalUIInterface->ShowInviteUI(Player->GetControllerId(), NAME_GameSession);
|
||||
Result = EBlueprintResultSwitch::OnSuccess;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ UAdvancedFriendsGameInstance::UAdvancedFriendsGameInstance(const FObjectInitiali
|
||||
|
||||
void UAdvancedFriendsGameInstance::Shutdown()
|
||||
{
|
||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());
|
||||
|
||||
if (!SessionInterface.IsValid())
|
||||
{
|
||||
@@ -39,7 +39,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
||||
|
||||
if (bEnableTalkingStatusDelegate)
|
||||
{
|
||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(GetWorld());
|
||||
|
||||
if (VoiceInterface.IsValid())
|
||||
{
|
||||
@@ -52,7 +52,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(GetWorld());
|
||||
|
||||
if (IdentityInterface.IsValid())
|
||||
{
|
||||
@@ -69,7 +69,7 @@ void UAdvancedFriendsGameInstance::Shutdown()
|
||||
|
||||
void UAdvancedFriendsGameInstance::Init()
|
||||
{
|
||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();//OnlineSub->GetSessionInterface();
|
||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(GetWorld());//OnlineSub->GetSessionInterface();
|
||||
|
||||
if (SessionInterface.IsValid())
|
||||
{
|
||||
@@ -90,7 +90,7 @@ void UAdvancedFriendsGameInstance::Init()
|
||||
// Beginning work on the voice interface
|
||||
if (bEnableTalkingStatusDelegate)
|
||||
{
|
||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface();
|
||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(GetWorld());
|
||||
|
||||
if (VoiceInterface.IsValid())
|
||||
{
|
||||
@@ -103,7 +103,7 @@ void UAdvancedFriendsGameInstance::Init()
|
||||
}
|
||||
}
|
||||
|
||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface();
|
||||
IOnlineIdentityPtr IdentityInterface = Online::GetIdentityInterface(GetWorld());
|
||||
|
||||
if (IdentityInterface.IsValid())
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ void UAdvancedFriendsLibrary::SendSessionInviteToFriends(APlayerController *Play
|
||||
List.Add(val);
|
||||
}
|
||||
|
||||
if (SessionInterface->SendSessionInviteToFriends(Player->GetControllerId(), GameSessionName, List))
|
||||
if (SessionInterface->SendSessionInviteToFriends(Player->GetControllerId(), NAME_GameSession, List))
|
||||
{
|
||||
Result = EBlueprintResultSwitch::OnSuccess;
|
||||
return;
|
||||
@@ -94,7 +94,7 @@ void UAdvancedFriendsLibrary::SendSessionInviteToFriend(APlayerController *Playe
|
||||
return;
|
||||
}
|
||||
|
||||
if (SessionInterface->SendSessionInviteToFriend(Player->GetControllerId(), GameSessionName, *FriendUniqueNetId.GetUniqueNetId()))
|
||||
if (SessionInterface->SendSessionInviteToFriend(Player->GetControllerId(), NAME_GameSession, *FriendUniqueNetId.GetUniqueNetId()))
|
||||
{
|
||||
Result = EBlueprintResultSwitch::OnSuccess;
|
||||
return;
|
||||
|
||||
@@ -12,6 +12,46 @@ bool UAdvancedSessionsLibrary::IsValidSession(const FBlueprintSessionResult & Se
|
||||
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)
|
||||
{
|
||||
UniqueBuildId = GetBuildUniqueId();
|
||||
@@ -87,9 +127,10 @@ void UAdvancedSessionsLibrary::GetExtraSettings(FBlueprintSessionResult SessionR
|
||||
}
|
||||
}
|
||||
|
||||
void UAdvancedSessionsLibrary::GetSessionState(EBPOnlineSessionState &SessionState)
|
||||
void UAdvancedSessionsLibrary::GetSessionState(UObject* WorldContextObject, EBPOnlineSessionState &SessionState)
|
||||
{
|
||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
||||
|
||||
if (!SessionInterface.IsValid())
|
||||
{
|
||||
@@ -97,12 +138,13 @@ void UAdvancedSessionsLibrary::GetSessionState(EBPOnlineSessionState &SessionSta
|
||||
return;
|
||||
}
|
||||
|
||||
SessionState = ((EBPOnlineSessionState)SessionInterface->GetSessionState(GameSessionName));
|
||||
SessionState = ((EBPOnlineSessionState)SessionInterface->GetSessionState(NAME_GameSession));
|
||||
}
|
||||
|
||||
void UAdvancedSessionsLibrary::GetSessionSettings(int32 &NumConnections, int32 &NumPrivateConnections, bool &bIsLAN, bool &bIsDedicated, bool &bAllowInvites, bool &bAllowJoinInProgress, bool &bIsAnticheatEnabled, int32 &BuildUniqueID, TArray<FSessionPropertyKeyPair> &ExtraSettings, EBlueprintResultSwitch &Result)
|
||||
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)
|
||||
{
|
||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
||||
|
||||
if (!SessionInterface.IsValid())
|
||||
{
|
||||
@@ -111,7 +153,7 @@ void UAdvancedSessionsLibrary::GetSessionSettings(int32 &NumConnections, int32 &
|
||||
return;
|
||||
}
|
||||
|
||||
FOnlineSessionSettings* settings = SessionInterface->GetSessionSettings(GameSessionName);
|
||||
FOnlineSessionSettings* settings = SessionInterface->GetSessionSettings(NAME_GameSession);
|
||||
if (!settings)
|
||||
{
|
||||
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetSessionSettings couldn't get the session settings!"));
|
||||
@@ -140,9 +182,10 @@ void UAdvancedSessionsLibrary::GetSessionSettings(int32 &NumConnections, int32 &
|
||||
Result = EBlueprintResultSwitch::OnSuccess;
|
||||
}
|
||||
|
||||
void UAdvancedSessionsLibrary::IsPlayerInSession(const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession)
|
||||
void UAdvancedSessionsLibrary::IsPlayerInSession(UObject* WorldContextObject, const FBPUniqueNetId &PlayerToCheck, bool &bIsInSession)
|
||||
{
|
||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface();
|
||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
||||
IOnlineSessionPtr SessionInterface = Online::GetSessionInterface(World);
|
||||
|
||||
if (!SessionInterface.IsValid())
|
||||
{
|
||||
@@ -151,7 +194,7 @@ void UAdvancedSessionsLibrary::IsPlayerInSession(const FBPUniqueNetId &PlayerToC
|
||||
return;
|
||||
}
|
||||
|
||||
bIsInSession = SessionInterface->IsPlayerInSession(GameSessionName, *PlayerToCheck.GetUniqueNetId());
|
||||
bIsInSession = SessionInterface->IsPlayerInSession(NAME_GameSession, *PlayerToCheck.GetUniqueNetId());
|
||||
}
|
||||
|
||||
FSessionsSearchSetting UAdvancedSessionsLibrary::MakeLiteralSessionSearchProperty(FSessionPropertyKeyPair SessionSearchProperty, EOnlineComparisonOpRedux ComparisonOp)
|
||||
|
||||
@@ -83,7 +83,7 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
|
||||
{
|
||||
if (PlayerControllerWeakPtr.IsValid() && Helper.UserID.IsValid())
|
||||
{
|
||||
Sessions->CreateSession(*Helper.UserID, GameSessionName, Settings);
|
||||
Sessions->CreateSession(*Helper.UserID, NAME_GameSession, Settings);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -95,7 +95,7 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
|
||||
}
|
||||
}
|
||||
else
|
||||
Sessions->CreateSession(0, GameSessionName, Settings);
|
||||
Sessions->CreateSession(0, NAME_GameSession, Settings);
|
||||
|
||||
// OnCreateCompleted will get called, nothing more to do now
|
||||
return;
|
||||
@@ -125,7 +125,7 @@ void UCreateSessionCallbackProxyAdvanced::OnCreateCompleted(FName SessionName, b
|
||||
if (bWasSuccessful)
|
||||
{
|
||||
StartCompleteDelegateHandle = Sessions->AddOnStartSessionCompleteDelegate_Handle(StartCompleteDelegate);
|
||||
Sessions->StartSession(GameSessionName);
|
||||
Sessions->StartSession(NAME_GameSession);
|
||||
|
||||
// OnStartCompleted will get called, nothing more to do now
|
||||
return;
|
||||
|
||||
@@ -30,12 +30,12 @@ void UEndSessionCallbackProxy::Activate()
|
||||
auto Sessions = Helper.OnlineSub->GetSessionInterface();
|
||||
if (Sessions.IsValid())
|
||||
{
|
||||
FNamedOnlineSession* Session = Sessions->GetNamedSession(GameSessionName);
|
||||
FNamedOnlineSession* Session = Sessions->GetNamedSession(NAME_GameSession);
|
||||
if (Session &&
|
||||
Session->SessionState == EOnlineSessionState::InProgress)
|
||||
{
|
||||
DelegateHandle = Sessions->AddOnEndSessionCompleteDelegate_Handle(Delegate);
|
||||
Sessions->EndSession(GameSessionName);
|
||||
Sessions->EndSession(NAME_GameSession);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ void UFindFriendSessionCallbackProxy::Activate()
|
||||
return;
|
||||
}
|
||||
|
||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||
|
||||
if (Sessions.IsValid())
|
||||
{
|
||||
@@ -71,7 +71,7 @@ void UFindFriendSessionCallbackProxy::Activate()
|
||||
|
||||
void UFindFriendSessionCallbackProxy::OnFindFriendSessionCompleted(int32 LocalPlayer, bool bWasSuccessful, const TArray<FOnlineSessionSearchResult>& SessionInfo)
|
||||
{
|
||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||
|
||||
if (Sessions.IsValid())
|
||||
Sessions->ClearOnFindFriendSessionCompleteDelegate_Handle(LocalPlayer, FindFriendSessionCompleteDelegateHandle);
|
||||
|
||||
@@ -30,7 +30,7 @@ UUpdateSessionCallbackProxyAdvanced* UUpdateSessionCallbackProxyAdvanced::Update
|
||||
void UUpdateSessionCallbackProxyAdvanced::Activate()
|
||||
{
|
||||
|
||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||
|
||||
if (Sessions.IsValid())
|
||||
{
|
||||
@@ -42,8 +42,8 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
||||
}
|
||||
|
||||
// This gets the actual session itself
|
||||
//FNamedOnlineSession * curSession = Sessions->GetNamedSession(GameSessionName);
|
||||
FOnlineSessionSettings* Settings = Sessions->GetSessionSettings(GameSessionName);
|
||||
//FNamedOnlineSession * curSession = Sessions->GetNamedSession(NAME_GameSession);
|
||||
FOnlineSessionSettings* Settings = Sessions->GetSessionSettings(NAME_GameSession);
|
||||
|
||||
if (!Settings)
|
||||
{
|
||||
@@ -85,7 +85,7 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
||||
}
|
||||
}
|
||||
|
||||
Sessions->UpdateSession(GameSessionName, *Settings, bRefreshOnlineData);
|
||||
Sessions->UpdateSession(NAME_GameSession, *Settings, bRefreshOnlineData);
|
||||
|
||||
// OnUpdateCompleted will get called, nothing more to do now
|
||||
return;
|
||||
@@ -101,7 +101,7 @@ void UUpdateSessionCallbackProxyAdvanced::Activate()
|
||||
|
||||
void UUpdateSessionCallbackProxyAdvanced::OnUpdateCompleted(FName SessionName, bool bWasSuccessful)
|
||||
{
|
||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface();
|
||||
IOnlineSessionPtr Sessions = Online::GetSessionInterface(GetWorld());
|
||||
if (Sessions.IsValid())
|
||||
{
|
||||
Sessions->ClearOnUpdateSessionCompleteDelegate_Handle(OnUpdateSessionCompleteDelegateHandle);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"FileVersion" : 3,
|
||||
|
||||
"FriendlyName" : "Advanced Steam Sessions",
|
||||
"Version" : 4.20,
|
||||
"VersionName": "4.20",
|
||||
"Version" : 4.22,
|
||||
"VersionName": "4.22",
|
||||
"Description" : "Adds new blueprint functions to handle more advanced session operations in Steam. REQUIRES ADVANCED SESSIONS",
|
||||
"Category" : "Advanced Sessions Plugin",
|
||||
"CreatedBy" : "Joshua Statzer",
|
||||
|
||||
@@ -197,7 +197,8 @@ public:
|
||||
/** Needed for TMap::GetTypeHash() */
|
||||
friend uint32 GetTypeHash(const FUniqueNetIdSteam2& A)
|
||||
{
|
||||
return (uint32)(A.UniqueNetId) + ((uint32)((A.UniqueNetId) >> 32) * 23);
|
||||
return GetTypeHash(A.UniqueNetId);
|
||||
//return (uint32)(A.UniqueNetId) + ((uint32)((A.UniqueNetId) >> 32) * 23);
|
||||
}
|
||||
|
||||
/** Convenience cast to CSteamID */
|
||||
@@ -335,6 +336,10 @@ public:
|
||||
UFUNCTION(BlueprintPure, Category = "Online|AdvancedFriends|SteamAPI")
|
||||
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
|
||||
* can use the AppID with the WebAPI GetAppList request.
|
||||
*/
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "Online.h"
|
||||
#include "OnlineSubsystem.h"
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
#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
|
||||
@@ -203,11 +207,22 @@ struct FBPSteamWorkshopItemDetails
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
public:
|
||||
|
||||
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)
|
||||
{
|
||||
ResultOfRequest = (FBPSteamResult)hUGCDetails.m_eResult;
|
||||
@@ -245,6 +260,7 @@ public:
|
||||
|
||||
CreatorSteamID = FString::Printf(TEXT("%llu"), hUGCDetails.m_ulSteamIDOwner);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Result of obtaining the details
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|AdvancedSteamWorkshop")
|
||||
|
||||
@@ -196,6 +196,21 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FStri
|
||||
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)
|
||||
{
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include "UObject/CoreOnline.h"
|
||||
#include "AdvancedSteamFriendsLibrary.h"
|
||||
#include "OnlineSubSystemHeader.h"
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
#include "steam/isteamfriends.h"
|
||||
#endif
|
||||
//#include "OnlineSubsystemSteamTypes.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -42,12 +45,11 @@ void USteamRequestGroupOfficersCallbackProxy::Activate()
|
||||
OnFailure.Broadcast(EmptyArray);
|
||||
}
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanOfficerListResponse_t *pResult, bool bIOFailure)
|
||||
{
|
||||
TArray<FBPSteamGroupOfficer> OfficerArray;
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
||||
|
||||
if (bIOFailure || !pResult || !pResult->m_bSuccess)
|
||||
@@ -111,9 +113,9 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Should never hit this anyway
|
||||
//OnFailure.Broadcast(OfficerArray);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
#include "SteamWSRequestUGCDetailsCallbackProxy.h"
|
||||
#include "OnlineSubSystemHeader.h"
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
#include "steam/isteamugc.h"
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// UEndSessionCallbackProxy
|
||||
@@ -46,10 +49,9 @@ void USteamWSRequestUGCDetailsCallbackProxy::Activate()
|
||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
}
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure)
|
||||
{
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
||||
|
||||
if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0)
|
||||
@@ -91,9 +93,9 @@ void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQuer
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Not needed, should never hit here
|
||||
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user