Leaderboards: EGS ReadLeaderboards ranking issue

When using ReadLeaderboards with a list of users. For users that don’t exist on that leaderboard the user score comes as 0 and they are also included in ranking returning incorrect ranks.

Hello, are you referring to the learderboard row that is added here? The rank returned should be set to -1. You could comment this code out if you prefer not to have the row added to the leaderboard.

Yeah, If you see it is also used in https://github.com/EpicGames/UnrealEngine/blame/d373245709011c7a482768991c65ebde5128fb06/Engine/Plugins/Online/OnlineSubsystemEOS/Source/OnlineSubsystemEOS/Private/OnlineLeaderboardsEOS.cpp#L191C16-L191C16

at line 191. So the rank will be positive and incorrect.

I see a few issues in the ReadLeaderboards API.

  1. If GetProductUserId returns a nullptr we add an empty row and set the rank to -1.
    1. You can fix this by removing the call to AddEmptyRowForPlayer
  2. If EOS_Leaderboards_CopyLeaderboardUserScoreByUserId doesn’t return success (like EOS_NotFound) we add a column and set the score to 0
    1. You can fix this by only adding a column if UserCopyResult == EOS_EResult::EOS_Success.
  3. We build ranks using (1) and (2) in the data set, skewing the actual ranks.

I’ll report this to the plugin engineering team, and we’ll work on getting a fix out.

okay, thankyou. I will be making these changes for now.