Hi, I want to use STEAM_CALLBACK macro to register Steam Callback when user info is retrieved. My Unreal Engine project uses Steamworks SDK and everything works quite normally (Loobies, Leaderboards, Achievements… etc).
Issue I have is when I want to retrieve persona info. Callback is executed multiple times even though I have called RequestUserInformation
only once. Output can be seen in the image attached.
Steam SDK version is 151
my .h file
STEAM_CALLBACK(USteamHelper, OnPersonaStateChange, PersonaStateChange_t);
PersonaStateChange_t PlayerResponse;
void RequestFriendsInfo(const FString& UniqueNetId, PlayerAvatarSize AvatarSize)
.cpp
void USteamHelper::RequestFriendsInfo(const FString& UniqueNetId, PlayerAvatarSize AvatarSize)
{
if (SteamAPI_Init())
{
const uint64 Int64Id = FCString::Atoi64(*UniqueNetId);
const bool InfoAlreadyDownloaded = !SteamFriends()->RequestUserInformation(Int64Id, false);
if (InfoAlreadyDownloaded)
{
UE_LOG(LogTemp, Warning, TEXT("All good for: %s"), *UniqueNetId)
} else
{
UE_LOG(LogTemp, Warning, TEXT("Downloading for: %s"), *UniqueNetId)
}
}
}
void USteamHelper::OnPersonaStateChange(PersonaStateChange_t* Response)
{
const uint64 ResponseId = Response->m_ulSteamID;
UE_LOG(LogTemp, Warning, TEXT("Finally got the response for %llu"), ResponseId);
}