mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-22 16:04:18 +00:00
Fixing the blueprint events being thrown in the steam callback thread.
Former-commit-id: b5726d6d0ebee9b4e173b675eb6d36aa237ebe77
This commit is contained in:
@@ -227,6 +227,25 @@ 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;
|
||||
|
@@ -17,6 +17,8 @@
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
#include "OnlineSubsystemSteam.h"
|
||||
|
||||
#pragma push_macro("ARRAY_COUNT")
|
||||
#undef ARRAY_COUNT
|
||||
|
||||
|
@@ -18,6 +18,8 @@
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
#include "OnlineSubsystemSteam.h"
|
||||
|
||||
#pragma push_macro("ARRAY_COUNT")
|
||||
#undef ARRAY_COUNT
|
||||
|
||||
|
@@ -46,10 +46,20 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
|
||||
TArray<FBPSteamGroupOfficer> OfficerArray;
|
||||
|
||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||
|
||||
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
||||
|
||||
if (bIOFailure || !pResult || !pResult->m_bSuccess)
|
||||
{
|
||||
OnFailure.Broadcast(OfficerArray);
|
||||
if (SteamSubsystem != nullptr)
|
||||
{
|
||||
SteamSubsystem->ExecuteNextTick([this]()
|
||||
{
|
||||
TArray<FBPSteamGroupOfficer> FailureArray;
|
||||
OnFailure.Broadcast(FailureArray);
|
||||
});
|
||||
}
|
||||
//OnFailure.Broadcast(OfficerArray);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -78,11 +88,31 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
|
||||
OfficerArray.Add(Officer);
|
||||
}
|
||||
|
||||
OnSuccess.Broadcast(OfficerArray);
|
||||
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
|
||||
|
||||
OnFailure.Broadcast(OfficerArray);
|
||||
// Should never hit this anyway
|
||||
//OnFailure.Broadcast(OfficerArray);
|
||||
}
|
||||
|
||||
|
@@ -49,23 +49,51 @@ void USteamWSRequestUGCDetailsCallbackProxy::Activate()
|
||||
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)
|
||||
{
|
||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
{
|
||||
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))
|
||||
{
|
||||
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||
{
|
||||
if (SteamSubsystem != nullptr)
|
||||
{
|
||||
SteamSubsystem->ExecuteNextTick([Details, this]()
|
||||
{
|
||||
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||
});
|
||||
}
|
||||
|
||||
//OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SteamSubsystem != nullptr)
|
||||
{
|
||||
SteamSubsystem->ExecuteNextTick([this]()
|
||||
{
|
||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
// Not needed, should never hit here
|
||||
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user