mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-23 00:14:24 +00:00
Fixing the blueprint events being thrown in the steam callback thread.
Former-commit-id: e333ce44217f61acd3545ea12a33a5fddcd27d98
This commit is contained in:
@@ -227,6 +227,25 @@ 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);
|
||||||
|
}
|
||||||
|
|
||||||
// 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;
|
||||||
|
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
#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
|
||||||
|
|
||||||
|
@@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#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
|
||||||
|
|
||||||
|
@@ -48,9 +48,19 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
|
|||||||
|
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
|
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
||||||
|
|
||||||
if (bIOFailure || !pResult || !pResult->m_bSuccess)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,11 +89,31 @@ void USteamRequestGroupOfficersCallbackProxy::OnRequestGroupOfficerDetails(ClanO
|
|||||||
OfficerArray.Add(Officer);
|
OfficerArray.Add(Officer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SteamSubsystem != nullptr)
|
||||||
|
{
|
||||||
|
SteamSubsystem->ExecuteNextTick([OfficerArray, this]()
|
||||||
|
{
|
||||||
OnSuccess.Broadcast(OfficerArray);
|
OnSuccess.Broadcast(OfficerArray);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//OnSuccess.Broadcast(OfficerArray);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (SteamSubsystem != nullptr)
|
||||||
|
{
|
||||||
|
SteamSubsystem->ExecuteNextTick([this]()
|
||||||
|
{
|
||||||
|
TArray<FBPSteamGroupOfficer> FailureArray;
|
||||||
|
OnFailure.Broadcast(FailureArray);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OnFailure.Broadcast(OfficerArray);
|
// Should never hit this anyway
|
||||||
|
//OnFailure.Broadcast(OfficerArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,22 +50,50 @@ void USteamWSRequestUGCDetailsCallbackProxy::OnUGCRequestUGCDetails(SteamUGCQuer
|
|||||||
{
|
{
|
||||||
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
#if PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX
|
||||||
|
|
||||||
|
FOnlineSubsystemSteam* SteamSubsystem = (FOnlineSubsystemSteam*)(IOnlineSubsystem::Get(STEAM_SUBSYSTEM));
|
||||||
|
|
||||||
if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0)
|
if (bIOFailure || !pResult || pResult->m_unNumResultsReturned <= 0)
|
||||||
|
{
|
||||||
|
if (SteamSubsystem != nullptr)
|
||||||
|
{
|
||||||
|
SteamSubsystem->ExecuteNextTick([this]()
|
||||||
{
|
{
|
||||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
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)
|
||||||
|
{
|
||||||
|
SteamSubsystem->ExecuteNextTick([Details, this]()
|
||||||
{
|
{
|
||||||
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//OnSuccess.Broadcast(FBPSteamWorkshopItemDetails(Details));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (SteamSubsystem != nullptr)
|
||||||
|
{
|
||||||
|
SteamSubsystem->ExecuteNextTick([this]()
|
||||||
|
{
|
||||||
|
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
// Not needed, should never hit here
|
||||||
|
//OnFailure.Broadcast(FBPSteamWorkshopItemDetails());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user