FOnlineLeaderboardsEOS::ReadLeaderboardsAroundRank is hard-coded to filter non-Epic accounts

We have a game supporting Steam and EGS where we want cross-store leaderboards shown in game. We were seeing that Steam users were not showing up in the in-game leaderboards, despite seeing them in the dev portal and in the sample leaderboard app. We discovered that this bit of code in FOnlineLeaderboardsEOS::ReadLeaderboardsAroundRank is the culprit:

EOS_Connect_GetProductUserIdMappingOptions Options = { };
Options.ApiVersion = 1;
UE_EOS_CHECK_API_MISMATCH(EOS_CONNECT_GETPRODUCTUSERIDMAPPING_API_LATEST, 1);
Options.AccountIdType = EOS_EExternalAccountType::EOS_EAT_EPIC;
Options.LocalUserId = EOSSubsystem->UserManager->GetLocalProductUserId(0);

// Allow for us reading a page out of the whole stats range returned
for (uint32 Index = StartIndex; Index <= NewEndIndex; Index++)
{
    CopyOptions.LeaderboardRecordIndex = Index;

    EOS_Leaderboards_LeaderboardRecord* Record = nullptr;
    EOS_EResult Result = EOS_Leaderboards_CopyLeaderboardRecordByIndex(EOSSubsystem->LeaderboardsHandle, &CopyOptions, &Record);
    if (Result == EOS_EResult::EOS_Success)
    {
       char EpicIdStr[EOS_CONNECT_EXTERNAL_ACCOUNT_ID_MAX_LENGTH+1];
       int32 EpicIdStrSize = sizeof(EpicIdStr);
       Options.TargetProductUserId = Record->UserId;

       Result = EOS_Connect_GetProductUserIdMapping(EOSSubsystem->ConnectHandle, &Options, EpicIdStr, &EpicIdStrSize);
       if (Result == EOS_EResult::EOS_Success)
       {
...

This makes it impossible for us to do what we want without implementing our own version of the Online Subsystem or modifying the engine code.

The API is indeed designed with the assumption that Epic Account Services is being used. I’m assuming on your Steam build, players may not be logging into Epic Account Services, and logging into Game Services with their Steam account directly? I’ll see if there is a way to modify the design here, but it won’t be trivial, as on certain console platforms, our backend won’t return account information if the request is not from the same console. The code in OnlineSubsystemEOS is meant to be platform agnostic.

Yeah, the code is designed this way in the plugin, as the Net Id when EAS is used is EpicAccountId|PUID. The code is doing a lookup for the EpicAccountId based on the PUID. I think we should be able to modify this code to only do the lookup if EAS is being used; otherwise, build the NetId with the PUID only. I’ll create a work item for us to fix the code here in a future version of UE.

Yep, that’s the idea. We wanted auto-login for the Steam builds without requiring EAS account linking, but we also wanted both Steam and EGS builds to share the stats/leaderboards. Posting stats cross-store like this works fine as-is, but this code made it where we couldn’t get the leaderboards with all users on them. I was able to get around it by removing the account-checking code in that method. The sample leaderboard app doesn’t do those checks, so it seems like they’re not really necessary anyway.