I’ve just started with UE5 and there’s a lot of examples how to create a session via Steam, but there’s no any examples how to call Steamworks api. I want a basic, get a player name. I set up steam online subsystem, but API is still unavailable. Here’s my GameInstance class.
#include "MyGameInstance.h"
UMyGameInstance::UMyGameInstance() {
}
void UMyGameInstance::Init() {
Super::Init();
// SteamAPI_Init(); should I use it?
IOnlineSubsystem* Subsystem = IOnlineSubsystem::Get();
const FOnlineSubsystemSteam* Oss = static_cast<FOnlineSubsystemSteam*>(Subsystem);
// this line gives me "Cannot resolve symbol 'SteamUser'"
const auto SteamID = FString(std::to_string(SteamUser()->GetSteamID().ConvertToUint64()).c_str());
const auto AppID = FString(std::to_string(Oss->GetSteamAppId()).c_str());
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, AppID);
}
But SteamUser or SteamAPI_Init are unavailable. Also I found in the class UE_5.0\Engine\Plugins\Online\OnlineSubsystemSteam\Source\Private\OnlineFriendsInterfaceSteam.h
GetRealName() and GetDisplayName() functions, can I somehow use it?