How I can return custom type from my UFUNCTION?
HEADER
#pragma once
#include "CoreMinimal.h"
#include "Online.h"
#include "H3D_SteamOSS.generated.h" // always be last
UCLASS()
class H3D_LOBBY_API UH3D_SteamOSS : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintPure, category = "Steam Subsystem BP")
/**
* Get current Steam OSS
*
* @param no params
*
* @return IOnlineSubsystem representing the Steam OSS
*/
static IOnlineSubsystem* GetCurrentOnlineSubSystem_Harda();
};
CPP
#include "H3D_SteamOSS.h"
IOnlineSubsystem*
UH3D_SteamOSS::GetCurrentOnlineSubSystem_Harda()
{
IOnlineSubsystem* ion = IOnlineSubsystem::Get(FName("Steam"));
if (ion == nullptr)
{
UE_LOG(LogTemp, Warning, TEXT("error: unable to get Steam OSS"));
return nullptr;
}
return ion;
}
Compile error: Unrecognized type 'IOnlineSubsystem' - type must be a UCLASS, USTRUCT or UENUM