Commit c16b4459 authored by Mo Firouz's avatar Mo Firouz
Browse files

Fix delayed first time invocation of tournament and leaderboard callbacks. #350.

Expired tournaments will no longer be listed nor any records will be returned.
Add overridable expiry time when listing leaderboard/tournaments records.
parent 3082e57d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -8,12 +8,14 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Explicitly set cache control header in all API responses.
- Add support for CockroachDB 19.1.
- Add tournament start active timestamp to the API response.
- Add overridable expiry time when listing leaderboard/tournaments records.

### Changed
- Tournament start time can be set to past time.

### Fixed
- Fix delayed first time invocation of tournament and leaderboard callbacks.
- Expired tournaments will no longer be listed nor any records will be returned.

## [2.5.1] - 2019-05-03
### Changed
+265 −227

File changed.

Preview size limit exceeded, changes collapsed.

+8 −0
Original line number Diff line number Diff line
@@ -514,6 +514,8 @@ message ListLeaderboardRecordsAroundOwnerRequest {
  google.protobuf.UInt32Value limit = 2;
  // The owner to retrieve records around.
  string owner_id = 3;
  // Expiry in seconds (since epoch) to begin fetching records from.
  google.protobuf.Int64Value expiry = 4;
}

// List leaderboard records from a given leaderboard.
@@ -526,6 +528,8 @@ message ListLeaderboardRecordsRequest {
  google.protobuf.Int32Value limit = 3;
  // A next or previous page cursor.
  string cursor = 4;
  // Expiry in seconds (since epoch) to begin fetching records from. Optional. 0 means from current time.
  google.protobuf.Int64Value expiry = 5;
}

// List realtime matches.
@@ -572,6 +576,8 @@ message ListTournamentRecordsAroundOwnerRequest {
  google.protobuf.UInt32Value limit = 2;
  // The owner to retrieve records around.
  string owner_id = 3;
  // Expiry in seconds (since epoch) to begin fetching records from.
  google.protobuf.Int64Value expiry = 4;
}

// List tournament records from a given tournament.
@@ -584,6 +590,8 @@ message ListTournamentRecordsRequest {
  google.protobuf.Int32Value limit = 3;
  // A next or previous page cursor.
  string cursor = 4;
  // Expiry in seconds (since epoch) to begin fetching records from.
  google.protobuf.Int64Value expiry = 5;
}

// List active/upcoming tournaments based on given filters.
+32 −0
Original line number Diff line number Diff line
@@ -1379,6 +1379,14 @@
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "expiry",
            "description": "Expiry in seconds (since epoch) to begin fetching records from. Optional. 0 means from current time.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
@@ -1477,6 +1485,14 @@
            "required": false,
            "type": "integer",
            "format": "int64"
          },
          {
            "name": "expiry",
            "description": "Expiry in seconds (since epoch) to begin fetching records from.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
@@ -1815,6 +1831,14 @@
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "expiry",
            "description": "Expiry in seconds (since epoch) to begin fetching records from.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
@@ -2080,6 +2104,14 @@
            "required": false,
            "type": "integer",
            "format": "int64"
          },
          {
            "name": "expiry",
            "description": "Expiry in seconds (since epoch) to begin fetching records from.",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "int64"
          }
        ],
        "tags": [
+1 −1
Original line number Diff line number Diff line
@@ -818,7 +818,7 @@ type NakamaModule interface {
	TournamentJoin(ctx context.Context, id, ownerID, username string) error
	TournamentList(ctx context.Context, categoryStart, categoryEnd, startTime, endTime, limit int, cursor string) (*api.TournamentList, error)
	TournamentRecordWrite(ctx context.Context, id, ownerID, username string, score, subscore int64, metadata map[string]interface{}) (*api.LeaderboardRecord, error)
	TournamentRecordsHaystack(ctx context.Context, id, ownerID string, limit int) ([]*api.LeaderboardRecord, error)
	TournamentRecordsHaystack(ctx context.Context, id, ownerID string, limit int, expiry int64) ([]*api.LeaderboardRecord, error)

	GroupsGetId(ctx context.Context, groupIDs []string) ([]*api.Group, error)
	GroupCreate(ctx context.Context, userID, name, creatorID, langTag, description, avatarUrl string, open bool, metadata map[string]interface{}, maxCount int) (*api.Group, error)
Loading