Retrieving Oculus Leaderboard Entries always fails
I am trying to get a list of leaderboard entries using the Oculus Online Subsystem. This is what my code looks like:
That first log message never sends, which is OK -- the Oculus implementation of ReadLeaderboards always returns true.
However, MyReceiveEntriesCallback always prints the fail message. Digging into the Oculus cpp files, ReadLeaderboards calls ovr_Leaderboard_GetEntries, which is what fails.
I'm not sure why it is failing. I am able to write Leaderboard entries just fine with ovr_Leaderboard_WriteEntry, and I can get leaderboard information with the same API name via the HTTP REST API.
Is there something I'm missing, such as something in setting up the ReadObjectRef? How have you all implemented getting leaderboard entries?
{
...
IOnlineLeaderboardsPtr LB = IOnlineSubsystem::Get()->GetLeaderboardsInterface();
ReadObjectPtr = MakeShareable(new FOnlineLeaderboardRead());
ReadObjectPtr->LeaderboardName = "MY_TEST_LB_API_NAME";
ReadObjectPtr->ReadState = EOnlineAsyncTaskState::NotStarted;
FOnlineLeaderboardReadRef ReadObjectRef = ReadObjectPtr.ToSharedRef();
const TArray<TSharedRef<const FUniqueNetId>> Players;
LB->OnLeaderboardReadCompleteDelegates.AddRaw(this, &FMyClass::MyReceiveEntriesCallback); if (!LB->ReadLeaderboards(Players, ReadObjectRef)) {
UE_LOG(LogTemp, Log, TEXT("Begin read Leaderboards failed"));
}
...
}
void FMyClass::OnReceiveLeaderboardEntries(bool bSucceeded)
{
if (bSucceeded)
{
UE_LOG(LogTemp, Log, TEXT("LB Read succeeded"));
}
else
{
UE_LOG(LogTemp, Log, TEXT("LB Read Failed "));
}
}That first log message never sends, which is OK -- the Oculus implementation of ReadLeaderboards always returns true.
However, MyReceiveEntriesCallback always prints the fail message. Digging into the Oculus cpp files, ReadLeaderboards calls ovr_Leaderboard_GetEntries, which is what fails.
I'm not sure why it is failing. I am able to write Leaderboard entries just fine with ovr_Leaderboard_WriteEntry, and I can get leaderboard information with the same API name via the HTTP REST API.
Is there something I'm missing, such as something in setting up the ReadObjectRef? How have you all implemented getting leaderboard entries?
