I need to retrieve a list of all entries from a Steam Leaderboard. The default UE4 online subsystem does not support such a feature (it only allows to retrieve scores for a given player, but not the whole list). But the underlying Steam SDK does provide such a method. So I tried to access those underlying objects somehow:
#include "Online.h" #include "Runtime/Online/OnlineSubsystemSteam/Public/OnlineSubsystemSteam.h" #include "Runtime/Online/OnlineSubsystem/Public/Interfaces/OnlineLeaderboardInterface.h" IOnlineSubsystem* ion = IOnlineSubsystem::Get(FName("Steam")); IOnlineLeaderboardsPtr leaderboards = ion->GetLeaderboardsInterface(); // FOnlineLeaderboardsSteam* lbSteam = reinterpret_cast<FOnlineLeaderboardsSteam*>(leaderboards.Get()); FOnlineLeaderboardsSteam* lbSteam = (FOnlineLeaderboardsSteam*) leaderboards.Get(); lbSteam->FlushLeaderboards("highscores"); // this leads to an error
The last line leads to the following compile error: "use of undefined type ‘FOnlineLeaderboardsSteam’"
So I looked through the engine code base, and the class “FOnlineLeaderboardsSteam” is declared in “OnlineLeaderboardInterfaceSteam.h”. Thus I tried to include that file as well:
But that in turn leads to a whole bunch of compile errors, I guess I should not include any classes from the private branch directly.
So this leads me to the following questions:
- How do I correctly access this (internal?) “FOnlineLeaderboardsSteam” class?
- Alternatively, how is one supposed to retrieve a list of all/multople Steam Leaderboard entries?
Thanks in advance for any hint and suggestion!