Skip to content

Commit 57ecc60

Browse files
committed
Properly distinguish other scores from personal highscores
1 parent 42b0f62 commit 57ecc60

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Refresh.Database/GameDatabaseContext.Leaderboard.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public DatabaseScoreList GetTopScoresForLevel(GameLevel level, int count, int sk
101101
scores = scores.Where(s => s.ScoreType == scoreType);
102102

103103
if (!showDuplicates)
104-
scores = scores.DistinctBy(s => s.PlayerIds[0]);
104+
scores = scores.DistinctBy(s => s.PublisherId);
105105

106106
if (minAge != null)
107107
scores = scores.Where(s => s.ScoreSubmitted >= minAge);
@@ -119,7 +119,7 @@ public DatabaseScoreList GetRankedScoresAroundScore(GameScore score, int count,
119119
.Where(s => s.ScoreType == score.ScoreType && s.LevelId == score.LevelId)
120120
.OrderByDescending(s => s.Score)
121121
.ToArray()
122-
.DistinctBy(s => s.PlayerIds[0])
122+
.DistinctBy(s => s.PublisherId)
123123
.ToList();
124124

125125
return new
@@ -141,7 +141,7 @@ public DatabaseScoreList GetLevelTopScoresByFriends(GameUser user, GameLevel lev
141141
.Where(s => s.LevelId == level.LevelId)
142142
.OrderByDescending(s => s.Score)
143143
.ToArray()
144-
.DistinctBy(s => s.PlayerIds[0])
144+
.DistinctBy(s => s.PublisherId)
145145
//TODO: THIS CALL IS EXTREMELY INEFFECIENT!!! once we are in postgres land, figure out a way to do this effeciently
146146
.Where(s => s.PlayerIds.Any(p => mutuals.Contains(p)));
147147

0 commit comments

Comments
 (0)