Skip to content

Commit

Permalink
Increase group user list runtime limit (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
sesposito authored Aug 22, 2024
1 parent 4229648 commit 12abcf8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project are documented below.
The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org).

## [Unreleased]
### Changed
- Increased limit on runtimes group users list functions.

### Fixed
- Ensure matchmaker stats behave correctly if matchmaker becomes fully empty and idle.

Expand Down
5 changes: 3 additions & 2 deletions server/runtime_go_nakama.go
Original file line number Diff line number Diff line change
Expand Up @@ -2445,6 +2445,7 @@ func (n *RuntimeGoNakamaModule) LeaderboardRecordsList(ctx context.Context, id s
}
}


var limitWrapper *wrapperspb.Int32Value
if limit < 0 || limit > 10000 {
return nil, nil, "", "", errors.New("expects limit to be 0-10000")
Expand Down Expand Up @@ -3731,8 +3732,8 @@ func (n *RuntimeGoNakamaModule) GroupUsersList(ctx context.Context, id string, l
return nil, "", errors.New("expects group ID to be a valid identifier")
}

if limit < 1 || limit > 100 {
return nil, "", errors.New("expects limit to be 1-100")
if limit < 1 || limit > 10000 {
return nil, "", errors.New("expects limit to be 1-10000")
}

var stateWrapper *wrapperspb.Int32Value
Expand Down
4 changes: 2 additions & 2 deletions server/runtime_javascript_nakama.go
Original file line number Diff line number Diff line change
Expand Up @@ -7110,8 +7110,8 @@ func (n *runtimeJavascriptNakamaModule) groupUsersList(r *goja.Runtime) func(goj
limit := 100
if !goja.IsUndefined(f.Argument(1)) && !goja.IsNull(f.Argument(1)) {
limit = int(getJsInt(r, f.Argument(1)))
if limit < 1 || limit > 100 {
panic(r.NewTypeError("expects limit to be 1-100"))
if limit < 1 || limit > 10000 {
panic(r.NewTypeError("expects limit to be 1-10000"))
}
}

Expand Down
4 changes: 2 additions & 2 deletions server/runtime_lua_nakama.go
Original file line number Diff line number Diff line change
Expand Up @@ -9261,8 +9261,8 @@ func (n *RuntimeLuaNakamaModule) groupUsersList(l *lua.LState) int {
}

limit := l.OptInt(2, 100)
if limit < 1 || limit > 100 {
l.ArgError(2, "expects limit to be 1-100")
if limit < 1 || limit > 10000 {
l.ArgError(2, "expects limit to be 1-10000")
return 0
}

Expand Down

0 comments on commit 12abcf8

Please sign in to comment.