I created a leaderboard for racing game. The lowest time should be on top in the leaderboard. I multiply the values with -1 in the client application and after that I submit the values to the leaderboard. And when I call GetLeaderboardRequest() in the client application to receive the leaderboard values from PlayFab, then I multiply again with -1 to get the correct value.
In this example, 4 different players had the same time 5. But the problem is, when I use "entry.Position + 1;", then I don't know who was the first of the 4 players who submitted his time in the leaderboard.
foreach (var entry in result.Result.Leaderboard) { // Print regular leaderboard entry information Console.WriteLine($"{entry.Position + 1} {entry.PlayFabId} {entry.StatValue * -1}"); }
Is it possible to find out who was the first player that submitted a time if more than one player has the same time in a leaderboard? In this case, I could determine the winner in a leaderboard.
If it is not possible, then I will sort the received PlayFab leaderboard list in the client application like in this example, but in this case I have more than one winner in the leaderboard.
For example:
Winner: PlayerA, PlayerB, PlayerC, PlayerD : -5
Second place: PlayerZ : -6
Third place: PlayerH, PlayerU : -8
I found out that ranking in a leaderboard is not based on time if more than one player has the same value in a leaderboard, because I did the following test(in chronological order):
B7B157BCE72CA94 submitted the time -5.
4870F0A53990136E submitted the time -5.
BEFC1AFD845D8567 submitted the time -5.
1F93F4835D268BC0 submitted the time -5.
But when I call GetLeaderboardRequest(), then the order looks like this:
{"PlayerId":"4870F0A53990136E","Value":-5} {"PlayerId":"1F93F4835D268BC0","Value":-5} {"PlayerId":"B7B157BCE72CA94","Value":-5} {"PlayerId":"BEFC1AFD845D8567","Value":-5}
Normally, B7B157BCE72CA94 should be on the first place in the leaderboard because he submitted his time earlier to the leaderboard but PlayFab added 4870F0A53990136E on the first place.
Is it not possible to determine only one winner if more than one player has the same value in the leaderboard?