1 Commits

Author SHA1 Message Date
mordentral
1c3e3b143b Creating 4.16 locked branch
Former-commit-id: 79eaea35412f68ccb0723efdd4c0b87dbea279a0
2017-08-07 12:48:46 -04:00
16 changed files with 52 additions and 335 deletions

View File

@@ -2,8 +2,8 @@
"FileVersion" : 3,
"FriendlyName" : "Advanced Sessions",
"Version" : 4.17,
"VersionName": "4.17",
"Version" : 1.9,
"VersionName": "1.9",
"Description" : "Adds new blueprint functions to handle more advanced session operations.",
"Category" : "Advanced Sessions Plugin",
"CreatedBy" : "Joshua Statzer",
@@ -16,15 +16,5 @@
"Type" : "RunTime",
"LoadingPhase" : "PreDefault"
}
],
"Plugins": [
{
"Name": "OnlineSubsystem",
"Enabled": true
},
{
"Name": "OnlineSubsystemUtils",
"Enabled": true
}
]
]
}

View File

@@ -13,7 +13,7 @@
#include "Engine/GameInstance.h"
#include "OnlineSessionInterface.h"
//#include "UObjectIterator.h"
#include "UObjectIterator.h"
#include "AdvancedSessionsLibrary.generated.h"
@@ -68,25 +68,6 @@ public:
UFUNCTION(BlueprintPure, Category = "Online|AdvancedSessions|SessionInfo")
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)
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedSessions|SessionInfo", meta = (ExpandEnumAsExecs = "SearchResult"))
static void GetSessionPropertyByte(const TArray<FSessionPropertyKeyPair> & ExtraSettings, FName SettingName, ESessionSettingSearchResult &SearchResult, uint8 &SettingValue);

View File

