Skip to content

Commit

Permalink
fix: ws group score ranking 처리 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Aug 26, 2024
1 parent a6d82f5 commit 4ea0f4f
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,20 @@ data class GroupUserEventMessage(
return GroupUserEventMessage(
groupId = groupId,
groupUsers = userInfoByUid.mapNotNull { (uid, info) ->
val groupUSer = groupUserById[uid] ?: return@mapNotNull null
val groupUser = groupUserById[uid] ?: return@mapNotNull null

ConcurrentUser(
groupUserId = groupUSer.id,
groupUserId = groupUser.id,
uid = uid,
nickname = info.nickname,
rank = rank.getAndIncrement(),
rank = -1,
score = scoreByUid[uid]?.score ?: 0,
)
}
}.sortedBy { groupScore ->
groupScore.score
}.map { groupScore ->
groupScore.copy(rank = rank.getAndIncrement())
}.take(5)
)
}
}
Expand Down

0 comments on commit 4ea0f4f

Please sign in to comment.