Loading CHANGELOG.md +2 −1 Original line number Diff line number Diff line Loading @@ -20,13 +20,14 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr ### Fixed - Correct cursor usage in group listings using only open/closed group state filter. - Remap original Google IDs to "next generation player IDs". - Fix issue delivering persistent SendAll notifications to large numbers of users. - Remove incorrect category start and category end parameters from runtime leaderboard list functions. - Graceful handling of idempotent tournament creation operations. - Correct sorting of batched storage write and delete operations. - Fix indexing of channel message list responses in Lua runtime. - Better handling of parameters submitted from the devconsole UI. - Remap original Google IDs to "next generation player IDs" - Return ordered owner records in leaderboard/tournament records listings. ## [3.16.0] - 2023-04-18 ### Added Loading server/core_leaderboard.go +27 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import ( "encoding/base64" "encoding/gob" "errors" "sort" "strconv" "strings" "time" Loading Loading @@ -343,6 +344,32 @@ func LeaderboardRecordsList(ctx context.Context, logger *zap.Logger, db *sql.DB, _ = rows.Close() } // Sort owner records according to leaderboard ordering var sortFn func(i, j int) bool if leaderboard.SortOrder == LeaderboardSortOrderAscending { sortFn = func(i, j int) bool { if ownerRecords[i].Score == ownerRecords[j].Score { if ownerRecords[i].Subscore == ownerRecords[j].Subscore { return ownerRecords[i].OwnerId < ownerRecords[j].OwnerId } return ownerRecords[i].Subscore < ownerRecords[j].Subscore } return ownerRecords[i].Score < ownerRecords[j].Score } } else { sortFn = func(i, j int) bool { if ownerRecords[i].Score == ownerRecords[j].Score { if ownerRecords[i].Subscore == ownerRecords[j].Subscore { return ownerRecords[i].OwnerId > ownerRecords[j].OwnerId } return ownerRecords[i].Subscore > ownerRecords[j].Subscore } return ownerRecords[i].Score > ownerRecords[j].Score } } sort.Slice(ownerRecords, sortFn) // Bulk fill in the ranks of any owner records requested. rankCache.Fill(leaderboardId, leaderboard.SortOrder, expiryTime, ownerRecords) Loading Loading
CHANGELOG.md +2 −1 Original line number Diff line number Diff line Loading @@ -20,13 +20,14 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr ### Fixed - Correct cursor usage in group listings using only open/closed group state filter. - Remap original Google IDs to "next generation player IDs". - Fix issue delivering persistent SendAll notifications to large numbers of users. - Remove incorrect category start and category end parameters from runtime leaderboard list functions. - Graceful handling of idempotent tournament creation operations. - Correct sorting of batched storage write and delete operations. - Fix indexing of channel message list responses in Lua runtime. - Better handling of parameters submitted from the devconsole UI. - Remap original Google IDs to "next generation player IDs" - Return ordered owner records in leaderboard/tournament records listings. ## [3.16.0] - 2023-04-18 ### Added Loading
server/core_leaderboard.go +27 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import ( "encoding/base64" "encoding/gob" "errors" "sort" "strconv" "strings" "time" Loading Loading @@ -343,6 +344,32 @@ func LeaderboardRecordsList(ctx context.Context, logger *zap.Logger, db *sql.DB, _ = rows.Close() } // Sort owner records according to leaderboard ordering var sortFn func(i, j int) bool if leaderboard.SortOrder == LeaderboardSortOrderAscending { sortFn = func(i, j int) bool { if ownerRecords[i].Score == ownerRecords[j].Score { if ownerRecords[i].Subscore == ownerRecords[j].Subscore { return ownerRecords[i].OwnerId < ownerRecords[j].OwnerId } return ownerRecords[i].Subscore < ownerRecords[j].Subscore } return ownerRecords[i].Score < ownerRecords[j].Score } } else { sortFn = func(i, j int) bool { if ownerRecords[i].Score == ownerRecords[j].Score { if ownerRecords[i].Subscore == ownerRecords[j].Subscore { return ownerRecords[i].OwnerId > ownerRecords[j].OwnerId } return ownerRecords[i].Subscore > ownerRecords[j].Subscore } return ownerRecords[i].Score > ownerRecords[j].Score } } sort.Slice(ownerRecords, sortFn) // Bulk fill in the ranks of any owner records requested. rankCache.Fill(leaderboardId, leaderboard.SortOrder, expiryTime, ownerRecords) Loading