22
33#include " LootLockerServerForBlueprints.h"
44
5- #include " LootLockerServerLogger.h"
5+ #include " Runtime/Launch/Resources/Version.h"
6+ #if WITH_EDITOR && (PLATFORM_WINDOWS || PLATFORM_MAC) && ((ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >=2) || ENGINE_MAJOR_VERSION >= 6)
67#include " Blueprint/BlueprintExceptionInfo.h"
8+ #endif
9+ #include " UObject/TextProperty.h"
710#include " ServerAPI/LootLockerServerNotificationsRequest.h"
811#include " Utils/LootLockerServerUtilities.h"
912
@@ -789,7 +792,12 @@ DEFINE_FUNCTION(ULootLockerServerForBlueprints::execSendNotificationToPlayer)
789792 Stack.StepCompiledIn <FProperty>(nullptr );
790793 FProperty* ContentProperty = Stack.MostRecentProperty ;
791794 void * ContentAddress = Stack.MostRecentPropertyAddress ;
792- void * ContentContainerAddress = Stack.MostRecentPropertyContainer ;
795+ void * ContentContainerAddress =
796+ #if ((ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >=2) || ENGINE_MAJOR_VERSION >= 6)
797+ Stack.MostRecentPropertyContainer ;
798+ #else
799+ Stack.Locals ; // In editor versions < 5.2 the convenience property MostRecentPropertyContainer doesn't exist. But from my testing, when we utilize this property (for parsing value literal inputs) this is equal to Stack.Locals
800+ #endif
793801
794802 PARAM_PASSED_BY_REF (NotificationType, FStrProperty, FString);
795803 PARAM_PASSED_BY_VAL (Priority, FEnumProperty, ELootLockerServerNotificationPriority);
@@ -820,11 +828,13 @@ DEFINE_FUNCTION(ULootLockerServerForBlueprints::execSendNotificationToPlayer)
820828 {
821829 FString err = FString::Format (TEXT (" Type {0} is not supported by this node" ), { UnsupportedContentType->GetFName ().ToString () });
822830
831+ #if WITH_EDITOR && (PLATFORM_WINDOWS || PLATFORM_MAC) && ((ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >=2) || ENGINE_MAJOR_VERSION >= 6)
823832 const FBlueprintExceptionInfo ExceptionInfo (
824833 EBlueprintExceptionType::AccessViolation,
825834 FText::FromString (err)
826835 );
827836 FBlueprintCoreDelegates::ThrowScriptException (P_THIS, Stack, ExceptionInfo);
837+ #endif
828838 FLootLockerServerSendNotificationsResponse ErrorResponse = LootLockerServerResponseFactory::Error<FLootLockerServerSendNotificationsResponse>(err, LootLockerServerStaticRequestErrorStatusCodes::LL_ERROR_INVALID_INPUT);
829839 OnCompletedRequest.ExecuteIfBound (ErrorResponse);
830840 isSupportedType = false ;
@@ -845,7 +855,7 @@ DEFINE_FUNCTION(ULootLockerServerForBlueprints::execSendNotificationToPlayer)
845855 {
846856 if (ContentProperty->IsA (FInt64Property::StaticClass ()))
847857 {
848- ULootLockerServerNotificationsRequest::SendNotificationToPlayerWithLargeIntContent (NotificationType, Priority, RecipientPlayerUlid, *ContentProperty->ContainerPtrToValuePtr <long long >(ContentContainerAddress), Properties, OnCompletedRequest);
858+ ULootLockerServerNotificationsRequest::SendNotificationToPlayerWithLargeIntContent (NotificationType, Priority, RecipientPlayerUlid, *ContentProperty->ContainerPtrToValuePtr <long long >(ContentContainerAddress), Properties, OnCompletedRequest);
849859 } else
850860 {
851861 ULootLockerServerNotificationsRequest::SendNotificationToPlayerWithIntContent (NotificationType, Priority, RecipientPlayerUlid, *ContentProperty->ContainerPtrToValuePtr <int >(ContentContainerAddress), Properties, OnCompletedRequest);
0 commit comments