Forum Discussion
sean_vitei
5 years agoHonored Guest
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?
1 Reply
- sean_viteiHonored GuestIt's been a while since I posted this, so I can't remember if this was all I needed, but I needed to add QuestAppID to settings in addition to OculusAppID.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago