cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing leaderboards in Unreal Engine 4

Avengar
Honored Guest
Hello there!

I'm currently trying to write basic functions that read/write leaderboard in c++. However after reading documentation and some code in OnlineLeaderboardInterfaceOculus.cpp i still have no idea how to do it properly.

This is what i tried to do:

void MyOculusClass::WriteLeaderboard(FString BoardName, int score)
{
FOnlineSubsystemOculus* OculusSubsystem = new FOnlineSubsystemOculus();
const char *LBname = TCHAR_TO_ANSI(*BoardName);
OculusSubsystem->AddRequestDelegate(ovr_Leaderboard_WriteEntry(LBname, score, nullptr, 0, false), FOculusMessageOnCompleteDelegate::CreateLambda([this](ovrMessageHandle Message, bool bIsError)
{
if (bIsError)
{
auto Error = ovr_Message_GetError(Message);
auto ErrorMessage = ovr_Error_GetMessage(Error);
UE_LOG_ONLINE(Error, TEXT("%s"), *FString(ErrorMessage));
}
}));
}


Is this good way to approach it? Would appreciate if someone can show me some basic code or give me clues about writing it 🙂
2 REPLIES 2

Anonymous
Not applicable
No idea mate. Your best bet would be to post this question in the c++ section of the Unreal Engine forums here:

https://forums.unrealengine.com/forumdisplay.php?9-C-Gameplay-Programming

Avengar
Honored Guest
Already did it. Gonna fight some more with it i guess