Added more exclusions that were missing so that this module works with android

Former-commit-id: c11af9a589737f9ae482472c160a930326dc6b50
This commit is contained in:
morden
2019-08-04 15:43:13 -04:00
parent 54026b637d
commit 1c156a6f45
3 changed files with 143 additions and 136 deletions

View File

@@ -6,6 +6,8 @@
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Online.h"
#include "OnlineSubsystem.h"
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
#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
@@ -22,16 +24,16 @@
#pragma push_macro("ARRAY_COUNT")
#undef ARRAY_COUNT
#if USING_CODE_ANALYSIS
MSVC_PRAGMA(warning(push))
MSVC_PRAGMA(warning(disable : ALL_CODE_ANALYSIS_WARNINGS))
#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
#if USING_CODE_ANALYSIS
MSVC_PRAGMA(warning(pop))
#endif // USING_CODE_ANALYSIS
#pragma pop_macro("ARRAY_COUNT")
@@ -203,6 +205,7 @@ struct FBPSteamWorkshopItemDetails
GENERATED_USTRUCT_BODY()
public:
FBPSteamWorkshopItemDetails()
{
ResultOfRequest = FBPSteamResult::k_EResultOK;
@@ -217,6 +220,7 @@ public:
bTagsTruncated = false;
}
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
FBPSteamWorkshopItemDetails(SteamUGCDetails_t &hUGCDetails)
{
ResultOfRequest = (FBPSteamResult)hUGCDetails.m_eResult;
@@ -254,6 +258,7 @@ public:
CreatorSteamID = FString::Printf(TEXT("%llu"), hUGCDetails.m_ulSteamIDOwner);
}
#endif
// Result of obtaining the details
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Online|AdvancedSteamWorkshop")

View File

@@ -4,6 +4,8 @@
#include "UObject/CoreOnline.h"
#include "AdvancedSteamFriendsLibrary.h"
#include "OnlineSubSystemHeader.h"
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
#endif
//#include "OnlineSubsystemSteamTypes.h"
//////////////////////////////////////////////////////////////////////////
@@ -27,13 +29,13 @@ USteamRequestGroupOfficersCallbackProxy* USteamRequestGroupOfficersCallbackProxy
}
void USteamRequestGroupOfficersCallbackProxy::Activate()
{
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
if (SteamAPI_Init())
{
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
if (SteamAPI_Init())
{
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);
return;
}
@@ -42,78 +44,77 @@ void USteamRequestGroupOfficersCallbackProxy::Activate()
OnFailure.Broadcast(EmptyArray);
}
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)
{
if (SteamSubsystem != nullptr)
{
SteamSubsystem->ExecuteNextTick([this]()
{
TArray<FBPSteamGroupOfficer> FailureArray;
OnFailure.Broadcast(FailureArray);
});
}
//OnFailure.Broadcast(OfficerArray);
return;
}
if (SteamAPI_Init())
{
uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes());
FBPSteamGroupOfficer Officer;
CSteamID ClanOwner = SteamFriends()->GetClanOwner(id);
Officer.bIsOwner = true;
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam2(ClanOwner));
Officer.OfficerUniqueNetID.SetUniqueNetId(ValueID);
OfficerArray.Add(Officer);
for (int i = 0; i < pResult->m_cOfficers; i++)
{
CSteamID OfficerSteamID = SteamFriends()->GetClanOfficerByIndex(id, i);
Officer.bIsOwner = false;
TSharedPtr<const FUniqueNetId> newValueID(new const FUniqueNetIdSteam2(OfficerSteamID));
Officer.OfficerUniqueNetID.SetUniqueNetId(newValueID);
OfficerArray.Add(Officer);
}
if (SteamSubsystem != nullptr)
{
SteamSubsystem->ExecuteNextTick([OfficerArray, this]()
{
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);
}
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanOfficerListResponse_t *pResult, bool bIOFailure)
{
TArray<FBPSteamGroupOfficer> OfficerArray;
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);
return;
}
if (SteamAPI_Init())
{
uint64 id = *((uint64*)GroupUniqueID.UniqueNetId->GetBytes());
FBPSteamGroupOfficer Officer;
CSteamID ClanOwner = SteamFriends()->GetClanOwner(id);
Officer.bIsOwner = true;
TSharedPtr<const FUniqueNetId> ValueID(new const FUniqueNetIdSteam2(ClanOwner));
Officer.OfficerUniqueNetID.SetUniqueNetId(ValueID);
OfficerArray.Add(Officer);
for (int i = 0; i < pResult->m_cOfficers; i++)
{
CSteamID OfficerSteamID = SteamFriends()->GetClanOfficerByIndex(id, i);
Officer.bIsOwner = false;
TSharedPtr<const FUniqueNetId> newValueID(new const FUniqueNetIdSteam2(OfficerSteamID));
Officer.OfficerUniqueNetID.SetUniqueNetId(newValueID);
OfficerArray.Add(Officer);
}
if (SteamSubsystem != nullptr)
{
SteamSubsystem->ExecuteNextTick([OfficerArray, this]()
{
OnSuccess.Broadcast(OfficerArray);
});
}
//OnSuccess.Broadcast(OfficerArray);
return;
}
else
{
if (SteamSubsystem != nullptr)
{
SteamSubsystem->ExecuteNextTick([this]()
{
TArray<FBPSteamGroupOfficer> FailureArray;
OnFailure.Broadcast(FailureArray);
});
}
}
// Should never hit this anyway
//OnFailure.Broadcast(OfficerArray);
}
#endif

View File

@@ -2,6 +2,8 @@
#include "SteamWSRequestUGCDetailsCallbackProxy.h"
#include "OnlineSubSystemHeader.h"
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
#endif
//////////////////////////////////////////////////////////////////////////
// UEndSessionCallbackProxy
@@ -21,13 +23,13 @@ USteamWSRequestUGCDetailsCallbackProxy* USteamWSRequestUGCDetailsCallbackProxy::
}
void USteamWSRequestUGCDetailsCallbackProxy::Activate()
{
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
if (SteamAPI_Init())
{
// #TODO: Support arrays instead in the future?
UGCQueryHandle_t hQueryHandle = SteamUGC()->CreateQueryUGCDetailsRequest((PublishedFileId_t *)&WorkShopID.SteamWorkshopID, 1);
// #TODO: add search settings here by calling into the handle?
{
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
if (SteamAPI_Init())
{
// #TODO: Support arrays instead in the future?
UGCQueryHandle_t hQueryHandle = SteamUGC()->CreateQueryUGCDetailsRequest((PublishedFileId_t *)&WorkShopID.SteamWorkshopID, 1);
// #TODO: add search settings here by calling into the handle?
SteamAPICall_t hSteamAPICall = SteamUGC()->SendQueryUGCRequest(hQueryHandle);
// Need to release the query
@@ -46,54 +48,53 @@ void USteamWSRequestUGCDetailsCallbackProxy::Activate()
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
}
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)
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQueryCompleted_t *pResult, bool bIOFailure)
{
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());
return;
}
if (SteamAPI_Init())
{
SteamUGCDetails_t Details;
if (SteamUGC()->GetQueryUGCResult(pResult->m_handle, 0, &Details))
{
SteamSubsystem->ExecuteNextTick([this]()
{
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
});
}
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
return;
}
if (SteamAPI_Init())
{
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));
return;
}
}
else
{
SteamSubsystem->ExecuteNextTick([Details, this]()
{
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());
}
{
SteamSubsystem->ExecuteNextTick([this]()
{
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
});
}
}
// Not needed, should never hit here
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
}
#endif