diff --git a/CHANGELOG.md b/CHANGELOG.md index 3567fea1cab1d8c5cb6ed9e6a100ff7a82de234e..fa20603b652feae53d7fee67317d65869d039111 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr ## [Unreleased] ### Added - Add new groupsList runtime function. +- Add runtime leaderboardList and leaderboardsGetId functions. +- Add leaderboard/tournament prev_reset field. ### Changed - Include ticket in party matchmaker add operation responses. @@ -15,6 +17,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Log recovered panics in HTTP handler functions at error level rather than info. - Add new langTag, members and open filters to the group listing API. - Upgrade pgx to v4 for improved SQL performance. +- Change RegisterLeaderboardReset runtime function signature. ### Fixed - Ensure all members are correctly listed in party info when there are multiple concurrent successful joins. diff --git a/apigrpc/apigrpc.proto b/apigrpc/apigrpc.proto index 52605146562228529ece7d13f3250267d2bd569c..ca729d8342c30db3cadc92ce7af73b497ae813e8 100644 --- a/apigrpc/apigrpc.proto +++ b/apigrpc/apigrpc.proto @@ -88,18 +88,12 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { service Nakama { // Add friends by ID or username to a user's account. rpc AddFriends (api.AddFriendsRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/friend", - body: "*" - }; + option (google.api.http).post = "/v2/friend"; } // Add users to a group. rpc AddGroupUsers (api.AddGroupUsersRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/group/{group_id}/add", - body: "*" - }; + option (google.api.http).post = "/v2/group/{group_id}/add"; } // Refresh a user's session using a refresh token retrieved from a previous authentication request. @@ -272,17 +266,13 @@ service Nakama { // Ban a set of users from a group. rpc BanGroupUsers (api.BanGroupUsersRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post = "/v2/group/{group_id}/ban", - body: "*" - }; + option (google.api.http).post = "/v2/group/{group_id}/ban"; } // Block one or more users by ID or username. rpc BlockFriends (api.BlockFriendsRequest) returns (google.protobuf.Empty) { option (google.api.http) = { - post: "/v2/friend/block", - body: "*" + post: "/v2/friend/block" }; } @@ -373,10 +363,7 @@ service Nakama { // Kick a set of users from a group. rpc KickGroupUsers (api.KickGroupUsersRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/group/{group_id}/kick", - body: "*" - }; + option (google.api.http).post = "/v2/group/{group_id}/kick"; } // Leave a group the user is a member of. @@ -528,18 +515,12 @@ service Nakama { // Promote a set of users in a group to the next role up. rpc PromoteGroupUsers (api.PromoteGroupUsersRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/group/{group_id}/promote", - body: "*" - }; + option (google.api.http).post = "/v2/group/{group_id}/promote"; } // Demote a set of users in a group to the next role down. rpc DemoteGroupUsers (api.DemoteGroupUsersRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/group/{group_id}/demote", - body: "*" - }; + option (google.api.http).post = "/v2/group/{group_id}/demote"; } // Get storage objects. diff --git a/apigrpc/apigrpc.swagger.json b/apigrpc/apigrpc.swagger.json index 6142d96eba68d78c56c3affdb34f4a8ee7ffc96f..1a50fba36a8e62900b6e9d395432887d0b2170ce 100644 --- a/apigrpc/apigrpc.swagger.json +++ b/apigrpc/apigrpc.swagger.json @@ -1610,30 +1610,30 @@ "type": "string" }, { - "name": "langTag", - "description": "Language tag filter.", + "name": "cursor", + "description": "Optional pagination cursor.", "in": "query", "required": false, "type": "string" }, { - "name": "members", - "description": "Number of group members.", + "name": "limit", + "description": "Max number of groups to return. Between 1 and 100.", "in": "query", "required": false, "type": "integer", "format": "int32" }, { - "name": "cursor", - "description": "Optional pagination cursor.", + "name": "langTag", + "description": "Language tag filter.", "in": "query", "required": false, "type": "string" }, { - "name": "limit", - "description": "Max number of groups to return. Between 1 and 100.", + "name": "members", + "description": "Number of group members.", "in": "query", "required": false, "type": "integer", @@ -3345,7 +3345,7 @@ "description": "Optional record metadata." }, "operator": { - "$ref": "#/definitions/apiOverrideOperator", + "$ref": "#/definitions/apiOperator", "description": "Operator override." } }, @@ -3369,7 +3369,7 @@ "description": "A JSON object of additional properties (optional)." }, "operator": { - "$ref": "#/definitions/apiOverrideOperator", + "$ref": "#/definitions/apiOperator", "description": "Operator override." } }, @@ -4097,7 +4097,7 @@ }, "description": "A collection of zero or more notifications." }, - "apiOverrideOperator": { + "apiOperator": { "type": "string", "enum": [ "NO_OVERRIDE", @@ -4341,7 +4341,7 @@ "sortOrder": { "type": "integer", "format": "int64", - "description": "ASC or DESC sort mode of scores in the tournament." + "description": "ASC (0) or DESC (1) sort mode of scores in the tournament." }, "size": { "type": "integer", @@ -4400,6 +4400,15 @@ "type": "integer", "format": "int64", "description": "The UNIX time when the tournament start being active. A computed value." + }, + "prevReset": { + "type": "integer", + "format": "int64", + "description": "The UNIX time when the tournament was last reset. A computed value." + }, + "operator": { + "$ref": "#/definitions/apiOperator", + "description": "Operator." } }, "description": "A tournament on the server." diff --git a/console/console.swagger.json b/console/console.swagger.json index c7e8fede57a094734e81581ff4e248dfbd788182..737c3567fd5a125d9f9847c432d5caff495e4def 100644 --- a/console/console.swagger.json +++ b/console/console.swagger.json @@ -974,7 +974,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/consoleLeaderboardList" + "$ref": "#/definitions/nakamaconsoleLeaderboardList" } }, "default": { @@ -997,7 +997,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/consoleLeaderboard" + "$ref": "#/definitions/nakamaconsoleLeaderboard" } }, "default": { @@ -2466,117 +2466,6 @@ }, "description": "A console user session." }, - "consoleLeaderboard": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the leaderboard." - }, - "title": { - "type": "string", - "description": "The title for the leaderboard." - }, - "description": { - "type": "string", - "description": "The description of the leaderboard. May be blank." - }, - "category": { - "type": "integer", - "format": "int64", - "description": "The category of the leaderboard. e.g. \"vip\" could be category 1." - }, - "sortOrder": { - "type": "integer", - "format": "int64", - "description": "ASC or DESC sort mode of scores in the leaderboard." - }, - "size": { - "type": "integer", - "format": "int64", - "description": "The current number of players in the leaderboard." - }, - "maxSize": { - "type": "integer", - "format": "int64", - "description": "The maximum number of players for the leaderboard." - }, - "maxNumScore": { - "type": "integer", - "format": "int64", - "description": "The maximum score updates allowed per player for the current leaderboard." - }, - "operator": { - "type": "integer", - "format": "int64", - "title": "The operator of the leaderboard" - }, - "endActive": { - "type": "integer", - "format": "int64", - "description": "The UNIX time when the leaderboard stops being active until next reset. A computed value." - }, - "resetSchedule": { - "type": "string", - "description": "Reset cron expression." - }, - "metadata": { - "type": "string", - "description": "Additional information stored as a JSON object." - }, - "createTime": { - "type": "string", - "format": "date-time", - "description": "The UNIX time when the leaderboard was created." - }, - "startTime": { - "type": "string", - "format": "date-time", - "description": "The UNIX time when the leaderboard will start." - }, - "endTime": { - "type": "string", - "format": "date-time", - "description": "The UNIX time when the leaderboard will be stopped." - }, - "duration": { - "type": "integer", - "format": "int64", - "description": "Duration of the tournament in seconds." - }, - "startActive": { - "type": "integer", - "format": "int64", - "description": "The UNIX time when the leaderboard start being active. A computed value." - }, - "joinRequired": { - "type": "boolean", - "description": "Join required." - }, - "authoritative": { - "type": "boolean", - "description": "Authoritative." - }, - "tournament": { - "type": "boolean", - "description": "Tournament." - } - }, - "description": "A leaderboard." - }, - "consoleLeaderboardList": { - "type": "object", - "properties": { - "leaderboards": { - "type": "array", - "items": { - "$ref": "#/definitions/consoleLeaderboard" - }, - "description": "The list of leaderboards returned." - } - }, - "description": "A list of leaderboards." - }, "consoleMatchState": { "type": "object", "properties": { @@ -3076,6 +2965,117 @@ }, "description": "Account information." }, + "nakamaconsoleLeaderboard": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the leaderboard." + }, + "title": { + "type": "string", + "description": "The title for the leaderboard." + }, + "description": { + "type": "string", + "description": "The description of the leaderboard. May be blank." + }, + "category": { + "type": "integer", + "format": "int64", + "description": "The category of the leaderboard. e.g. \"vip\" could be category 1." + }, + "sortOrder": { + "type": "integer", + "format": "int64", + "description": "ASC or DESC sort mode of scores in the leaderboard." + }, + "size": { + "type": "integer", + "format": "int64", + "description": "The current number of players in the leaderboard." + }, + "maxSize": { + "type": "integer", + "format": "int64", + "description": "The maximum number of players for the leaderboard." + }, + "maxNumScore": { + "type": "integer", + "format": "int64", + "description": "The maximum score updates allowed per player for the current leaderboard." + }, + "operator": { + "type": "integer", + "format": "int64", + "title": "The operator of the leaderboard" + }, + "endActive": { + "type": "integer", + "format": "int64", + "description": "The UNIX time when the leaderboard stops being active until next reset. A computed value." + }, + "resetSchedule": { + "type": "string", + "description": "Reset cron expression." + }, + "metadata": { + "type": "string", + "description": "Additional information stored as a JSON object." + }, + "createTime": { + "type": "string", + "format": "date-time", + "description": "The UNIX time when the leaderboard was created." + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "The UNIX time when the leaderboard will start." + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "The UNIX time when the leaderboard will be stopped." + }, + "duration": { + "type": "integer", + "format": "int64", + "description": "Duration of the tournament in seconds." + }, + "startActive": { + "type": "integer", + "format": "int64", + "description": "The UNIX time when the leaderboard start being active. A computed value." + }, + "joinRequired": { + "type": "boolean", + "description": "Join required." + }, + "authoritative": { + "type": "boolean", + "description": "Authoritative." + }, + "tournament": { + "type": "boolean", + "description": "Tournament." + } + }, + "description": "A leaderboard." + }, + "nakamaconsoleLeaderboardList": { + "type": "object", + "properties": { + "leaderboards": { + "type": "array", + "items": { + "$ref": "#/definitions/nakamaconsoleLeaderboard" + }, + "description": "The list of leaderboards returned." + } + }, + "description": "A list of leaderboards." + }, "nakamaconsoleUpdateAccountRequest": { "type": "object", "properties": { diff --git a/console/ui/dist/index.html b/console/ui/dist/index.html index 8561e429391dc1554acd15c2ad4b77df2e94b50d..5ec60b91df728492d3d6eccce1eca680618c60f2 100644 --- a/console/ui/dist/index.html +++ b/console/ui/dist/index.html @@ -10,5 +10,5 @@