@@ -22,31 +22,6 @@ void UAdvancedSessionsLibrary::GetUniqueBuildID(FBlueprintSessionResult SessionR
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)
{
ModifiedSettingsArray = SettingsArray;
@@ -438,14 +413,23 @@ void UAdvancedSessionsLibrary::GetPlayerName(APlayerController *PlayerController
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
UWorld* TheWorld = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
UWorld* TheWorld = GEngine->GetWorldFromContextObject(WorldContextObject);
if (!TheWorld)
{
UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetNumberOfNetworkPlayers Failed to get World()!"));
return;
}
NumNetPlayers = TheWorld->GetGameState()->PlayerArray.Num();
TArray<class APlayerState*>& PlayerArray = (TheWorld->GetGameState()->PlayerArray);
NumNetPlayers = PlayerArray.Num();
}

View File

@@ -22,7 +22,7 @@ UCancelFindSessionsCallbackProxy* UCancelFindSessionsCallbackProxy::CancelFindSe
void UCancelFindSessionsCallbackProxy::Activate()
{
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject));
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
if (Helper.IsValid())
@@ -48,7 +48,7 @@ void UCancelFindSessionsCallbackProxy::Activate()
void UCancelFindSessionsCallbackProxy::OnCompleted(bool bWasSuccessful)
{
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CancelFindSessionsCallback"), GEngine->GetWorldFromContextObject(WorldContextObject));
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
if (Helper.IsValid())

View File

@@ -35,7 +35,7 @@ UCreateSessionCallbackProxyAdvanced* UCreateSessionCallbackProxyAdvanced::Create
void UCreateSessionCallbackProxyAdvanced::Activate()
{
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSession"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSession"), GEngine->GetWorldFromContextObject(WorldContextObject));
if (PlayerControllerWeakPtr.IsValid() )
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
@@ -79,21 +79,8 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
}
if (!bDedicatedServer )
{
if (PlayerControllerWeakPtr.IsValid() && Helper.UserID.IsValid())
{
Sessions->CreateSession(*Helper.UserID, GameSessionName, Settings);
}
else
{
FFrame::KismetExecutionMessage(TEXT("Invalid Player controller when attempting to start a session"), ELogVerbosity::Warning);
Sessions->ClearOnCreateSessionCompleteDelegate_Handle(CreateCompleteDelegateHandle);
// Fail immediately
OnFailure.Broadcast();
}
}
if (!bDedicatedServer && PlayerControllerWeakPtr.IsValid() && Helper.UserID.IsValid())
Sessions->CreateSession(*Helper.UserID, GameSessionName, Settings);
else
Sessions->CreateSession(0, GameSessionName, Settings);
@@ -112,7 +99,7 @@ void UCreateSessionCallbackProxyAdvanced::Activate()
void UCreateSessionCallbackProxyAdvanced::OnCreateCompleted(FName SessionName, bool bWasSuccessful)
{
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("CreateSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject));
//Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
if (Helper.OnlineSub != nullptr)
@@ -141,8 +128,8 @@ void UCreateSessionCallbackProxyAdvanced::OnCreateCompleted(FName SessionName, b
void UCreateSessionCallbackProxyAdvanced::OnStartCompleted(FName SessionName, bool bWasSuccessful)
{
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("StartSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
//Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("StartSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject));
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
if (Helper.OnlineSub != nullptr)
{

View File

@@ -22,7 +22,7 @@ UEndSessionCallbackProxy* UEndSessionCallbackProxy::EndSession(UObject* WorldCon
void UEndSessionCallbackProxy::Activate()
{
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSession"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSession"), GEngine->GetWorldFromContextObject(WorldContextObject));
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
if (Helper.IsValid())
@@ -56,7 +56,7 @@ void UEndSessionCallbackProxy::Activate()
void UEndSessionCallbackProxy::OnCompleted(FName SessionName, bool bWasSuccessful)
{
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("EndSessionCallback"), GEngine->GetWorldFromContextObject(WorldContextObject));
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
if (Helper.IsValid())

View File

@@ -34,7 +34,7 @@ UFindSessionsCallbackProxyAdvanced* UFindSessionsCallbackProxyAdvanced::FindSess
void UFindSessionsCallbackProxyAdvanced::Activate()
{
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull));
FOnlineSubsystemBPCallHelperAdvanced Helper(TEXT("FindSessions"), GEngine->GetWorldFromContextObject(WorldContextObject));
Helper.QueryIDFromPlayerController(PlayerControllerWeakPtr.Get());
if (Helper.IsValid())
@@ -156,7 +156,7 @@ void UFindSessionsCallbackProxyAdvanced::Activate()
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());
if (!bRunSecondSearch && Helper.IsValid())
@@ -225,20 +225,13 @@ void UFindSessionsCallbackProxyAdvanced::OnCompleted(bool bSuccess)
}
}
if (Helper.IsValid() && bRunSecondSearch && ServerSearchType == EBPServerPresenceSearchType::AllServers)
if (bRunSecondSearch && ServerSearchType == EBPServerPresenceSearchType::AllServers)
{
bRunSecondSearch = false;
bIsOnSecondSearch = true;
auto Sessions = Helper.OnlineSub->GetSessionInterface();
Sessions->FindSessions(*Helper.UserID, SearchObjectDedicated.ToSharedRef());
}
else // We lost our player controller
{
if (bSuccess && SessionSearchResults.Num() > 0)
OnSuccess.Broadcast(SessionSearchResults);
else
OnFailure.Broadcast(SessionSearchResults);
}
}

View File

@@ -2,8 +2,8 @@
"FileVersion" : 3,
"FriendlyName" : "Advanced Steam Sessions",
"Version" : 4.17,
"VersionName": "4.17",
"Version" : 1.9,
"VersionName": "1.9",
"Description" : "Adds new blueprint functions to handle more advanced session operations in Steam. REQUIRES ADVANCED SESSIONS",
"Category" : "Advanced Sessions Plugin",
"CreatedBy" : "Joshua Statzer",
@@ -16,23 +16,5 @@
"Type" : "RunTime",
"LoadingPhase" : "PreDefault"
}
],
"Plugins": [
{
"Name": "AdvancedSessions",
"Enabled": true
},
{
"Name": "OnlineSubsystem",
"Enabled": true
},
{
"Name": "OnlineSubsystemUtils",
"Enabled": true
},
{
"Name": "OnlineSubsystemSteam",
"Enabled": true
}
]
]
}

View File

@@ -29,41 +29,6 @@ enum class SteamAvatarSize : uint8
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")
struct FBPSteamGroupInfo
{
@@ -104,10 +69,6 @@ public:
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
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.
UFUNCTION(BlueprintCallable, Category = "Online|AdvancedFriends|SteamAPI")
static int32 GetFriendSteamLevel(const FBPUniqueNetId UniqueNetId);

View File

@@ -13,8 +13,6 @@
#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
@@ -22,18 +20,8 @@
#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
#pragma pop_macro("ARRAY_COUNT")
#endif
@@ -227,25 +215,6 @@ public:
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);
}
// Result of obtaining the details
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|AdvancedSteamWorkshop")
FBPSteamResult ResultOfRequest;

View File

