Skip to content

Commit

Permalink
Lift upper limit on list leaderboard records up to 1,000 per page.
Browse files Browse the repository at this point in the history
  • Loading branch information
novabyte committed Mar 14, 2024
1 parent 676ebb7 commit aacd69c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr

## [Unreleased]
### Changes
- Reduce number of memory allocations in leaderboard cache
- Reduce number of memory allocations in leaderboard cache.
- List leaderboard records can now return up to 1,000 records per request.

### Fixed
- Prevent players from requesting duplicate joins to the same party.
Expand Down
4 changes: 2 additions & 2 deletions server/api_leaderboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ func (s *ApiServer) ListLeaderboardRecords(ctx context.Context, in *api.ListLead

var limit *wrapperspb.Int32Value
if in.GetLimit() != nil {
if in.GetLimit().Value < 1 || in.GetLimit().Value > 100 {
return nil, status.Error(codes.InvalidArgument, "Invalid limit - limit must be between 1 and 100.")
if in.GetLimit().Value < 1 || in.GetLimit().Value > 1000 {
return nil, status.Error(codes.InvalidArgument, "Invalid limit - limit must be between 1 and 1000.")
}
limit = in.GetLimit()
} else if len(in.GetOwnerIds()) == 0 || in.GetCursor() != "" {
Expand Down

0 comments on commit aacd69c

Please sign in to comment.