@@ -11,29 +11,15 @@
#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
#include "OnlineSubsystemSteam.h"
#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
#pragma pop_macro("ARRAY_COUNT")
#endif
@@ -67,8 +53,6 @@ class USteamRequestGroupOfficersCallbackProxy : public UOnlineBlueprintCallProxy
{
GENERATED_UCLASS_BODY()
virtual ~USteamRequestGroupOfficersCallbackProxy();
// Called when there is a successful results return
UPROPERTY(BlueprintAssignable)
FBlueprintGroupOfficerDetailsDelegate OnSuccess;
@@ -90,7 +74,6 @@ private:
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
void OnRequestGroupOfficerDetails( ClanOfficerListResponse_t *pResult, bool bIOFailure);
CCallResult<USteamRequestGroupOfficersCallbackProxy, ClanOfficerListResponse_t> m_callResultGroupOfficerRequestDetails;
#endif
private:

View File

@@ -12,29 +12,15 @@
#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
#include "OnlineSubsystemSteam.h"
#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
#pragma pop_macro("ARRAY_COUNT")
#endif
@@ -44,7 +30,6 @@ MSVC_PRAGMA(warning(pop))
#pragma warning(pop)
#endif
#include "SteamWSRequestUGCDetailsCallbackProxy.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FBlueprintWorkshopDetailsDelegate, const FBPSteamWorkshopItemDetails&, WorkShopDetails);

View File

@@ -9,8 +9,6 @@
#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
@@ -18,17 +16,7 @@
#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>
@@ -50,7 +38,7 @@ DEFINE_LOG_CATEGORY(AdvancedSteamFriendsLog);
{
#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!"));
return 0;
@@ -128,7 +116,7 @@ void UAdvancedSteamFriendsLibrary::GetSteamFriendGamePlayed(const FBPUniqueNetId
{
#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!"));
Result = EBlueprintResultSwitch::OnFailure;
@@ -168,7 +156,7 @@ int32 UAdvancedSteamFriendsLibrary::GetFriendSteamLevel(const FBPUniqueNetId Uni
{
#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!"));
return 0;
@@ -189,7 +177,7 @@ FString UAdvancedSteamFriendsLibrary::GetSteamPersonaName(const FBPUniqueNetId U
{
#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!"));
return FString(TEXT(""));
@@ -234,7 +222,7 @@ FBPUniqueNetId UAdvancedSteamFriendsLibrary::CreateSteamIDFromString(const FStri
bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId UniqueNetId, bool bRequireNameOnly)
{
#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!"));
return false;
@@ -252,33 +240,10 @@ bool UAdvancedSteamFriendsLibrary::RequestSteamFriendInfo(const FBPUniqueNetId U
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)
{
#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!"));
Result = EBlueprintAsyncResultSwitch::OnFailure;

View File

@@ -1,9 +1,7 @@
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "SteamRequestGroupOfficersCallbackProxy.h"
#include "CoreOnline.h"
#include "OnlineSubSystemHeader.h"
#include "OnlineSubsystemSteamTypes.h"
//////////////////////////////////////////////////////////////////////////
// UEndSessionCallbackProxy
@@ -13,9 +11,6 @@ USteamRequestGroupOfficersCallbackProxy::USteamRequestGroupOfficersCallbackProxy
{
}
USteamRequestGroupOfficersCallbackProxy::~USteamRequestGroupOfficersCallbackProxy()
{
}
USteamRequestGroupOfficersCallbackProxy* USteamRequestGroupOfficersCallbackProxy::GetSteamGroupOfficerList(UObject* WorldContextObject, FBPUniqueNetId GroupUniqueNetID)
{
@@ -47,19 +42,9 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
if (bIOFailure || !pResult || !pResult->m_bSuccess)
{
if (SteamSubsystem != nullptr)
{
SteamSubsystem->ExecuteNextTick([this]()
{
TArray<FBPSteamGroupOfficer> FailureArray;
OnFailure.Broadcast(FailureArray);
});
}
//OnFailure.Broadcast(OfficerArray);
OnFailure.Broadcast(OfficerArray);
return;
}
@@ -88,31 +73,11 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
OfficerArray.Add(Officer);
}
if (SteamSubsystem != nullptr)
{
SteamSubsystem->ExecuteNextTick([OfficerArray, this]()
{
OnSuccess.Broadcast(OfficerArray);
});
}
//OnSuccess.Broadcast(OfficerArray);
OnSuccess.Broadcast(OfficerArray);
return;
}
else
{
if (SteamSubsystem != nullptr)
{
SteamSubsystem->ExecuteNextTick([this]()
{
TArray<FBPSteamGroupOfficer> FailureArray;
OnFailure.Broadcast(FailureArray);
});
}
}
#endif
// Should never hit this anyway
//OnFailure.Broadcast(OfficerArray);
OnFailure.Broadcast(OfficerArray);
}

View File

@@ -50,18 +50,9 @@ void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQuer
{
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0)
{
if (SteamSubsystem != nullptr)
{
SteamSubsystem->ExecuteNextTick([this]()
{
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
});
}
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
return;
}
if (SteamAPI_Init())
@@ -69,31 +60,12 @@ void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQuer
SteamUGCDetails_t Details;
if (SteamUGC()->GetQueryUGCResult(pResult->m_handle, 0, &Details))
{
if (SteamSubsystem != nullptr)
{
SteamSubsystem->ExecuteNextTick([Details, this]()
{
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
});
}
//OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
return;
}
}
else
{
if (SteamSubsystem != nullptr)
{
SteamSubsystem->ExecuteNextTick([this]()
{
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
});
}
}
#endif
// Not needed, should never hit here
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
}